diff options
Diffstat (limited to '')
-rw-r--r-- | docs/sqlglot/expressions.html | 23713 |
1 files changed, 11920 insertions, 11793 deletions
diff --git a/docs/sqlglot/expressions.html b/docs/sqlglot/expressions.html index d2aa9fb..637663f 100644 --- a/docs/sqlglot/expressions.html +++ b/docs/sqlglot/expressions.html @@ -4560,6 +4560,15 @@ </li> <li> + <a class="class" href="#JSONArrayContains">JSONArrayContains</a> + <ul class="memberlist"> + <li> + <a class="variable" href="#JSONArrayContains.key">key</a> + </li> + </ul> + + </li> + <li> <a class="class" href="#Least">Least</a> <ul class="memberlist"> <li> @@ -5765,5825 +5774,5828 @@ SQL expressions, such as <code><a href="#select">sqlglot.expressions.select</a>< </span><span id="L-102"><a href="#L-102"><span class="linenos"> 102</span></a> </span><span id="L-103"><a href="#L-103"><span class="linenos"> 103</span></a> <span class="nd">@property</span> </span><span id="L-104"><a href="#L-104"><span class="linenos"> 104</span></a> <span class="k">def</span> <span class="nf">hashable_args</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">Any</span><span class="p">:</span> -</span><span id="L-105"><a href="#L-105"><span class="linenos"> 105</span></a> <span class="n">args</span> <span class="o">=</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">k</span><span class="p">)</span> <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">arg_types</span><span class="p">)</span> -</span><span id="L-106"><a href="#L-106"><span class="linenos"> 106</span></a> -</span><span id="L-107"><a href="#L-107"><span class="linenos"> 107</span></a> <span class="k">return</span> <span class="nb">tuple</span><span class="p">(</span> -</span><span id="L-108"><a href="#L-108"><span class="linenos"> 108</span></a> <span class="p">(</span><span class="nb">tuple</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 class="k">if</span> <span class="n">arg</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="L-109"><a href="#L-109"><span class="linenos"> 109</span></a> <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span> -</span><span id="L-110"><a href="#L-110"><span class="linenos"> 110</span></a> <span class="k">else</span> <span class="p">(</span><span class="n">_norm_arg</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> <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="k">else</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="L-111"><a href="#L-111"><span class="linenos"> 111</span></a> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">args</span> -</span><span id="L-112"><a href="#L-112"><span class="linenos"> 112</span></a> <span class="p">)</span> -</span><span id="L-113"><a href="#L-113"><span class="linenos"> 113</span></a> -</span><span id="L-114"><a href="#L-114"><span class="linenos"> 114</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-115"><a href="#L-115"><span class="linenos"> 115</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hash</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</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">_hash</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="k">return</span> <span class="nb">hash</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="bp">self</span><span class="o">.</span><span class="n">hashable_args</span><span class="p">))</span> -</span><span id="L-119"><a href="#L-119"><span class="linenos"> 119</span></a> -</span><span id="L-120"><a href="#L-120"><span class="linenos"> 120</span></a> <span class="nd">@property</span> -</span><span id="L-121"><a href="#L-121"><span class="linenos"> 121</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-122"><a href="#L-122"><span class="linenos"> 122</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-123"><a href="#L-123"><span class="linenos"> 123</span></a><span class="sd"> Retrieves the argument with key "this".</span> -</span><span id="L-124"><a href="#L-124"><span class="linenos"> 124</span></a><span class="sd"> """</span> -</span><span id="L-125"><a href="#L-125"><span class="linenos"> 125</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-126"><a href="#L-126"><span class="linenos"> 126</span></a> -</span><span id="L-127"><a href="#L-127"><span class="linenos"> 127</span></a> <span class="nd">@property</span> -</span><span id="L-128"><a href="#L-128"><span class="linenos"> 128</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-129"><a href="#L-129"><span class="linenos"> 129</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-130"><a href="#L-130"><span class="linenos"> 130</span></a><span class="sd"> Retrieves the argument with key "expression".</span> -</span><span id="L-131"><a href="#L-131"><span class="linenos"> 131</span></a><span class="sd"> """</span> -</span><span id="L-132"><a href="#L-132"><span class="linenos"> 132</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-133"><a href="#L-133"><span class="linenos"> 133</span></a> -</span><span id="L-134"><a href="#L-134"><span class="linenos"> 134</span></a> <span class="nd">@property</span> -</span><span id="L-135"><a href="#L-135"><span class="linenos"> 135</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-136"><a href="#L-136"><span class="linenos"> 136</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-137"><a href="#L-137"><span class="linenos"> 137</span></a><span class="sd"> Retrieves the argument with key "expressions".</span> -</span><span id="L-138"><a href="#L-138"><span class="linenos"> 138</span></a><span class="sd"> """</span> -</span><span id="L-139"><a href="#L-139"><span class="linenos"> 139</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-140"><a href="#L-140"><span class="linenos"> 140</span></a> -</span><span id="L-141"><a href="#L-141"><span class="linenos"> 141</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-142"><a href="#L-142"><span class="linenos"> 142</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-143"><a href="#L-143"><span class="linenos"> 143</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-144"><a href="#L-144"><span class="linenos"> 144</span></a><span class="sd"> for args that are strings or leaf Expression instances, such as identifiers and literals.</span> -</span><span id="L-145"><a href="#L-145"><span class="linenos"> 145</span></a><span class="sd"> """</span> -</span><span id="L-146"><a href="#L-146"><span class="linenos"> 146</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-147"><a href="#L-147"><span class="linenos"> 147</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-148"><a href="#L-148"><span class="linenos"> 148</span></a> <span class="k">return</span> <span class="n">field</span> -</span><span id="L-149"><a href="#L-149"><span class="linenos"> 149</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-150"><a href="#L-150"><span class="linenos"> 150</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-151"><a href="#L-151"><span class="linenos"> 151</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-152"><a href="#L-152"><span class="linenos"> 152</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-153"><a href="#L-153"><span class="linenos"> 153</span></a> <span class="k">return</span> <span class="s2">""</span> -</span><span id="L-154"><a href="#L-154"><span class="linenos"> 154</span></a> -</span><span id="L-155"><a href="#L-155"><span class="linenos"> 155</span></a> <span class="nd">@property</span> -</span><span id="L-156"><a href="#L-156"><span class="linenos"> 156</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-157"><a href="#L-157"><span class="linenos"> 157</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-158"><a href="#L-158"><span class="linenos"> 158</span></a><span class="sd"> Checks whether a Literal expression is a string.</span> -</span><span id="L-159"><a href="#L-159"><span class="linenos"> 159</span></a><span class="sd"> """</span> -</span><span id="L-160"><a href="#L-160"><span class="linenos"> 160</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-161"><a href="#L-161"><span class="linenos"> 161</span></a> -</span><span id="L-162"><a href="#L-162"><span class="linenos"> 162</span></a> <span class="nd">@property</span> -</span><span id="L-163"><a href="#L-163"><span class="linenos"> 163</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-164"><a href="#L-164"><span class="linenos"> 164</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-165"><a href="#L-165"><span class="linenos"> 165</span></a><span class="sd"> Checks whether a Literal expression is a number.</span> -</span><span id="L-166"><a href="#L-166"><span class="linenos"> 166</span></a><span class="sd"> """</span> -</span><span id="L-167"><a href="#L-167"><span class="linenos"> 167</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-168"><a href="#L-168"><span class="linenos"> 168</span></a> -</span><span id="L-169"><a href="#L-169"><span class="linenos"> 169</span></a> <span class="nd">@property</span> -</span><span id="L-170"><a href="#L-170"><span class="linenos"> 170</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-171"><a href="#L-171"><span class="linenos"> 171</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-172"><a href="#L-172"><span class="linenos"> 172</span></a><span class="sd"> Checks whether a Literal expression is an integer.</span> -</span><span id="L-173"><a href="#L-173"><span class="linenos"> 173</span></a><span class="sd"> """</span> -</span><span id="L-174"><a href="#L-174"><span class="linenos"> 174</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-175"><a href="#L-175"><span class="linenos"> 175</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="L-176"><a href="#L-176"><span class="linenos"> 176</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-177"><a href="#L-177"><span class="linenos"> 177</span></a> <span class="k">return</span> <span class="kc">True</span> -</span><span id="L-178"><a href="#L-178"><span class="linenos"> 178</span></a> <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> -</span><span id="L-179"><a href="#L-179"><span class="linenos"> 179</span></a> <span class="k">pass</span> -</span><span id="L-180"><a href="#L-180"><span class="linenos"> 180</span></a> <span class="k">return</span> <span class="kc">False</span> -</span><span id="L-181"><a href="#L-181"><span class="linenos"> 181</span></a> -</span><span id="L-182"><a href="#L-182"><span class="linenos"> 182</span></a> <span class="nd">@property</span> -</span><span id="L-183"><a href="#L-183"><span class="linenos"> 183</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-184"><a href="#L-184"><span class="linenos"> 184</span></a><span class="w"> </span><span class="sd">"""Checks whether an expression is a star."""</span> -</span><span id="L-185"><a href="#L-185"><span class="linenos"> 185</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-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">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-189"><a href="#L-189"><span class="linenos"> 189</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-190"><a href="#L-190"><span class="linenos"> 190</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-191"><a href="#L-191"><span class="linenos"> 191</span></a><span class="sd"> """</span> -</span><span id="L-192"><a href="#L-192"><span class="linenos"> 192</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-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">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-194"><a href="#L-194"><span class="linenos"> 194</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-195"><a href="#L-195"><span class="linenos"> 195</span></a> -</span><span id="L-196"><a href="#L-196"><span class="linenos"> 196</span></a> <span class="nd">@property</span> -</span><span id="L-197"><a href="#L-197"><span class="linenos"> 197</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-198"><a href="#L-198"><span class="linenos"> 198</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-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="nd">@property</span> -</span><span id="L-201"><a href="#L-201"><span class="linenos"> 201</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-202"><a href="#L-202"><span class="linenos"> 202</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-203"><a href="#L-203"><span class="linenos"> 203</span></a> -</span><span id="L-204"><a href="#L-204"><span class="linenos"> 204</span></a> <span class="nd">@property</span> -</span><span id="L-205"><a href="#L-205"><span class="linenos"> 205</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-206"><a href="#L-206"><span class="linenos"> 206</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-207"><a href="#L-207"><span class="linenos"> 207</span></a><span class="sd"> Name of the output column if this expression is a selection.</span> -</span><span id="L-208"><a href="#L-208"><span class="linenos"> 208</span></a> -</span><span id="L-209"><a href="#L-209"><span class="linenos"> 209</span></a><span class="sd"> If the Expression has no output name, an empty string is returned.</span> -</span><span id="L-210"><a href="#L-210"><span class="linenos"> 210</span></a> -</span><span id="L-211"><a href="#L-211"><span class="linenos"> 211</span></a><span class="sd"> Example:</span> -</span><span id="L-212"><a href="#L-212"><span class="linenos"> 212</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="L-213"><a href="#L-213"><span class="linenos"> 213</span></a><span class="sd"> >>> parse_one("SELECT a").expressions[0].output_name</span> -</span><span id="L-214"><a href="#L-214"><span class="linenos"> 214</span></a><span class="sd"> 'a'</span> -</span><span id="L-215"><a href="#L-215"><span class="linenos"> 215</span></a><span class="sd"> >>> parse_one("SELECT b AS c").expressions[0].output_name</span> -</span><span id="L-216"><a href="#L-216"><span class="linenos"> 216</span></a><span class="sd"> 'c'</span> -</span><span id="L-217"><a href="#L-217"><span class="linenos"> 217</span></a><span class="sd"> >>> parse_one("SELECT 1 + 2").expressions[0].output_name</span> -</span><span id="L-218"><a href="#L-218"><span class="linenos"> 218</span></a><span class="sd"> ''</span> -</span><span id="L-219"><a href="#L-219"><span class="linenos"> 219</span></a><span class="sd"> """</span> -</span><span id="L-220"><a href="#L-220"><span class="linenos"> 220</span></a> <span class="k">return</span> <span class="s2">""</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="nd">@property</span> -</span><span id="L-223"><a href="#L-223"><span class="linenos"> 223</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-224"><a href="#L-224"><span class="linenos"> 224</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-225"><a href="#L-225"><span class="linenos"> 225</span></a> -</span><span id="L-226"><a href="#L-226"><span class="linenos"> 226</span></a> <span class="nd">@type</span><span class="o">.</span><span class="n">setter</span> -</span><span id="L-227"><a href="#L-227"><span class="linenos"> 227</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-228"><a href="#L-228"><span class="linenos"> 228</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-229"><a href="#L-229"><span class="linenos"> 229</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-230"><a href="#L-230"><span class="linenos"> 230</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-231"><a href="#L-231"><span class="linenos"> 231</span></a> -</span><span id="L-232"><a href="#L-232"><span class="linenos"> 232</span></a> <span class="nd">@property</span> -</span><span id="L-233"><a href="#L-233"><span class="linenos"> 233</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-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">_meta</span> <span class="ow">is</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="bp">self</span><span class="o">.</span><span class="n">_meta</span> <span class="o">=</span> <span class="p">{}</span> -</span><span id="L-236"><a href="#L-236"><span class="linenos"> 236</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-237"><a href="#L-237"><span class="linenos"> 237</span></a> -</span><span id="L-238"><a href="#L-238"><span class="linenos"> 238</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-239"><a href="#L-239"><span class="linenos"> 239</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-240"><a href="#L-240"><span class="linenos"> 240</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-241"><a href="#L-241"><span class="linenos"> 241</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-105"><a href="#L-105"><span class="linenos"> 105</span></a> <span class="k">return</span> <span class="nb">frozenset</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">_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">v</span><span class="p">)</span> <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span> <span class="k">else</span> <span class="n">_norm_arg</span><span class="p">(</span><span class="n">v</span><span class="p">))</span> +</span><span id="L-107"><a href="#L-107"><span class="linenos"> 107</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-108"><a href="#L-108"><span class="linenos"> 108</span></a> <span class="k">if</span> <span class="ow">not</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="n">v</span> <span class="ow">is</span> <span class="kc">False</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">type</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">v</span><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="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-112"><a href="#L-112"><span class="linenos"> 112</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hash</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-113"><a href="#L-113"><span class="linenos"> 113</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hash</span> +</span><span id="L-114"><a href="#L-114"><span class="linenos"> 114</span></a> +</span><span id="L-115"><a href="#L-115"><span class="linenos"> 115</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="vm">__class__</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">hashable_args</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">this</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 "this".</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">"this"</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">expression</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 "expression".</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">"expression"</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="nd">@property</span> +</span><span id="L-132"><a href="#L-132"><span class="linenos"> 132</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-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"> Retrieves the argument with key "expressions".</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="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-137"><a href="#L-137"><span class="linenos"> 137</span></a> +</span><span id="L-138"><a href="#L-138"><span class="linenos"> 138</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-139"><a href="#L-139"><span class="linenos"> 139</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-140"><a href="#L-140"><span class="linenos"> 140</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-141"><a href="#L-141"><span class="linenos"> 141</span></a><span class="sd"> for args that are strings or leaf Expression instances, such as identifiers and literals.</span> +</span><span id="L-142"><a href="#L-142"><span class="linenos"> 142</span></a><span class="sd"> """</span> +</span><span id="L-143"><a href="#L-143"><span class="linenos"> 143</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-144"><a href="#L-144"><span class="linenos"> 144</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-145"><a href="#L-145"><span class="linenos"> 145</span></a> <span class="k">return</span> <span class="n">field</span> +</span><span id="L-146"><a href="#L-146"><span class="linenos"> 146</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-147"><a href="#L-147"><span class="linenos"> 147</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-148"><a href="#L-148"><span class="linenos"> 148</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-149"><a href="#L-149"><span class="linenos"> 149</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-150"><a href="#L-150"><span class="linenos"> 150</span></a> <span class="k">return</span> <span class="s2">""</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_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-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 string.</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="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_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-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 a number.</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">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-165"><a href="#L-165"><span class="linenos"> 165</span></a> +</span><span id="L-166"><a href="#L-166"><span class="linenos"> 166</span></a> <span class="nd">@property</span> +</span><span id="L-167"><a href="#L-167"><span class="linenos"> 167</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-168"><a href="#L-168"><span class="linenos"> 168</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-169"><a href="#L-169"><span class="linenos"> 169</span></a><span class="sd"> Checks whether a Literal expression is an integer.</span> +</span><span id="L-170"><a href="#L-170"><span class="linenos"> 170</span></a><span class="sd"> """</span> +</span><span id="L-171"><a href="#L-171"><span class="linenos"> 171</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-172"><a href="#L-172"><span class="linenos"> 172</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="L-173"><a href="#L-173"><span class="linenos"> 173</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-174"><a href="#L-174"><span class="linenos"> 174</span></a> <span class="k">return</span> <span class="kc">True</span> +</span><span id="L-175"><a href="#L-175"><span class="linenos"> 175</span></a> <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> +</span><span id="L-176"><a href="#L-176"><span class="linenos"> 176</span></a> <span class="k">pass</span> +</span><span id="L-177"><a href="#L-177"><span class="linenos"> 177</span></a> <span class="k">return</span> <span class="kc">False</span> +</span><span id="L-178"><a href="#L-178"><span class="linenos"> 178</span></a> +</span><span id="L-179"><a href="#L-179"><span class="linenos"> 179</span></a> <span class="nd">@property</span> +</span><span id="L-180"><a href="#L-180"><span class="linenos"> 180</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-181"><a href="#L-181"><span class="linenos"> 181</span></a><span class="w"> </span><span class="sd">"""Checks whether an expression is a star."""</span> +</span><span id="L-182"><a href="#L-182"><span class="linenos"> 182</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-183"><a href="#L-183"><span class="linenos"> 183</span></a> +</span><span id="L-184"><a href="#L-184"><span class="linenos"> 184</span></a> <span class="nd">@property</span> +</span><span id="L-185"><a href="#L-185"><span class="linenos"> 185</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-186"><a href="#L-186"><span class="linenos"> 186</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-187"><a href="#L-187"><span class="linenos"> 187</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-188"><a href="#L-188"><span class="linenos"> 188</span></a><span class="sd"> """</span> +</span><span id="L-189"><a href="#L-189"><span class="linenos"> 189</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-190"><a href="#L-190"><span class="linenos"> 190</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-191"><a href="#L-191"><span class="linenos"> 191</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-192"><a href="#L-192"><span class="linenos"> 192</span></a> +</span><span id="L-193"><a href="#L-193"><span class="linenos"> 193</span></a> <span class="nd">@property</span> +</span><span id="L-194"><a href="#L-194"><span class="linenos"> 194</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-195"><a href="#L-195"><span class="linenos"> 195</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-196"><a href="#L-196"><span class="linenos"> 196</span></a> +</span><span id="L-197"><a href="#L-197"><span class="linenos"> 197</span></a> <span class="nd">@property</span> +</span><span id="L-198"><a href="#L-198"><span class="linenos"> 198</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-199"><a href="#L-199"><span class="linenos"> 199</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-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="nd">@property</span> +</span><span id="L-202"><a href="#L-202"><span class="linenos"> 202</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-203"><a href="#L-203"><span class="linenos"> 203</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-204"><a href="#L-204"><span class="linenos"> 204</span></a><span class="sd"> Name of the output column if this expression is a selection.</span> +</span><span id="L-205"><a href="#L-205"><span class="linenos"> 205</span></a> +</span><span id="L-206"><a href="#L-206"><span class="linenos"> 206</span></a><span class="sd"> If the Expression has no output name, an empty string is returned.</span> +</span><span id="L-207"><a href="#L-207"><span class="linenos"> 207</span></a> +</span><span id="L-208"><a href="#L-208"><span class="linenos"> 208</span></a><span class="sd"> Example:</span> +</span><span id="L-209"><a href="#L-209"><span class="linenos"> 209</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="L-210"><a href="#L-210"><span class="linenos"> 210</span></a><span class="sd"> >>> parse_one("SELECT a").expressions[0].output_name</span> +</span><span id="L-211"><a href="#L-211"><span class="linenos"> 211</span></a><span class="sd"> 'a'</span> +</span><span id="L-212"><a href="#L-212"><span class="linenos"> 212</span></a><span class="sd"> >>> parse_one("SELECT b AS c").expressions[0].output_name</span> +</span><span id="L-213"><a href="#L-213"><span class="linenos"> 213</span></a><span class="sd"> 'c'</span> +</span><span id="L-214"><a href="#L-214"><span class="linenos"> 214</span></a><span class="sd"> >>> parse_one("SELECT 1 + 2").expressions[0].output_name</span> +</span><span id="L-215"><a href="#L-215"><span class="linenos"> 215</span></a><span class="sd"> ''</span> +</span><span id="L-216"><a href="#L-216"><span class="linenos"> 216</span></a><span class="sd"> """</span> +</span><span id="L-217"><a href="#L-217"><span class="linenos"> 217</span></a> <span class="k">return</span> <span class="s2">""</span> +</span><span id="L-218"><a href="#L-218"><span class="linenos"> 218</span></a> +</span><span id="L-219"><a href="#L-219"><span class="linenos"> 219</span></a> <span class="nd">@property</span> +</span><span id="L-220"><a href="#L-220"><span class="linenos"> 220</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-221"><a href="#L-221"><span class="linenos"> 221</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-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">@type</span><span class="o">.</span><span class="n">setter</span> +</span><span id="L-224"><a href="#L-224"><span class="linenos"> 224</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-225"><a href="#L-225"><span class="linenos"> 225</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-226"><a href="#L-226"><span class="linenos"> 226</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-227"><a href="#L-227"><span class="linenos"> 227</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-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="nd">@property</span> +</span><span id="L-230"><a href="#L-230"><span class="linenos"> 230</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-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">_meta</span> <span class="ow">is</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="bp">self</span><span class="o">.</span><span class="n">_meta</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="L-233"><a href="#L-233"><span class="linenos"> 233</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-234"><a href="#L-234"><span class="linenos"> 234</span></a> +</span><span id="L-235"><a href="#L-235"><span class="linenos"> 235</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-236"><a href="#L-236"><span class="linenos"> 236</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-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">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-238"><a href="#L-238"><span class="linenos"> 238</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-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">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-241"><a href="#L-241"><span class="linenos"> 241</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-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="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-244"><a href="#L-244"><span class="linenos"> 244</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-243"><a href="#L-243"><span class="linenos"> 243</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-244"><a href="#L-244"><span class="linenos"> 244</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-245"><a href="#L-245"><span class="linenos"> 245</span></a> -</span><span id="L-246"><a href="#L-246"><span class="linenos"> 246</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-247"><a href="#L-247"><span class="linenos"> 247</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-248"><a href="#L-248"><span class="linenos"> 248</span></a> -</span><span id="L-249"><a href="#L-249"><span class="linenos"> 249</span></a> <span class="k">return</span> <span class="n">copy</span> -</span><span id="L-250"><a href="#L-250"><span class="linenos"> 250</span></a> -</span><span id="L-251"><a href="#L-251"><span class="linenos"> 251</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-252"><a href="#L-252"><span class="linenos"> 252</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-253"><a href="#L-253"><span class="linenos"> 253</span></a><span class="sd"> Returns a deep copy of the expression.</span> -</span><span id="L-254"><a href="#L-254"><span class="linenos"> 254</span></a><span class="sd"> """</span> -</span><span id="L-255"><a href="#L-255"><span class="linenos"> 255</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-256"><a href="#L-256"><span class="linenos"> 256</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-257"><a href="#L-257"><span class="linenos"> 257</span></a> <span class="k">return</span> <span class="n">new</span> -</span><span id="L-258"><a href="#L-258"><span class="linenos"> 258</span></a> -</span><span id="L-259"><a href="#L-259"><span class="linenos"> 259</span></a> <span class="k">def</span> <span class="nf">add_comments</span><span class="p">(</span><span class="bp">self</span><span class="p">,</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 class="p">:</span> -</span><span id="L-260"><a href="#L-260"><span class="linenos"> 260</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="kc">None</span><span class="p">:</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">comments</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="L-262"><a href="#L-262"><span class="linenos"> 262</span></a> <span class="k">if</span> <span class="n">comments</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">comments</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">comments</span><span class="p">)</span> -</span><span id="L-264"><a href="#L-264"><span class="linenos"> 264</span></a> -</span><span id="L-265"><a href="#L-265"><span class="linenos"> 265</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> -</span><span id="L-266"><a href="#L-266"><span class="linenos"> 266</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-267"><a href="#L-267"><span class="linenos"> 267</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-268"><a href="#L-268"><span class="linenos"> 268</span></a> -</span><span id="L-269"><a href="#L-269"><span class="linenos"> 269</span></a><span class="sd"> Args:</span> -</span><span id="L-270"><a href="#L-270"><span class="linenos"> 270</span></a><span class="sd"> arg_key (str): name of the list expression arg</span> -</span><span id="L-271"><a href="#L-271"><span class="linenos"> 271</span></a><span class="sd"> value (Any): value to append to the list</span> -</span><span id="L-272"><a href="#L-272"><span class="linenos"> 272</span></a><span class="sd"> """</span> -</span><span id="L-273"><a href="#L-273"><span class="linenos"> 273</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-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="p">[]</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">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-276"><a href="#L-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="L-277"><a href="#L-277"><span class="linenos"> 277</span></a> -</span><span id="L-278"><a href="#L-278"><span class="linenos"> 278</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> -</span><span id="L-279"><a href="#L-279"><span class="linenos"> 279</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-280"><a href="#L-280"><span class="linenos"> 280</span></a><span class="sd"> Sets `arg_key` to `value`.</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="sd"> Args:</span> -</span><span id="L-283"><a href="#L-283"><span class="linenos"> 283</span></a><span class="sd"> arg_key (str): name of the expression arg.</span> -</span><span id="L-284"><a href="#L-284"><span class="linenos"> 284</span></a><span class="sd"> value: value to set the arg to.</span> -</span><span id="L-285"><a href="#L-285"><span class="linenos"> 285</span></a><span class="sd"> """</span> -</span><span id="L-286"><a href="#L-286"><span class="linenos"> 286</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-287"><a href="#L-287"><span class="linenos"> 287</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-288"><a href="#L-288"><span class="linenos"> 288</span></a> -</span><span id="L-289"><a href="#L-289"><span class="linenos"> 289</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> -</span><span id="L-290"><a href="#L-290"><span class="linenos"> 290</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">):</span> -</span><span id="L-291"><a href="#L-291"><span class="linenos"> 291</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-292"><a href="#L-292"><span class="linenos"> 292</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-293"><a href="#L-293"><span class="linenos"> 293</span></a> <span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span> -</span><span id="L-294"><a href="#L-294"><span class="linenos"> 294</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-295"><a href="#L-295"><span class="linenos"> 295</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">"parent"</span><span class="p">):</span> -</span><span id="L-296"><a href="#L-296"><span class="linenos"> 296</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-297"><a href="#L-297"><span class="linenos"> 297</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-298"><a href="#L-298"><span class="linenos"> 298</span></a> -</span><span id="L-299"><a href="#L-299"><span class="linenos"> 299</span></a> <span class="nd">@property</span> -</span><span id="L-300"><a href="#L-300"><span class="linenos"> 300</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 class="o">-></span> <span class="nb">int</span><span class="p">:</span> -</span><span id="L-301"><a href="#L-301"><span class="linenos"> 301</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-302"><a href="#L-302"><span class="linenos"> 302</span></a><span class="sd"> Returns the depth of this tree.</span> -</span><span id="L-303"><a href="#L-303"><span class="linenos"> 303</span></a><span class="sd"> """</span> -</span><span id="L-304"><a href="#L-304"><span class="linenos"> 304</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-305"><a href="#L-305"><span class="linenos"> 305</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-306"><a href="#L-306"><span class="linenos"> 306</span></a> <span class="k">return</span> <span class="mi">0</span> -</span><span id="L-307"><a href="#L-307"><span class="linenos"> 307</span></a> -</span><span id="L-308"><a href="#L-308"><span class="linenos"> 308</span></a> <span class="k">def</span> <span class="nf">iter_expressions</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">Iterator</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="nb">str</span><span class="p">,</span> <span class="n">Expression</span><span class="p">]]:</span> -</span><span id="L-309"><a href="#L-309"><span class="linenos"> 309</span></a><span class="w"> </span><span class="sd">"""Yields the key and expression for all arguments, exploding list args."""</span> -</span><span id="L-310"><a href="#L-310"><span class="linenos"> 310</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-311"><a href="#L-311"><span class="linenos"> 311</span></a> <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span> -</span><span id="L-312"><a href="#L-312"><span class="linenos"> 312</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">vs</span><span class="p">:</span> -</span><span id="L-313"><a href="#L-313"><span class="linenos"> 313</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">"parent"</span><span class="p">):</span> -</span><span id="L-314"><a href="#L-314"><span class="linenos"> 314</span></a> <span class="k">yield</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> -</span><span id="L-315"><a href="#L-315"><span class="linenos"> 315</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-316"><a href="#L-316"><span class="linenos"> 316</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">vs</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">):</span> -</span><span id="L-317"><a href="#L-317"><span class="linenos"> 317</span></a> <span class="k">yield</span> <span class="n">k</span><span class="p">,</span> <span class="n">vs</span> -</span><span id="L-318"><a href="#L-318"><span class="linenos"> 318</span></a> -</span><span id="L-319"><a href="#L-319"><span class="linenos"> 319</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">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">],</span> <span class="n">bfs</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">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">E</span><span class="p">]:</span> -</span><span id="L-320"><a href="#L-320"><span class="linenos"> 320</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-321"><a href="#L-321"><span class="linenos"> 321</span></a><span class="sd"> Returns the first node in this tree which matches at least one of</span> -</span><span id="L-322"><a href="#L-322"><span class="linenos"> 322</span></a><span class="sd"> the specified types.</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="sd"> Args:</span> -</span><span id="L-325"><a href="#L-325"><span class="linenos"> 325</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> -</span><span id="L-326"><a href="#L-326"><span class="linenos"> 326</span></a><span class="sd"> bfs: whether to search the AST using the BFS algorithm (DFS is used if false).</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"> Returns:</span> -</span><span id="L-329"><a href="#L-329"><span class="linenos"> 329</span></a><span class="sd"> The node which matches the criteria or None if no such node was found.</span> -</span><span id="L-330"><a href="#L-330"><span class="linenos"> 330</span></a><span class="sd"> """</span> -</span><span id="L-331"><a href="#L-331"><span class="linenos"> 331</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-332"><a href="#L-332"><span class="linenos"> 332</span></a> -</span><span id="L-333"><a href="#L-333"><span class="linenos"> 333</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">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">],</span> <span class="n">bfs</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">t</span><span class="o">.</span><span class="n">Iterator</span><span class="p">[</span><span class="n">E</span><span class="p">]:</span> -</span><span id="L-334"><a href="#L-334"><span class="linenos"> 334</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-335"><a href="#L-335"><span class="linenos"> 335</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree and only</span> -</span><span id="L-336"><a href="#L-336"><span class="linenos"> 336</span></a><span class="sd"> yields those that match at least one of the specified expression types.</span> -</span><span id="L-337"><a href="#L-337"><span class="linenos"> 337</span></a> -</span><span id="L-338"><a href="#L-338"><span class="linenos"> 338</span></a><span class="sd"> Args:</span> -</span><span id="L-339"><a href="#L-339"><span class="linenos"> 339</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> -</span><span id="L-340"><a href="#L-340"><span class="linenos"> 340</span></a><span class="sd"> bfs: whether to search the AST using the BFS algorithm (DFS is used if false).</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">for</span> <span class="n">expression</span><span class="p">,</span> <span class="o">*</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-346"><a href="#L-346"><span class="linenos"> 346</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-347"><a href="#L-347"><span class="linenos"> 347</span></a> <span class="k">yield</span> <span class="n">expression</span> -</span><span id="L-348"><a href="#L-348"><span class="linenos"> 348</span></a> -</span><span id="L-349"><a href="#L-349"><span class="linenos"> 349</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 class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</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">E</span><span class="p">]:</span> -</span><span id="L-350"><a href="#L-350"><span class="linenos"> 350</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-351"><a href="#L-351"><span class="linenos"> 351</span></a><span class="sd"> Returns a nearest parent matching expression_types.</span> +</span><span id="L-246"><a href="#L-246"><span class="linenos"> 246</span></a> <span class="k">return</span> <span class="n">copy</span> +</span><span id="L-247"><a href="#L-247"><span class="linenos"> 247</span></a> +</span><span id="L-248"><a href="#L-248"><span class="linenos"> 248</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-249"><a href="#L-249"><span class="linenos"> 249</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-250"><a href="#L-250"><span class="linenos"> 250</span></a><span class="sd"> Returns a deep copy of the expression.</span> +</span><span id="L-251"><a href="#L-251"><span class="linenos"> 251</span></a><span class="sd"> """</span> +</span><span id="L-252"><a href="#L-252"><span class="linenos"> 252</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-253"><a href="#L-253"><span class="linenos"> 253</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-254"><a href="#L-254"><span class="linenos"> 254</span></a> <span class="k">return</span> <span class="n">new</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="k">def</span> <span class="nf">add_comments</span><span class="p">(</span><span class="bp">self</span><span class="p">,</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 class="p">:</span> +</span><span id="L-257"><a href="#L-257"><span class="linenos"> 257</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="kc">None</span><span class="p">:</span> +</span><span id="L-258"><a href="#L-258"><span class="linenos"> 258</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="L-259"><a href="#L-259"><span class="linenos"> 259</span></a> <span class="k">if</span> <span class="n">comments</span><span class="p">:</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">comments</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">comments</span><span class="p">)</span> +</span><span id="L-261"><a href="#L-261"><span class="linenos"> 261</span></a> +</span><span id="L-262"><a href="#L-262"><span class="linenos"> 262</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> +</span><span id="L-263"><a href="#L-263"><span class="linenos"> 263</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-264"><a href="#L-264"><span class="linenos"> 264</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-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="sd"> Args:</span> +</span><span id="L-267"><a href="#L-267"><span class="linenos"> 267</span></a><span class="sd"> arg_key (str): name of the list expression arg</span> +</span><span id="L-268"><a href="#L-268"><span class="linenos"> 268</span></a><span class="sd"> value (Any): value to append to the list</span> +</span><span id="L-269"><a href="#L-269"><span class="linenos"> 269</span></a><span class="sd"> """</span> +</span><span id="L-270"><a href="#L-270"><span class="linenos"> 270</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-271"><a href="#L-271"><span class="linenos"> 271</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-272"><a href="#L-272"><span class="linenos"> 272</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-273"><a href="#L-273"><span class="linenos"> 273</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-274"><a href="#L-274"><span class="linenos"> 274</span></a> +</span><span id="L-275"><a href="#L-275"><span class="linenos"> 275</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> +</span><span id="L-276"><a href="#L-276"><span class="linenos"> 276</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-277"><a href="#L-277"><span class="linenos"> 277</span></a><span class="sd"> Sets `arg_key` to `value`.</span> +</span><span id="L-278"><a href="#L-278"><span class="linenos"> 278</span></a> +</span><span id="L-279"><a href="#L-279"><span class="linenos"> 279</span></a><span class="sd"> Args:</span> +</span><span id="L-280"><a href="#L-280"><span class="linenos"> 280</span></a><span class="sd"> arg_key (str): name of the expression arg.</span> +</span><span id="L-281"><a href="#L-281"><span class="linenos"> 281</span></a><span class="sd"> value: value to set the arg to.</span> +</span><span id="L-282"><a href="#L-282"><span class="linenos"> 282</span></a><span class="sd"> """</span> +</span><span id="L-283"><a href="#L-283"><span class="linenos"> 283</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-284"><a href="#L-284"><span class="linenos"> 284</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-285"><a href="#L-285"><span class="linenos"> 285</span></a> +</span><span id="L-286"><a href="#L-286"><span class="linenos"> 286</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> +</span><span id="L-287"><a href="#L-287"><span class="linenos"> 287</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">):</span> +</span><span id="L-288"><a href="#L-288"><span class="linenos"> 288</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-289"><a href="#L-289"><span class="linenos"> 289</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-290"><a href="#L-290"><span class="linenos"> 290</span></a> <span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span> +</span><span id="L-291"><a href="#L-291"><span class="linenos"> 291</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-292"><a href="#L-292"><span class="linenos"> 292</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">"parent"</span><span class="p">):</span> +</span><span id="L-293"><a href="#L-293"><span class="linenos"> 293</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-294"><a href="#L-294"><span class="linenos"> 294</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-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="nd">@property</span> +</span><span id="L-297"><a href="#L-297"><span class="linenos"> 297</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 class="o">-></span> <span class="nb">int</span><span class="p">:</span> +</span><span id="L-298"><a href="#L-298"><span class="linenos"> 298</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-299"><a href="#L-299"><span class="linenos"> 299</span></a><span class="sd"> Returns the depth of this tree.</span> +</span><span id="L-300"><a href="#L-300"><span class="linenos"> 300</span></a><span class="sd"> """</span> +</span><span id="L-301"><a href="#L-301"><span class="linenos"> 301</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-302"><a href="#L-302"><span class="linenos"> 302</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-303"><a href="#L-303"><span class="linenos"> 303</span></a> <span class="k">return</span> <span class="mi">0</span> +</span><span id="L-304"><a href="#L-304"><span class="linenos"> 304</span></a> +</span><span id="L-305"><a href="#L-305"><span class="linenos"> 305</span></a> <span class="k">def</span> <span class="nf">iter_expressions</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">Iterator</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="nb">str</span><span class="p">,</span> <span class="n">Expression</span><span class="p">]]:</span> +</span><span id="L-306"><a href="#L-306"><span class="linenos"> 306</span></a><span class="w"> </span><span class="sd">"""Yields the key and expression for all arguments, exploding list args."""</span> +</span><span id="L-307"><a href="#L-307"><span class="linenos"> 307</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-308"><a href="#L-308"><span class="linenos"> 308</span></a> <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span> +</span><span id="L-309"><a href="#L-309"><span class="linenos"> 309</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">vs</span><span class="p">:</span> +</span><span id="L-310"><a href="#L-310"><span class="linenos"> 310</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">"parent"</span><span class="p">):</span> +</span><span id="L-311"><a href="#L-311"><span class="linenos"> 311</span></a> <span class="k">yield</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> +</span><span id="L-312"><a href="#L-312"><span class="linenos"> 312</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-313"><a href="#L-313"><span class="linenos"> 313</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">vs</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">):</span> +</span><span id="L-314"><a href="#L-314"><span class="linenos"> 314</span></a> <span class="k">yield</span> <span class="n">k</span><span class="p">,</span> <span class="n">vs</span> +</span><span id="L-315"><a href="#L-315"><span class="linenos"> 315</span></a> +</span><span id="L-316"><a href="#L-316"><span class="linenos"> 316</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">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">],</span> <span class="n">bfs</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">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">E</span><span class="p">]:</span> +</span><span id="L-317"><a href="#L-317"><span class="linenos"> 317</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-318"><a href="#L-318"><span class="linenos"> 318</span></a><span class="sd"> Returns the first node in this tree which matches at least one of</span> +</span><span id="L-319"><a href="#L-319"><span class="linenos"> 319</span></a><span class="sd"> the specified types.</span> +</span><span id="L-320"><a href="#L-320"><span class="linenos"> 320</span></a> +</span><span id="L-321"><a href="#L-321"><span class="linenos"> 321</span></a><span class="sd"> Args:</span> +</span><span id="L-322"><a href="#L-322"><span class="linenos"> 322</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> +</span><span id="L-323"><a href="#L-323"><span class="linenos"> 323</span></a><span class="sd"> bfs: whether to search the AST using the BFS algorithm (DFS is used if false).</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="sd"> Returns:</span> +</span><span id="L-326"><a href="#L-326"><span class="linenos"> 326</span></a><span class="sd"> The node which matches the criteria or None if no such node was found.</span> +</span><span id="L-327"><a href="#L-327"><span class="linenos"> 327</span></a><span class="sd"> """</span> +</span><span id="L-328"><a href="#L-328"><span class="linenos"> 328</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-329"><a href="#L-329"><span class="linenos"> 329</span></a> +</span><span id="L-330"><a href="#L-330"><span class="linenos"> 330</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">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">],</span> <span class="n">bfs</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">t</span><span class="o">.</span><span class="n">Iterator</span><span class="p">[</span><span class="n">E</span><span class="p">]:</span> +</span><span id="L-331"><a href="#L-331"><span class="linenos"> 331</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-332"><a href="#L-332"><span class="linenos"> 332</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree and only</span> +</span><span id="L-333"><a href="#L-333"><span class="linenos"> 333</span></a><span class="sd"> yields those that match at least one of the specified expression types.</span> +</span><span id="L-334"><a href="#L-334"><span class="linenos"> 334</span></a> +</span><span id="L-335"><a href="#L-335"><span class="linenos"> 335</span></a><span class="sd"> Args:</span> +</span><span id="L-336"><a href="#L-336"><span class="linenos"> 336</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> +</span><span id="L-337"><a href="#L-337"><span class="linenos"> 337</span></a><span class="sd"> bfs: whether to search the AST using the BFS algorithm (DFS is used if false).</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="sd"> Returns:</span> +</span><span id="L-340"><a href="#L-340"><span class="linenos"> 340</span></a><span class="sd"> The generator object.</span> +</span><span id="L-341"><a href="#L-341"><span class="linenos"> 341</span></a><span class="sd"> """</span> +</span><span id="L-342"><a href="#L-342"><span class="linenos"> 342</span></a> <span class="k">for</span> <span class="n">expression</span><span class="p">,</span> <span class="o">*</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-343"><a href="#L-343"><span class="linenos"> 343</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-344"><a href="#L-344"><span class="linenos"> 344</span></a> <span class="k">yield</span> <span class="n">expression</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">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 class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</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">E</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 nearest parent matching expression_types.</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="sd"> Args:</span> +</span><span id="L-351"><a href="#L-351"><span class="linenos"> 351</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> </span><span id="L-352"><a href="#L-352"><span class="linenos"> 352</span></a> -</span><span id="L-353"><a href="#L-353"><span class="linenos"> 353</span></a><span class="sd"> Args:</span> -</span><span id="L-354"><a href="#L-354"><span class="linenos"> 354</span></a><span class="sd"> expression_types: the expression type(s) to match.</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 parent node.</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="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-360"><a href="#L-360"><span class="linenos"> 360</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-361"><a href="#L-361"><span class="linenos"> 361</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-362"><a href="#L-362"><span class="linenos"> 362</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">E</span><span class="p">,</span> <span class="n">ancestor</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="nd">@property</span> -</span><span id="L-365"><a href="#L-365"><span class="linenos"> 365</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 class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Select</span><span class="p">]:</span> -</span><span id="L-366"><a href="#L-366"><span class="linenos"> 366</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-367"><a href="#L-367"><span class="linenos"> 367</span></a><span class="sd"> Returns the parent select statement.</span> -</span><span id="L-368"><a href="#L-368"><span class="linenos"> 368</span></a><span class="sd"> """</span> -</span><span id="L-369"><a href="#L-369"><span class="linenos"> 369</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-370"><a href="#L-370"><span class="linenos"> 370</span></a> -</span><span id="L-371"><a href="#L-371"><span class="linenos"> 371</span></a> <span class="nd">@property</span> -</span><span id="L-372"><a href="#L-372"><span class="linenos"> 372</span></a> <span class="k">def</span> <span class="nf">same_parent</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-373"><a href="#L-373"><span class="linenos"> 373</span></a><span class="w"> </span><span class="sd">"""Returns if the parent is the same class as itself."""</span> -</span><span id="L-374"><a href="#L-374"><span class="linenos"> 374</span></a> <span class="k">return</span> <span class="nb">type</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="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span> -</span><span id="L-375"><a href="#L-375"><span class="linenos"> 375</span></a> -</span><span id="L-376"><a href="#L-376"><span class="linenos"> 376</span></a> <span class="k">def</span> <span class="nf">root</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="L-377"><a href="#L-377"><span class="linenos"> 377</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-378"><a href="#L-378"><span class="linenos"> 378</span></a><span class="sd"> Returns the root expression of this tree.</span> -</span><span id="L-379"><a href="#L-379"><span class="linenos"> 379</span></a><span class="sd"> """</span> -</span><span id="L-380"><a href="#L-380"><span class="linenos"> 380</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="L-381"><a href="#L-381"><span class="linenos"> 381</span></a> <span class="k">while</span> <span class="n">expression</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> -</span><span id="L-382"><a href="#L-382"><span class="linenos"> 382</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">parent</span> -</span><span id="L-383"><a href="#L-383"><span class="linenos"> 383</span></a> <span class="k">return</span> <span class="n">expression</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">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-386"><a href="#L-386"><span class="linenos"> 386</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-387"><a href="#L-387"><span class="linenos"> 387</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree.</span> -</span><span id="L-388"><a href="#L-388"><span class="linenos"> 388</span></a> -</span><span id="L-389"><a href="#L-389"><span class="linenos"> 389</span></a><span class="sd"> Args:</span> -</span><span id="L-390"><a href="#L-390"><span class="linenos"> 390</span></a><span class="sd"> bfs (bool): if set to True the BFS traversal order will be applied,</span> -</span><span id="L-391"><a href="#L-391"><span class="linenos"> 391</span></a><span class="sd"> otherwise the DFS traversal will be used instead.</span> -</span><span id="L-392"><a href="#L-392"><span class="linenos"> 392</span></a><span class="sd"> prune ((node, parent, arg_key) -> bool): callable that returns True if</span> -</span><span id="L-393"><a href="#L-393"><span class="linenos"> 393</span></a><span class="sd"> the generator should stop traversing this branch of the tree.</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="sd"> Returns:</span> -</span><span id="L-396"><a href="#L-396"><span class="linenos"> 396</span></a><span class="sd"> the generator object.</span> -</span><span id="L-397"><a href="#L-397"><span class="linenos"> 397</span></a><span class="sd"> """</span> -</span><span id="L-398"><a href="#L-398"><span class="linenos"> 398</span></a> <span class="k">if</span> <span class="n">bfs</span><span class="p">:</span> -</span><span id="L-399"><a href="#L-399"><span class="linenos"> 399</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-400"><a href="#L-400"><span class="linenos"> 400</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-401"><a href="#L-401"><span class="linenos"> 401</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-402"><a href="#L-402"><span class="linenos"> 402</span></a> -</span><span id="L-403"><a href="#L-403"><span class="linenos"> 403</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-404"><a href="#L-404"><span class="linenos"> 404</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-405"><a href="#L-405"><span class="linenos"> 405</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> -</span><span id="L-406"><a href="#L-406"><span class="linenos"> 406</span></a><span class="sd"> the DFS (Depth-first) order.</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="sd"> Returns:</span> -</span><span id="L-409"><a href="#L-409"><span class="linenos"> 409</span></a><span class="sd"> The generator object.</span> -</span><span id="L-410"><a href="#L-410"><span class="linenos"> 410</span></a><span class="sd"> """</span> -</span><span id="L-411"><a href="#L-411"><span class="linenos"> 411</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-412"><a href="#L-412"><span class="linenos"> 412</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-413"><a href="#L-413"><span class="linenos"> 413</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-414"><a href="#L-414"><span class="linenos"> 414</span></a> <span class="k">return</span> +</span><span id="L-353"><a href="#L-353"><span class="linenos"> 353</span></a><span class="sd"> Returns:</span> +</span><span id="L-354"><a href="#L-354"><span class="linenos"> 354</span></a><span class="sd"> The parent node.</span> +</span><span id="L-355"><a href="#L-355"><span class="linenos"> 355</span></a><span class="sd"> """</span> +</span><span id="L-356"><a href="#L-356"><span class="linenos"> 356</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-357"><a href="#L-357"><span class="linenos"> 357</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-358"><a href="#L-358"><span class="linenos"> 358</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-359"><a href="#L-359"><span class="linenos"> 359</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">E</span><span class="p">,</span> <span class="n">ancestor</span><span class="p">)</span> +</span><span id="L-360"><a href="#L-360"><span class="linenos"> 360</span></a> +</span><span id="L-361"><a href="#L-361"><span class="linenos"> 361</span></a> <span class="nd">@property</span> +</span><span id="L-362"><a href="#L-362"><span class="linenos"> 362</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 class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Select</span><span class="p">]:</span> +</span><span id="L-363"><a href="#L-363"><span class="linenos"> 363</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-364"><a href="#L-364"><span class="linenos"> 364</span></a><span class="sd"> Returns the parent select statement.</span> +</span><span id="L-365"><a href="#L-365"><span class="linenos"> 365</span></a><span class="sd"> """</span> +</span><span id="L-366"><a href="#L-366"><span class="linenos"> 366</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-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="nd">@property</span> +</span><span id="L-369"><a href="#L-369"><span class="linenos"> 369</span></a> <span class="k">def</span> <span class="nf">same_parent</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-370"><a href="#L-370"><span class="linenos"> 370</span></a><span class="w"> </span><span class="sd">"""Returns if the parent is the same class as itself."""</span> +</span><span id="L-371"><a href="#L-371"><span class="linenos"> 371</span></a> <span class="k">return</span> <span class="nb">type</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="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</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="k">def</span> <span class="nf">root</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="L-374"><a href="#L-374"><span class="linenos"> 374</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-375"><a href="#L-375"><span class="linenos"> 375</span></a><span class="sd"> Returns the root expression of this tree.</span> +</span><span id="L-376"><a href="#L-376"><span class="linenos"> 376</span></a><span class="sd"> """</span> +</span><span id="L-377"><a href="#L-377"><span class="linenos"> 377</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="L-378"><a href="#L-378"><span class="linenos"> 378</span></a> <span class="k">while</span> <span class="n">expression</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> +</span><span id="L-379"><a href="#L-379"><span class="linenos"> 379</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">parent</span> +</span><span id="L-380"><a href="#L-380"><span class="linenos"> 380</span></a> <span class="k">return</span> <span class="n">expression</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">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-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.</span> +</span><span id="L-385"><a href="#L-385"><span class="linenos"> 385</span></a> +</span><span id="L-386"><a href="#L-386"><span class="linenos"> 386</span></a><span class="sd"> Args:</span> +</span><span id="L-387"><a href="#L-387"><span class="linenos"> 387</span></a><span class="sd"> bfs (bool): if set to True the BFS traversal order will be applied,</span> +</span><span id="L-388"><a href="#L-388"><span class="linenos"> 388</span></a><span class="sd"> otherwise the DFS traversal will be used instead.</span> +</span><span id="L-389"><a href="#L-389"><span class="linenos"> 389</span></a><span class="sd"> prune ((node, parent, arg_key) -> bool): callable that returns True if</span> +</span><span id="L-390"><a href="#L-390"><span class="linenos"> 390</span></a><span class="sd"> the generator should stop traversing this branch of the tree.</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="sd"> Returns:</span> +</span><span id="L-393"><a href="#L-393"><span class="linenos"> 393</span></a><span class="sd"> the generator object.</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="k">if</span> <span class="n">bfs</span><span class="p">:</span> +</span><span id="L-396"><a href="#L-396"><span class="linenos"> 396</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-397"><a href="#L-397"><span class="linenos"> 397</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-398"><a href="#L-398"><span class="linenos"> 398</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-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">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-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 a generator object which visits all nodes in this tree in</span> +</span><span id="L-403"><a href="#L-403"><span class="linenos"> 403</span></a><span class="sd"> the DFS (Depth-first) order.</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="sd"> Returns:</span> +</span><span id="L-406"><a href="#L-406"><span class="linenos"> 406</span></a><span class="sd"> The generator object.</span> +</span><span id="L-407"><a href="#L-407"><span class="linenos"> 407</span></a><span class="sd"> """</span> +</span><span id="L-408"><a href="#L-408"><span class="linenos"> 408</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-409"><a href="#L-409"><span class="linenos"> 409</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-410"><a href="#L-410"><span class="linenos"> 410</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-411"><a href="#L-411"><span class="linenos"> 411</span></a> <span class="k">return</span> +</span><span id="L-412"><a href="#L-412"><span class="linenos"> 412</span></a> +</span><span id="L-413"><a href="#L-413"><span class="linenos"> 413</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">iter_expressions</span><span class="p">():</span> +</span><span id="L-414"><a href="#L-414"><span class="linenos"> 414</span></a> <span class="k">yield from</span> <span class="n">v</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-415"><a href="#L-415"><span class="linenos"> 415</span></a> -</span><span id="L-416"><a href="#L-416"><span class="linenos"> 416</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">iter_expressions</span><span class="p">():</span> -</span><span id="L-417"><a href="#L-417"><span class="linenos"> 417</span></a> <span class="k">yield from</span> <span class="n">v</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-418"><a href="#L-418"><span class="linenos"> 418</span></a> -</span><span id="L-419"><a href="#L-419"><span class="linenos"> 419</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-420"><a href="#L-420"><span class="linenos"> 420</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-421"><a href="#L-421"><span class="linenos"> 421</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> -</span><span id="L-422"><a href="#L-422"><span class="linenos"> 422</span></a><span class="sd"> the BFS (Breadth-first) order.</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="sd"> Returns:</span> -</span><span id="L-425"><a href="#L-425"><span class="linenos"> 425</span></a><span class="sd"> The generator object.</span> -</span><span id="L-426"><a href="#L-426"><span class="linenos"> 426</span></a><span class="sd"> """</span> -</span><span id="L-427"><a href="#L-427"><span class="linenos"> 427</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-416"><a href="#L-416"><span class="linenos"> 416</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-417"><a href="#L-417"><span class="linenos"> 417</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-418"><a href="#L-418"><span class="linenos"> 418</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> +</span><span id="L-419"><a href="#L-419"><span class="linenos"> 419</span></a><span class="sd"> the BFS (Breadth-first) order.</span> +</span><span id="L-420"><a href="#L-420"><span class="linenos"> 420</span></a> +</span><span id="L-421"><a href="#L-421"><span class="linenos"> 421</span></a><span class="sd"> Returns:</span> +</span><span id="L-422"><a href="#L-422"><span class="linenos"> 422</span></a><span class="sd"> The generator object.</span> +</span><span id="L-423"><a href="#L-423"><span class="linenos"> 423</span></a><span class="sd"> """</span> +</span><span id="L-424"><a href="#L-424"><span class="linenos"> 424</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-425"><a href="#L-425"><span class="linenos"> 425</span></a> +</span><span id="L-426"><a href="#L-426"><span class="linenos"> 426</span></a> <span class="k">while</span> <span class="n">queue</span><span class="p">:</span> +</span><span id="L-427"><a href="#L-427"><span class="linenos"> 427</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-428"><a href="#L-428"><span class="linenos"> 428</span></a> -</span><span id="L-429"><a href="#L-429"><span class="linenos"> 429</span></a> <span class="k">while</span> <span class="n">queue</span><span class="p">:</span> -</span><span id="L-430"><a href="#L-430"><span class="linenos"> 430</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-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="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-433"><a href="#L-433"><span class="linenos"> 433</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-434"><a href="#L-434"><span class="linenos"> 434</span></a> <span class="k">continue</span> +</span><span id="L-429"><a href="#L-429"><span class="linenos"> 429</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-430"><a href="#L-430"><span class="linenos"> 430</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-431"><a href="#L-431"><span class="linenos"> 431</span></a> <span class="k">continue</span> +</span><span id="L-432"><a href="#L-432"><span class="linenos"> 432</span></a> +</span><span id="L-433"><a href="#L-433"><span class="linenos"> 433</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">iter_expressions</span><span class="p">():</span> +</span><span id="L-434"><a href="#L-434"><span class="linenos"> 434</span></a> <span class="n">queue</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">v</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-435"><a href="#L-435"><span class="linenos"> 435</span></a> -</span><span id="L-436"><a href="#L-436"><span class="linenos"> 436</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">iter_expressions</span><span class="p">():</span> -</span><span id="L-437"><a href="#L-437"><span class="linenos"> 437</span></a> <span class="n">queue</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">v</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-438"><a href="#L-438"><span class="linenos"> 438</span></a> -</span><span id="L-439"><a href="#L-439"><span class="linenos"> 439</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-440"><a href="#L-440"><span class="linenos"> 440</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-441"><a href="#L-441"><span class="linenos"> 441</span></a><span class="sd"> Returns the first non parenthesis child or self.</span> -</span><span id="L-442"><a href="#L-442"><span class="linenos"> 442</span></a><span class="sd"> """</span> -</span><span id="L-443"><a href="#L-443"><span class="linenos"> 443</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="L-444"><a href="#L-444"><span class="linenos"> 444</span></a> <span class="k">while</span> <span class="nb">type</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> <span class="ow">is</span> <span class="n">Paren</span><span class="p">:</span> -</span><span id="L-445"><a href="#L-445"><span class="linenos"> 445</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-446"><a href="#L-446"><span class="linenos"> 446</span></a> <span class="k">return</span> <span class="n">expression</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="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-449"><a href="#L-449"><span class="linenos"> 449</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-450"><a href="#L-450"><span class="linenos"> 450</span></a><span class="sd"> Returns the inner expression if this is an Alias.</span> -</span><span id="L-451"><a href="#L-451"><span class="linenos"> 451</span></a><span class="sd"> """</span> -</span><span id="L-452"><a href="#L-452"><span class="linenos"> 452</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-453"><a href="#L-453"><span class="linenos"> 453</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-454"><a href="#L-454"><span class="linenos"> 454</span></a> <span class="k">return</span> <span class="bp">self</span> -</span><span id="L-455"><a href="#L-455"><span class="linenos"> 455</span></a> -</span><span id="L-456"><a href="#L-456"><span class="linenos"> 456</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-457"><a href="#L-457"><span class="linenos"> 457</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-458"><a href="#L-458"><span class="linenos"> 458</span></a><span class="sd"> Returns unnested operands as a tuple.</span> -</span><span id="L-459"><a href="#L-459"><span class="linenos"> 459</span></a><span class="sd"> """</span> -</span><span id="L-460"><a href="#L-460"><span class="linenos"> 460</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">_</span><span class="p">,</span> <span class="n">arg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">iter_expressions</span><span class="p">())</span> -</span><span id="L-461"><a href="#L-461"><span class="linenos"> 461</span></a> -</span><span id="L-462"><a href="#L-462"><span class="linenos"> 462</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-463"><a href="#L-463"><span class="linenos"> 463</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-464"><a href="#L-464"><span class="linenos"> 464</span></a><span class="sd"> Returns a generator which yields child nodes who's parents are the same class.</span> -</span><span id="L-465"><a href="#L-465"><span class="linenos"> 465</span></a> -</span><span id="L-466"><a href="#L-466"><span class="linenos"> 466</span></a><span class="sd"> A AND B AND C -> [A, B, C]</span> -</span><span id="L-467"><a href="#L-467"><span class="linenos"> 467</span></a><span class="sd"> """</span> -</span><span id="L-468"><a href="#L-468"><span class="linenos"> 468</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">type</span><span class="p">(</span><span class="n">n</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">):</span> -</span><span id="L-469"><a href="#L-469"><span class="linenos"> 469</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">node</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">:</span> -</span><span id="L-470"><a href="#L-470"><span class="linenos"> 470</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-436"><a href="#L-436"><span class="linenos"> 436</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-437"><a href="#L-437"><span class="linenos"> 437</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-438"><a href="#L-438"><span class="linenos"> 438</span></a><span class="sd"> Returns the first non parenthesis child or self.</span> +</span><span id="L-439"><a href="#L-439"><span class="linenos"> 439</span></a><span class="sd"> """</span> +</span><span id="L-440"><a href="#L-440"><span class="linenos"> 440</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="L-441"><a href="#L-441"><span class="linenos"> 441</span></a> <span class="k">while</span> <span class="nb">type</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> <span class="ow">is</span> <span class="n">Paren</span><span class="p">:</span> +</span><span id="L-442"><a href="#L-442"><span class="linenos"> 442</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-443"><a href="#L-443"><span class="linenos"> 443</span></a> <span class="k">return</span> <span class="n">expression</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">unalias</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-446"><a href="#L-446"><span class="linenos"> 446</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-447"><a href="#L-447"><span class="linenos"> 447</span></a><span class="sd"> Returns the inner expression if this is an Alias.</span> +</span><span id="L-448"><a href="#L-448"><span class="linenos"> 448</span></a><span class="sd"> """</span> +</span><span id="L-449"><a href="#L-449"><span class="linenos"> 449</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-450"><a href="#L-450"><span class="linenos"> 450</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-451"><a href="#L-451"><span class="linenos"> 451</span></a> <span class="k">return</span> <span class="bp">self</span> +</span><span id="L-452"><a href="#L-452"><span class="linenos"> 452</span></a> +</span><span id="L-453"><a href="#L-453"><span class="linenos"> 453</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-454"><a href="#L-454"><span class="linenos"> 454</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-455"><a href="#L-455"><span class="linenos"> 455</span></a><span class="sd"> Returns unnested operands as a tuple.</span> +</span><span id="L-456"><a href="#L-456"><span class="linenos"> 456</span></a><span class="sd"> """</span> +</span><span id="L-457"><a href="#L-457"><span class="linenos"> 457</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">_</span><span class="p">,</span> <span class="n">arg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">iter_expressions</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">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-460"><a href="#L-460"><span class="linenos"> 460</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-461"><a href="#L-461"><span class="linenos"> 461</span></a><span class="sd"> Returns a generator which yields child nodes who's parents are the same class.</span> +</span><span id="L-462"><a href="#L-462"><span class="linenos"> 462</span></a> +</span><span id="L-463"><a href="#L-463"><span class="linenos"> 463</span></a><span class="sd"> A AND B AND C -> [A, B, C]</span> +</span><span id="L-464"><a href="#L-464"><span class="linenos"> 464</span></a><span class="sd"> """</span> +</span><span id="L-465"><a href="#L-465"><span class="linenos"> 465</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">type</span><span class="p">(</span><span class="n">n</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">):</span> +</span><span id="L-466"><a href="#L-466"><span class="linenos"> 466</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">node</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">:</span> +</span><span id="L-467"><a href="#L-467"><span class="linenos"> 467</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-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="fm">__str__</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-470"><a href="#L-470"><span class="linenos"> 470</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-471"><a href="#L-471"><span class="linenos"> 471</span></a> -</span><span id="L-472"><a href="#L-472"><span class="linenos"> 472</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-473"><a href="#L-473"><span class="linenos"> 473</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-472"><a href="#L-472"><span class="linenos"> 472</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-473"><a href="#L-473"><span class="linenos"> 473</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-474"><a href="#L-474"><span class="linenos"> 474</span></a> -</span><span id="L-475"><a href="#L-475"><span class="linenos"> 475</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-476"><a href="#L-476"><span class="linenos"> 476</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-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="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-479"><a href="#L-479"><span class="linenos"> 479</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-480"><a href="#L-480"><span class="linenos"> 480</span></a><span class="sd"> Returns SQL string representation of this tree.</span> -</span><span id="L-481"><a href="#L-481"><span class="linenos"> 481</span></a> -</span><span id="L-482"><a href="#L-482"><span class="linenos"> 482</span></a><span class="sd"> Args:</span> -</span><span id="L-483"><a href="#L-483"><span class="linenos"> 483</span></a><span class="sd"> dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").</span> -</span><span id="L-484"><a href="#L-484"><span class="linenos"> 484</span></a><span class="sd"> opts: other `sqlglot.generator.Generator` options.</span> -</span><span id="L-485"><a href="#L-485"><span class="linenos"> 485</span></a> -</span><span id="L-486"><a href="#L-486"><span class="linenos"> 486</span></a><span class="sd"> Returns:</span> -</span><span id="L-487"><a href="#L-487"><span class="linenos"> 487</span></a><span class="sd"> The SQL string.</span> -</span><span id="L-488"><a href="#L-488"><span class="linenos"> 488</span></a><span class="sd"> """</span> -</span><span id="L-489"><a href="#L-489"><span class="linenos"> 489</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-490"><a href="#L-490"><span class="linenos"> 490</span></a> -</span><span id="L-491"><a href="#L-491"><span class="linenos"> 491</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-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="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-494"><a href="#L-494"><span class="linenos"> 494</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-495"><a href="#L-495"><span class="linenos"> 495</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-496"><a href="#L-496"><span class="linenos"> 496</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-497"><a href="#L-497"><span class="linenos"> 497</span></a> -</span><span id="L-498"><a href="#L-498"><span class="linenos"> 498</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-499"><a href="#L-499"><span class="linenos"> 499</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-500"><a href="#L-500"><span class="linenos"> 500</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-501"><a href="#L-501"><span class="linenos"> 501</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-502"><a href="#L-502"><span class="linenos"> 502</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-503"><a href="#L-503"><span class="linenos"> 503</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">ensure_list</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> -</span><span id="L-504"><a href="#L-504"><span class="linenos"> 504</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-505"><a href="#L-505"><span class="linenos"> 505</span></a> <span class="p">)</span> -</span><span id="L-506"><a href="#L-506"><span class="linenos"> 506</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-507"><a href="#L-507"><span class="linenos"> 507</span></a> <span class="p">}</span> -</span><span id="L-508"><a href="#L-508"><span class="linenos"> 508</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-509"><a href="#L-509"><span class="linenos"> 509</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-510"><a href="#L-510"><span class="linenos"> 510</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-475"><a href="#L-475"><span class="linenos"> 475</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-476"><a href="#L-476"><span class="linenos"> 476</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-477"><a href="#L-477"><span class="linenos"> 477</span></a><span class="sd"> Returns SQL string representation of this tree.</span> +</span><span id="L-478"><a href="#L-478"><span class="linenos"> 478</span></a> +</span><span id="L-479"><a href="#L-479"><span class="linenos"> 479</span></a><span class="sd"> Args:</span> +</span><span id="L-480"><a href="#L-480"><span class="linenos"> 480</span></a><span class="sd"> dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").</span> +</span><span id="L-481"><a href="#L-481"><span class="linenos"> 481</span></a><span class="sd"> opts: other `sqlglot.generator.Generator` options.</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="sd"> Returns:</span> +</span><span id="L-484"><a href="#L-484"><span class="linenos"> 484</span></a><span class="sd"> The SQL string.</span> +</span><span id="L-485"><a href="#L-485"><span class="linenos"> 485</span></a><span class="sd"> """</span> +</span><span id="L-486"><a href="#L-486"><span class="linenos"> 486</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-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="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-489"><a href="#L-489"><span class="linenos"> 489</span></a> +</span><span id="L-490"><a href="#L-490"><span class="linenos"> 490</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-491"><a href="#L-491"><span class="linenos"> 491</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-492"><a href="#L-492"><span class="linenos"> 492</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-493"><a href="#L-493"><span class="linenos"> 493</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-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="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-496"><a href="#L-496"><span class="linenos"> 496</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-497"><a href="#L-497"><span class="linenos"> 497</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-498"><a href="#L-498"><span class="linenos"> 498</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-499"><a href="#L-499"><span class="linenos"> 499</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-500"><a href="#L-500"><span class="linenos"> 500</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">ensure_list</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> +</span><span id="L-501"><a href="#L-501"><span class="linenos"> 501</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-502"><a href="#L-502"><span class="linenos"> 502</span></a> <span class="p">)</span> +</span><span id="L-503"><a href="#L-503"><span class="linenos"> 503</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-504"><a href="#L-504"><span class="linenos"> 504</span></a> <span class="p">}</span> +</span><span id="L-505"><a href="#L-505"><span class="linenos"> 505</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-506"><a href="#L-506"><span class="linenos"> 506</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-507"><a href="#L-507"><span class="linenos"> 507</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-508"><a href="#L-508"><span class="linenos"> 508</span></a> +</span><span id="L-509"><a href="#L-509"><span class="linenos"> 509</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-510"><a href="#L-510"><span class="linenos"> 510</span></a> <span class="n">right</span> <span class="o">+=</span> <span class="s2">")"</span> </span><span id="L-511"><a href="#L-511"><span class="linenos"> 511</span></a> -</span><span id="L-512"><a href="#L-512"><span class="linenos"> 512</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-513"><a href="#L-513"><span class="linenos"> 513</span></a> <span class="n">right</span> <span class="o">+=</span> <span class="s2">")"</span> -</span><span id="L-514"><a href="#L-514"><span class="linenos"> 514</span></a> -</span><span id="L-515"><a href="#L-515"><span class="linenos"> 515</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-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="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-518"><a href="#L-518"><span class="linenos"> 518</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-519"><a href="#L-519"><span class="linenos"> 519</span></a><span class="sd"> Recursively visits all tree nodes (excluding already transformed ones)</span> -</span><span id="L-520"><a href="#L-520"><span class="linenos"> 520</span></a><span class="sd"> and applies the given transformation function to each node.</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"> fun (function): a function which takes a node as an argument and returns a</span> -</span><span id="L-524"><a href="#L-524"><span class="linenos"> 524</span></a><span class="sd"> new transformed node or the same node without modifications. If the function</span> -</span><span id="L-525"><a href="#L-525"><span class="linenos"> 525</span></a><span class="sd"> returns None, then the corresponding node will be removed from the syntax tree.</span> -</span><span id="L-526"><a href="#L-526"><span class="linenos"> 526</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-527"><a href="#L-527"><span class="linenos"> 527</span></a><span class="sd"> modified in place.</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="sd"> Returns:</span> -</span><span id="L-530"><a href="#L-530"><span class="linenos"> 530</span></a><span class="sd"> The transformed tree.</span> -</span><span id="L-531"><a href="#L-531"><span class="linenos"> 531</span></a><span class="sd"> """</span> -</span><span id="L-532"><a href="#L-532"><span class="linenos"> 532</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-533"><a href="#L-533"><span class="linenos"> 533</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-534"><a href="#L-534"><span class="linenos"> 534</span></a> -</span><span id="L-535"><a href="#L-535"><span class="linenos"> 535</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-512"><a href="#L-512"><span class="linenos"> 512</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-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="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-515"><a href="#L-515"><span class="linenos"> 515</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-516"><a href="#L-516"><span class="linenos"> 516</span></a><span class="sd"> Recursively visits all tree nodes (excluding already transformed ones)</span> +</span><span id="L-517"><a href="#L-517"><span class="linenos"> 517</span></a><span class="sd"> and applies the given transformation function to each node.</span> +</span><span id="L-518"><a href="#L-518"><span class="linenos"> 518</span></a> +</span><span id="L-519"><a href="#L-519"><span class="linenos"> 519</span></a><span class="sd"> Args:</span> +</span><span id="L-520"><a href="#L-520"><span class="linenos"> 520</span></a><span class="sd"> fun (function): a function which takes a node as an argument and returns a</span> +</span><span id="L-521"><a href="#L-521"><span class="linenos"> 521</span></a><span class="sd"> new transformed node or the same node without modifications. If the function</span> +</span><span id="L-522"><a href="#L-522"><span class="linenos"> 522</span></a><span class="sd"> returns None, then the corresponding node will be removed from the syntax tree.</span> +</span><span id="L-523"><a href="#L-523"><span class="linenos"> 523</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-524"><a href="#L-524"><span class="linenos"> 524</span></a><span class="sd"> modified in place.</span> +</span><span id="L-525"><a href="#L-525"><span class="linenos"> 525</span></a> +</span><span id="L-526"><a href="#L-526"><span class="linenos"> 526</span></a><span class="sd"> Returns:</span> +</span><span id="L-527"><a href="#L-527"><span class="linenos"> 527</span></a><span class="sd"> The transformed tree.</span> +</span><span id="L-528"><a href="#L-528"><span class="linenos"> 528</span></a><span class="sd"> """</span> +</span><span id="L-529"><a href="#L-529"><span class="linenos"> 529</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-530"><a href="#L-530"><span class="linenos"> 530</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-531"><a href="#L-531"><span class="linenos"> 531</span></a> +</span><span id="L-532"><a href="#L-532"><span class="linenos"> 532</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-533"><a href="#L-533"><span class="linenos"> 533</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="L-534"><a href="#L-534"><span class="linenos"> 534</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-535"><a href="#L-535"><span class="linenos"> 535</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-536"><a href="#L-536"><span class="linenos"> 536</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="L-537"><a href="#L-537"><span class="linenos"> 537</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-538"><a href="#L-538"><span class="linenos"> 538</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-539"><a href="#L-539"><span class="linenos"> 539</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="L-537"><a href="#L-537"><span class="linenos"> 537</span></a> +</span><span id="L-538"><a href="#L-538"><span class="linenos"> 538</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-539"><a href="#L-539"><span class="linenos"> 539</span></a> <span class="k">return</span> <span class="n">new_node</span> </span><span id="L-540"><a href="#L-540"><span class="linenos"> 540</span></a> -</span><span id="L-541"><a href="#L-541"><span class="linenos"> 541</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-542"><a href="#L-542"><span class="linenos"> 542</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="L-543"><a href="#L-543"><span class="linenos"> 543</span></a> -</span><span id="L-544"><a href="#L-544"><span class="linenos"> 544</span></a> <span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="L-545"><a href="#L-545"><span class="linenos"> 545</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 class="n">E</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> -</span><span id="L-546"><a href="#L-546"><span class="linenos"> 546</span></a> <span class="o">...</span> -</span><span id="L-547"><a href="#L-547"><span class="linenos"> 547</span></a> -</span><span id="L-548"><a href="#L-548"><span class="linenos"> 548</span></a> <span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="L-549"><a href="#L-549"><span class="linenos"> 549</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 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-550"><a href="#L-550"><span class="linenos"> 550</span></a> <span class="o">...</span> -</span><span id="L-551"><a href="#L-551"><span class="linenos"> 551</span></a> -</span><span id="L-552"><a href="#L-552"><span class="linenos"> 552</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-553"><a href="#L-553"><span class="linenos"> 553</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-554"><a href="#L-554"><span class="linenos"> 554</span></a><span class="sd"> Swap out this expression with a new expression.</span> -</span><span id="L-555"><a href="#L-555"><span class="linenos"> 555</span></a> -</span><span id="L-556"><a href="#L-556"><span class="linenos"> 556</span></a><span class="sd"> For example::</span> -</span><span id="L-557"><a href="#L-557"><span class="linenos"> 557</span></a> -</span><span id="L-558"><a href="#L-558"><span class="linenos"> 558</span></a><span class="sd"> >>> tree = Select().select("x").from_("tbl")</span> -</span><span id="L-559"><a href="#L-559"><span class="linenos"> 559</span></a><span class="sd"> >>> tree.find(Column).replace(Column(this="y"))</span> -</span><span id="L-560"><a href="#L-560"><span class="linenos"> 560</span></a><span class="sd"> (COLUMN this: y)</span> -</span><span id="L-561"><a href="#L-561"><span class="linenos"> 561</span></a><span class="sd"> >>> tree.sql()</span> -</span><span id="L-562"><a href="#L-562"><span class="linenos"> 562</span></a><span class="sd"> 'SELECT y FROM tbl'</span> +</span><span id="L-541"><a href="#L-541"><span class="linenos"> 541</span></a> <span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> +</span><span id="L-542"><a href="#L-542"><span class="linenos"> 542</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 class="n">E</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="L-543"><a href="#L-543"><span class="linenos"> 543</span></a> <span class="o">...</span> +</span><span id="L-544"><a href="#L-544"><span class="linenos"> 544</span></a> +</span><span id="L-545"><a href="#L-545"><span class="linenos"> 545</span></a> <span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> +</span><span id="L-546"><a href="#L-546"><span class="linenos"> 546</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 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-547"><a href="#L-547"><span class="linenos"> 547</span></a> <span class="o">...</span> +</span><span id="L-548"><a href="#L-548"><span class="linenos"> 548</span></a> +</span><span id="L-549"><a href="#L-549"><span class="linenos"> 549</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-550"><a href="#L-550"><span class="linenos"> 550</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-551"><a href="#L-551"><span class="linenos"> 551</span></a><span class="sd"> Swap out this expression with a new expression.</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"> For example::</span> +</span><span id="L-554"><a href="#L-554"><span class="linenos"> 554</span></a> +</span><span id="L-555"><a href="#L-555"><span class="linenos"> 555</span></a><span class="sd"> >>> tree = Select().select("x").from_("tbl")</span> +</span><span id="L-556"><a href="#L-556"><span class="linenos"> 556</span></a><span class="sd"> >>> tree.find(Column).replace(Column(this="y"))</span> +</span><span id="L-557"><a href="#L-557"><span class="linenos"> 557</span></a><span class="sd"> (COLUMN this: y)</span> +</span><span id="L-558"><a href="#L-558"><span class="linenos"> 558</span></a><span class="sd"> >>> tree.sql()</span> +</span><span id="L-559"><a href="#L-559"><span class="linenos"> 559</span></a><span class="sd"> 'SELECT y FROM tbl'</span> +</span><span id="L-560"><a href="#L-560"><span class="linenos"> 560</span></a> +</span><span id="L-561"><a href="#L-561"><span class="linenos"> 561</span></a><span class="sd"> Args:</span> +</span><span id="L-562"><a href="#L-562"><span class="linenos"> 562</span></a><span class="sd"> expression: new node</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"> expression: new node</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="sd"> Returns:</span> -</span><span id="L-568"><a href="#L-568"><span class="linenos"> 568</span></a><span class="sd"> The new expression or expressions.</span> -</span><span id="L-569"><a href="#L-569"><span class="linenos"> 569</span></a><span class="sd"> """</span> -</span><span id="L-570"><a href="#L-570"><span class="linenos"> 570</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-571"><a href="#L-571"><span class="linenos"> 571</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="L-564"><a href="#L-564"><span class="linenos"> 564</span></a><span class="sd"> Returns:</span> +</span><span id="L-565"><a href="#L-565"><span class="linenos"> 565</span></a><span class="sd"> The new expression or expressions.</span> +</span><span id="L-566"><a href="#L-566"><span class="linenos"> 566</span></a><span class="sd"> """</span> +</span><span id="L-567"><a href="#L-567"><span class="linenos"> 567</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-568"><a href="#L-568"><span class="linenos"> 568</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="L-569"><a href="#L-569"><span class="linenos"> 569</span></a> +</span><span id="L-570"><a href="#L-570"><span class="linenos"> 570</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-571"><a href="#L-571"><span class="linenos"> 571</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-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="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-574"><a href="#L-574"><span class="linenos"> 574</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-573"><a href="#L-573"><span class="linenos"> 573</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-574"><a href="#L-574"><span class="linenos"> 574</span></a> <span class="k">return</span> <span class="n">expression</span> </span><span id="L-575"><a href="#L-575"><span class="linenos"> 575</span></a> -</span><span id="L-576"><a href="#L-576"><span class="linenos"> 576</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-577"><a href="#L-577"><span class="linenos"> 577</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="L-578"><a href="#L-578"><span class="linenos"> 578</span></a> -</span><span id="L-579"><a href="#L-579"><span class="linenos"> 579</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 class="n">E</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> -</span><span id="L-580"><a href="#L-580"><span class="linenos"> 580</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-581"><a href="#L-581"><span class="linenos"> 581</span></a><span class="sd"> Remove this expression from its AST.</span> -</span><span id="L-582"><a href="#L-582"><span class="linenos"> 582</span></a> -</span><span id="L-583"><a href="#L-583"><span class="linenos"> 583</span></a><span class="sd"> Returns:</span> -</span><span id="L-584"><a href="#L-584"><span class="linenos"> 584</span></a><span class="sd"> The popped expression.</span> -</span><span id="L-585"><a href="#L-585"><span class="linenos"> 585</span></a><span class="sd"> """</span> -</span><span id="L-586"><a href="#L-586"><span class="linenos"> 586</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-587"><a href="#L-587"><span class="linenos"> 587</span></a> <span class="k">return</span> <span class="bp">self</span> -</span><span id="L-588"><a href="#L-588"><span class="linenos"> 588</span></a> -</span><span id="L-589"><a href="#L-589"><span class="linenos"> 589</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 class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">])</span> <span class="o">-></span> <span class="n">E</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"> Assert that this `Expression` is an instance of `type_`.</span> +</span><span id="L-576"><a href="#L-576"><span class="linenos"> 576</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 class="n">E</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="L-577"><a href="#L-577"><span class="linenos"> 577</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-578"><a href="#L-578"><span class="linenos"> 578</span></a><span class="sd"> Remove this expression from its AST.</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="sd"> Returns:</span> +</span><span id="L-581"><a href="#L-581"><span class="linenos"> 581</span></a><span class="sd"> The popped expression.</span> +</span><span id="L-582"><a href="#L-582"><span class="linenos"> 582</span></a><span class="sd"> """</span> +</span><span id="L-583"><a href="#L-583"><span class="linenos"> 583</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-584"><a href="#L-584"><span class="linenos"> 584</span></a> <span class="k">return</span> <span class="bp">self</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">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 class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">])</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="L-587"><a href="#L-587"><span class="linenos"> 587</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-588"><a href="#L-588"><span class="linenos"> 588</span></a><span class="sd"> Assert that this `Expression` is an instance of `type_`.</span> +</span><span id="L-589"><a href="#L-589"><span class="linenos"> 589</span></a> +</span><span id="L-590"><a href="#L-590"><span class="linenos"> 590</span></a><span class="sd"> If it is NOT an instance of `type_`, this raises an assertion error.</span> +</span><span id="L-591"><a href="#L-591"><span class="linenos"> 591</span></a><span class="sd"> Otherwise, this returns this expression.</span> </span><span id="L-592"><a href="#L-592"><span class="linenos"> 592</span></a> -</span><span id="L-593"><a href="#L-593"><span class="linenos"> 593</span></a><span class="sd"> If it is NOT an instance of `type_`, this raises an assertion error.</span> -</span><span id="L-594"><a href="#L-594"><span class="linenos"> 594</span></a><span class="sd"> Otherwise, this returns this expression.</span> +</span><span id="L-593"><a href="#L-593"><span class="linenos"> 593</span></a><span class="sd"> Examples:</span> +</span><span id="L-594"><a href="#L-594"><span class="linenos"> 594</span></a><span class="sd"> This is useful for type security in chained expressions:</span> </span><span id="L-595"><a href="#L-595"><span class="linenos"> 595</span></a> -</span><span id="L-596"><a href="#L-596"><span class="linenos"> 596</span></a><span class="sd"> Examples:</span> -</span><span id="L-597"><a href="#L-597"><span class="linenos"> 597</span></a><span class="sd"> This is useful for type security in chained expressions:</span> -</span><span id="L-598"><a href="#L-598"><span class="linenos"> 598</span></a> -</span><span id="L-599"><a href="#L-599"><span class="linenos"> 599</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-600"><a href="#L-600"><span class="linenos"> 600</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()</span> -</span><span id="L-601"><a href="#L-601"><span class="linenos"> 601</span></a><span class="sd"> 'SELECT x, z FROM y'</span> -</span><span id="L-602"><a href="#L-602"><span class="linenos"> 602</span></a><span class="sd"> """</span> -</span><span id="L-603"><a href="#L-603"><span class="linenos"> 603</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-604"><a href="#L-604"><span class="linenos"> 604</span></a> <span class="k">return</span> <span class="bp">self</span> -</span><span id="L-605"><a href="#L-605"><span class="linenos"> 605</span></a> -</span><span id="L-606"><a href="#L-606"><span class="linenos"> 606</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-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"> Checks if this expression is valid (e.g. all mandatory args are set).</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"> Args:</span> -</span><span id="L-611"><a href="#L-611"><span class="linenos"> 611</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-612"><a href="#L-612"><span class="linenos"> 612</span></a><span class="sd"> to check that the provided arguments don't exceed the function argument limit.</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"> Returns:</span> -</span><span id="L-615"><a href="#L-615"><span class="linenos"> 615</span></a><span class="sd"> A list of error messages for all possible errors that were found.</span> -</span><span id="L-616"><a href="#L-616"><span class="linenos"> 616</span></a><span class="sd"> """</span> -</span><span id="L-617"><a href="#L-617"><span class="linenos"> 617</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-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">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-620"><a href="#L-620"><span class="linenos"> 620</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-621"><a href="#L-621"><span class="linenos"> 621</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-622"><a href="#L-622"><span class="linenos"> 622</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-623"><a href="#L-623"><span class="linenos"> 623</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-624"><a href="#L-624"><span class="linenos"> 624</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-625"><a href="#L-625"><span class="linenos"> 625</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-626"><a href="#L-626"><span class="linenos"> 626</span></a> -</span><span id="L-627"><a href="#L-627"><span class="linenos"> 627</span></a> <span class="k">if</span> <span class="p">(</span> -</span><span id="L-628"><a href="#L-628"><span class="linenos"> 628</span></a> <span class="n">args</span> -</span><span id="L-629"><a href="#L-629"><span class="linenos"> 629</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-630"><a href="#L-630"><span class="linenos"> 630</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-631"><a href="#L-631"><span class="linenos"> 631</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-632"><a href="#L-632"><span class="linenos"> 632</span></a> <span class="p">):</span> -</span><span id="L-633"><a href="#L-633"><span class="linenos"> 633</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> -</span><span id="L-634"><a href="#L-634"><span class="linenos"> 634</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-635"><a href="#L-635"><span class="linenos"> 635</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-636"><a href="#L-636"><span class="linenos"> 636</span></a> <span class="p">)</span> -</span><span id="L-637"><a href="#L-637"><span class="linenos"> 637</span></a> -</span><span id="L-638"><a href="#L-638"><span class="linenos"> 638</span></a> <span class="k">return</span> <span class="n">errors</span> -</span><span id="L-639"><a href="#L-639"><span class="linenos"> 639</span></a> -</span><span id="L-640"><a href="#L-640"><span class="linenos"> 640</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-641"><a href="#L-641"><span class="linenos"> 641</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-642"><a href="#L-642"><span class="linenos"> 642</span></a><span class="sd"> Dump this Expression to a JSON-serializable dict.</span> -</span><span id="L-643"><a href="#L-643"><span class="linenos"> 643</span></a><span class="sd"> """</span> -</span><span id="L-644"><a href="#L-644"><span class="linenos"> 644</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-645"><a href="#L-645"><span class="linenos"> 645</span></a> -</span><span id="L-646"><a href="#L-646"><span class="linenos"> 646</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-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="nd">@classmethod</span> -</span><span id="L-649"><a href="#L-649"><span class="linenos"> 649</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-650"><a href="#L-650"><span class="linenos"> 650</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-651"><a href="#L-651"><span class="linenos"> 651</span></a><span class="sd"> Load a dict (as returned by `Expression.dump`) into an Expression instance.</span> -</span><span id="L-652"><a href="#L-652"><span class="linenos"> 652</span></a><span class="sd"> """</span> -</span><span id="L-653"><a href="#L-653"><span class="linenos"> 653</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-596"><a href="#L-596"><span class="linenos"> 596</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-597"><a href="#L-597"><span class="linenos"> 597</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()</span> +</span><span id="L-598"><a href="#L-598"><span class="linenos"> 598</span></a><span class="sd"> 'SELECT x, z FROM y'</span> +</span><span id="L-599"><a href="#L-599"><span class="linenos"> 599</span></a><span class="sd"> """</span> +</span><span id="L-600"><a href="#L-600"><span class="linenos"> 600</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-601"><a href="#L-601"><span class="linenos"> 601</span></a> <span class="k">return</span> <span class="bp">self</span> +</span><span id="L-602"><a href="#L-602"><span class="linenos"> 602</span></a> +</span><span id="L-603"><a href="#L-603"><span class="linenos"> 603</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-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"> Checks if this expression is valid (e.g. all mandatory args are set).</span> +</span><span id="L-606"><a href="#L-606"><span class="linenos"> 606</span></a> +</span><span id="L-607"><a href="#L-607"><span class="linenos"> 607</span></a><span class="sd"> Args:</span> +</span><span id="L-608"><a href="#L-608"><span class="linenos"> 608</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-609"><a href="#L-609"><span class="linenos"> 609</span></a><span class="sd"> to check that the provided arguments don't exceed the function argument limit.</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 class="sd"> Returns:</span> +</span><span id="L-612"><a href="#L-612"><span class="linenos"> 612</span></a><span class="sd"> A list of error messages for all possible errors that were found.</span> +</span><span id="L-613"><a href="#L-613"><span class="linenos"> 613</span></a><span class="sd"> """</span> +</span><span id="L-614"><a href="#L-614"><span class="linenos"> 614</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-615"><a href="#L-615"><span class="linenos"> 615</span></a> +</span><span id="L-616"><a href="#L-616"><span class="linenos"> 616</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-617"><a href="#L-617"><span class="linenos"> 617</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-618"><a href="#L-618"><span class="linenos"> 618</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-619"><a href="#L-619"><span class="linenos"> 619</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-620"><a href="#L-620"><span class="linenos"> 620</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-621"><a href="#L-621"><span class="linenos"> 621</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-622"><a href="#L-622"><span class="linenos"> 622</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-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="k">if</span> <span class="p">(</span> +</span><span id="L-625"><a href="#L-625"><span class="linenos"> 625</span></a> <span class="n">args</span> +</span><span id="L-626"><a href="#L-626"><span class="linenos"> 626</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-627"><a href="#L-627"><span class="linenos"> 627</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-628"><a href="#L-628"><span class="linenos"> 628</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-629"><a href="#L-629"><span class="linenos"> 629</span></a> <span class="p">):</span> +</span><span id="L-630"><a href="#L-630"><span class="linenos"> 630</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> +</span><span id="L-631"><a href="#L-631"><span class="linenos"> 631</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-632"><a href="#L-632"><span class="linenos"> 632</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-633"><a href="#L-633"><span class="linenos"> 633</span></a> <span class="p">)</span> +</span><span id="L-634"><a href="#L-634"><span class="linenos"> 634</span></a> +</span><span id="L-635"><a href="#L-635"><span class="linenos"> 635</span></a> <span class="k">return</span> <span class="n">errors</span> +</span><span id="L-636"><a href="#L-636"><span class="linenos"> 636</span></a> +</span><span id="L-637"><a href="#L-637"><span class="linenos"> 637</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-638"><a href="#L-638"><span class="linenos"> 638</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-639"><a href="#L-639"><span class="linenos"> 639</span></a><span class="sd"> Dump this Expression to a JSON-serializable dict.</span> +</span><span id="L-640"><a href="#L-640"><span class="linenos"> 640</span></a><span class="sd"> """</span> +</span><span id="L-641"><a href="#L-641"><span class="linenos"> 641</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-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="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-644"><a href="#L-644"><span class="linenos"> 644</span></a> +</span><span id="L-645"><a href="#L-645"><span class="linenos"> 645</span></a> <span class="nd">@classmethod</span> +</span><span id="L-646"><a href="#L-646"><span class="linenos"> 646</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-647"><a href="#L-647"><span class="linenos"> 647</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-648"><a href="#L-648"><span class="linenos"> 648</span></a><span class="sd"> Load a dict (as returned by `Expression.dump`) into an Expression instance.</span> +</span><span id="L-649"><a href="#L-649"><span class="linenos"> 649</span></a><span class="sd"> """</span> +</span><span id="L-650"><a href="#L-650"><span class="linenos"> 650</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-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="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-653"><a href="#L-653"><span class="linenos"> 653</span></a> </span><span id="L-654"><a href="#L-654"><span class="linenos"> 654</span></a> -</span><span id="L-655"><a href="#L-655"><span class="linenos"> 655</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-656"><a href="#L-656"><span class="linenos"> 656</span></a> -</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="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-659"><a href="#L-659"><span class="linenos"> 659</span></a> <span class="nb">str</span><span class="p">,</span> -</span><span id="L-660"><a href="#L-660"><span class="linenos"> 660</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-661"><a href="#L-661"><span class="linenos"> 661</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-662"><a href="#L-662"><span class="linenos"> 662</span></a><span class="p">]</span> -</span><span id="L-663"><a href="#L-663"><span class="linenos"> 663</span></a><span class="n">ExpOrStr</span> <span class="o">=</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">Expression</span><span class="p">]</span> -</span><span id="L-664"><a href="#L-664"><span class="linenos"> 664</span></a> -</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="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-667"><a href="#L-667"><span class="linenos"> 667</span></a> <span class="k">def</span> <span class="nf">and_</span><span class="p">(</span> -</span><span id="L-668"><a href="#L-668"><span class="linenos"> 668</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-669"><a href="#L-669"><span class="linenos"> 669</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-670"><a href="#L-670"><span class="linenos"> 670</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-671"><a href="#L-671"><span class="linenos"> 671</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-672"><a href="#L-672"><span class="linenos"> 672</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-673"><a href="#L-673"><span class="linenos"> 673</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="L-674"><a href="#L-674"><span class="linenos"> 674</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-675"><a href="#L-675"><span class="linenos"> 675</span></a><span class="sd"> AND this condition with one or multiple expressions.</span> -</span><span id="L-676"><a href="#L-676"><span class="linenos"> 676</span></a> -</span><span id="L-677"><a href="#L-677"><span class="linenos"> 677</span></a><span class="sd"> Example:</span> -</span><span id="L-678"><a href="#L-678"><span class="linenos"> 678</span></a><span class="sd"> >>> condition("x=1").and_("y=1").sql()</span> -</span><span id="L-679"><a href="#L-679"><span class="linenos"> 679</span></a><span class="sd"> 'x = 1 AND y = 1'</span> -</span><span id="L-680"><a href="#L-680"><span class="linenos"> 680</span></a> -</span><span id="L-681"><a href="#L-681"><span class="linenos"> 681</span></a><span class="sd"> Args:</span> -</span><span id="L-682"><a href="#L-682"><span class="linenos"> 682</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-683"><a href="#L-683"><span class="linenos"> 683</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-684"><a href="#L-684"><span class="linenos"> 684</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-685"><a href="#L-685"><span class="linenos"> 685</span></a><span class="sd"> copy: whether or not to copy the involved expressions (only applies to Expressions).</span> -</span><span id="L-686"><a href="#L-686"><span class="linenos"> 686</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-687"><a href="#L-687"><span class="linenos"> 687</span></a> -</span><span id="L-688"><a href="#L-688"><span class="linenos"> 688</span></a><span class="sd"> Returns:</span> -</span><span id="L-689"><a href="#L-689"><span class="linenos"> 689</span></a><span class="sd"> The new And condition.</span> -</span><span id="L-690"><a href="#L-690"><span class="linenos"> 690</span></a><span class="sd"> """</span> -</span><span id="L-691"><a href="#L-691"><span class="linenos"> 691</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</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="k">def</span> <span class="nf">or_</span><span class="p">(</span> -</span><span id="L-694"><a href="#L-694"><span class="linenos"> 694</span></a> <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="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-696"><a href="#L-696"><span class="linenos"> 696</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-697"><a href="#L-697"><span class="linenos"> 697</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-698"><a href="#L-698"><span class="linenos"> 698</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-699"><a href="#L-699"><span class="linenos"> 699</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Condition</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"> OR this condition with one or multiple expressions.</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"> >>> condition("x=1").or_("y=1").sql()</span> -</span><span id="L-705"><a href="#L-705"><span class="linenos"> 705</span></a><span class="sd"> 'x = 1 OR y = 1'</span> -</span><span id="L-706"><a href="#L-706"><span class="linenos"> 706</span></a> -</span><span id="L-707"><a href="#L-707"><span class="linenos"> 707</span></a><span class="sd"> Args:</span> -</span><span id="L-708"><a href="#L-708"><span class="linenos"> 708</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-709"><a href="#L-709"><span class="linenos"> 709</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-710"><a href="#L-710"><span class="linenos"> 710</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-711"><a href="#L-711"><span class="linenos"> 711</span></a><span class="sd"> copy: whether or not to copy the involved expressions (only applies to Expressions).</span> -</span><span id="L-712"><a href="#L-712"><span class="linenos"> 712</span></a><span class="sd"> opts: other options to use to parse the input expressions.</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"> Returns:</span> -</span><span id="L-715"><a href="#L-715"><span class="linenos"> 715</span></a><span class="sd"> The new Or condition.</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">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="n">copy</span><span class="o">=</span><span class="n">copy</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">not_</span><span class="p">(</span><span class="bp">self</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><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"> Wrap this condition with NOT.</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"> >>> condition("x=1").not_().sql()</span> -</span><span id="L-725"><a href="#L-725"><span class="linenos"> 725</span></a><span class="sd"> 'NOT x = 1'</span> +</span><span id="L-655"><a href="#L-655"><span class="linenos"> 655</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-656"><a href="#L-656"><span class="linenos"> 656</span></a> <span class="nb">str</span><span class="p">,</span> +</span><span id="L-657"><a href="#L-657"><span class="linenos"> 657</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-658"><a href="#L-658"><span class="linenos"> 658</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-659"><a href="#L-659"><span class="linenos"> 659</span></a><span class="p">]</span> +</span><span id="L-660"><a href="#L-660"><span class="linenos"> 660</span></a><span class="n">ExpOrStr</span> <span class="o">=</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">Expression</span><span class="p">]</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><span id="L-663"><a href="#L-663"><span class="linenos"> 663</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-664"><a href="#L-664"><span class="linenos"> 664</span></a> <span class="k">def</span> <span class="nf">and_</span><span class="p">(</span> +</span><span id="L-665"><a href="#L-665"><span class="linenos"> 665</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-666"><a href="#L-666"><span class="linenos"> 666</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-667"><a href="#L-667"><span class="linenos"> 667</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-668"><a href="#L-668"><span class="linenos"> 668</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-669"><a href="#L-669"><span class="linenos"> 669</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-670"><a href="#L-670"><span class="linenos"> 670</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="L-671"><a href="#L-671"><span class="linenos"> 671</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-672"><a href="#L-672"><span class="linenos"> 672</span></a><span class="sd"> AND this condition with one or multiple expressions.</span> +</span><span id="L-673"><a href="#L-673"><span class="linenos"> 673</span></a> +</span><span id="L-674"><a href="#L-674"><span class="linenos"> 674</span></a><span class="sd"> Example:</span> +</span><span id="L-675"><a href="#L-675"><span class="linenos"> 675</span></a><span class="sd"> >>> condition("x=1").and_("y=1").sql()</span> +</span><span id="L-676"><a href="#L-676"><span class="linenos"> 676</span></a><span class="sd"> 'x = 1 AND y = 1'</span> +</span><span id="L-677"><a href="#L-677"><span class="linenos"> 677</span></a> +</span><span id="L-678"><a href="#L-678"><span class="linenos"> 678</span></a><span class="sd"> Args:</span> +</span><span id="L-679"><a href="#L-679"><span class="linenos"> 679</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-680"><a href="#L-680"><span class="linenos"> 680</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-681"><a href="#L-681"><span class="linenos"> 681</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-682"><a href="#L-682"><span class="linenos"> 682</span></a><span class="sd"> copy: whether or not to copy the involved expressions (only applies to Expressions).</span> +</span><span id="L-683"><a href="#L-683"><span class="linenos"> 683</span></a><span class="sd"> opts: other options to use to parse the input expressions.</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="sd"> Returns:</span> +</span><span id="L-686"><a href="#L-686"><span class="linenos"> 686</span></a><span class="sd"> The new And condition.</span> +</span><span id="L-687"><a href="#L-687"><span class="linenos"> 687</span></a><span class="sd"> """</span> +</span><span id="L-688"><a href="#L-688"><span class="linenos"> 688</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-689"><a href="#L-689"><span class="linenos"> 689</span></a> +</span><span id="L-690"><a href="#L-690"><span class="linenos"> 690</span></a> <span class="k">def</span> <span class="nf">or_</span><span class="p">(</span> +</span><span id="L-691"><a href="#L-691"><span class="linenos"> 691</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-692"><a href="#L-692"><span class="linenos"> 692</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-693"><a href="#L-693"><span class="linenos"> 693</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-694"><a href="#L-694"><span class="linenos"> 694</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-695"><a href="#L-695"><span class="linenos"> 695</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-696"><a href="#L-696"><span class="linenos"> 696</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="L-697"><a href="#L-697"><span class="linenos"> 697</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-698"><a href="#L-698"><span class="linenos"> 698</span></a><span class="sd"> OR this condition with one or multiple expressions.</span> +</span><span id="L-699"><a href="#L-699"><span class="linenos"> 699</span></a> +</span><span id="L-700"><a href="#L-700"><span class="linenos"> 700</span></a><span class="sd"> Example:</span> +</span><span id="L-701"><a href="#L-701"><span class="linenos"> 701</span></a><span class="sd"> >>> condition("x=1").or_("y=1").sql()</span> +</span><span id="L-702"><a href="#L-702"><span class="linenos"> 702</span></a><span class="sd"> 'x = 1 OR y = 1'</span> +</span><span id="L-703"><a href="#L-703"><span class="linenos"> 703</span></a> +</span><span id="L-704"><a href="#L-704"><span class="linenos"> 704</span></a><span class="sd"> Args:</span> +</span><span id="L-705"><a href="#L-705"><span class="linenos"> 705</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-706"><a href="#L-706"><span class="linenos"> 706</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-707"><a href="#L-707"><span class="linenos"> 707</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-708"><a href="#L-708"><span class="linenos"> 708</span></a><span class="sd"> copy: whether or not to copy the involved expressions (only applies to Expressions).</span> +</span><span id="L-709"><a href="#L-709"><span class="linenos"> 709</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-710"><a href="#L-710"><span class="linenos"> 710</span></a> +</span><span id="L-711"><a href="#L-711"><span class="linenos"> 711</span></a><span class="sd"> Returns:</span> +</span><span id="L-712"><a href="#L-712"><span class="linenos"> 712</span></a><span class="sd"> The new Or condition.</span> +</span><span id="L-713"><a href="#L-713"><span class="linenos"> 713</span></a><span class="sd"> """</span> +</span><span id="L-714"><a href="#L-714"><span class="linenos"> 714</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-715"><a href="#L-715"><span class="linenos"> 715</span></a> +</span><span id="L-716"><a href="#L-716"><span class="linenos"> 716</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 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-717"><a href="#L-717"><span class="linenos"> 717</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-718"><a href="#L-718"><span class="linenos"> 718</span></a><span class="sd"> Wrap this condition with NOT.</span> +</span><span id="L-719"><a href="#L-719"><span class="linenos"> 719</span></a> +</span><span id="L-720"><a href="#L-720"><span class="linenos"> 720</span></a><span class="sd"> Example:</span> +</span><span id="L-721"><a href="#L-721"><span class="linenos"> 721</span></a><span class="sd"> >>> condition("x=1").not_().sql()</span> +</span><span id="L-722"><a href="#L-722"><span class="linenos"> 722</span></a><span class="sd"> 'NOT x = 1'</span> +</span><span id="L-723"><a href="#L-723"><span class="linenos"> 723</span></a> +</span><span id="L-724"><a href="#L-724"><span class="linenos"> 724</span></a><span class="sd"> Args:</span> +</span><span id="L-725"><a href="#L-725"><span class="linenos"> 725</span></a><span class="sd"> copy: whether or not to copy this object.</span> </span><span id="L-726"><a href="#L-726"><span class="linenos"> 726</span></a> -</span><span id="L-727"><a href="#L-727"><span class="linenos"> 727</span></a><span class="sd"> Args:</span> -</span><span id="L-728"><a href="#L-728"><span class="linenos"> 728</span></a><span class="sd"> copy: whether or not to copy this object.</span> -</span><span id="L-729"><a href="#L-729"><span class="linenos"> 729</span></a> -</span><span id="L-730"><a href="#L-730"><span class="linenos"> 730</span></a><span class="sd"> Returns:</span> -</span><span id="L-731"><a href="#L-731"><span class="linenos"> 731</span></a><span class="sd"> The new Not instance.</span> -</span><span id="L-732"><a href="#L-732"><span class="linenos"> 732</span></a><span class="sd"> """</span> -</span><span id="L-733"><a href="#L-733"><span class="linenos"> 733</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 class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> -</span><span id="L-734"><a href="#L-734"><span class="linenos"> 734</span></a> -</span><span id="L-735"><a href="#L-735"><span class="linenos"> 735</span></a> <span class="k">def</span> <span class="nf">as_</span><span class="p">(</span> -</span><span id="L-736"><a href="#L-736"><span class="linenos"> 736</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-737"><a href="#L-737"><span class="linenos"> 737</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-738"><a href="#L-738"><span class="linenos"> 738</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-739"><a href="#L-739"><span class="linenos"> 739</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-740"><a href="#L-740"><span class="linenos"> 740</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-741"><a href="#L-741"><span class="linenos"> 741</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-742"><a href="#L-742"><span class="linenos"> 742</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Alias</span><span class="p">:</span> -</span><span id="L-743"><a href="#L-743"><span class="linenos"> 743</span></a> <span class="k">return</span> <span class="n">alias_</span><span class="p">(</span><span class="bp">self</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 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="n">copy</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 class="k">def</span> <span class="nf">_binop</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">klass</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">E</span><span class="p">],</span> <span class="n">other</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="n">reverse</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> -</span><span id="L-746"><a href="#L-746"><span class="linenos"> 746</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><span id="L-747"><a href="#L-747"><span class="linenos"> 747</span></a> <span class="n">other</span> <span class="o">=</span> <span class="n">convert</span><span class="p">(</span><span class="n">other</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-748"><a href="#L-748"><span class="linenos"> 748</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">klass</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">other</span><span class="p">,</span> <span class="n">klass</span><span class="p">):</span> -</span><span id="L-749"><a href="#L-749"><span class="linenos"> 749</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">_wrap</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">Binary</span><span class="p">)</span> -</span><span id="L-750"><a href="#L-750"><span class="linenos"> 750</span></a> <span class="n">other</span> <span class="o">=</span> <span class="n">_wrap</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="n">Binary</span><span class="p">)</span> -</span><span id="L-751"><a href="#L-751"><span class="linenos"> 751</span></a> <span class="k">if</span> <span class="n">reverse</span><span class="p">:</span> -</span><span id="L-752"><a href="#L-752"><span class="linenos"> 752</span></a> <span class="k">return</span> <span class="n">klass</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">other</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">this</span><span class="p">)</span> -</span><span id="L-753"><a href="#L-753"><span class="linenos"> 753</span></a> <span class="k">return</span> <span class="n">klass</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">other</span><span class="p">)</span> -</span><span id="L-754"><a href="#L-754"><span class="linenos"> 754</span></a> -</span><span id="L-755"><a href="#L-755"><span class="linenos"> 755</span></a> <span class="k">def</span> <span class="fm">__getitem__</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="n">ExpOrStr</span> <span class="o">|</span> <span class="n">t</span><span class="o">.</span><span class="n">Tuple</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]):</span> -</span><span id="L-756"><a href="#L-756"><span class="linenos"> 756</span></a> <span class="k">return</span> <span class="n">Bracket</span><span class="p">(</span> -</span><span id="L-757"><a href="#L-757"><span class="linenos"> 757</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="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">e</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="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">ensure_list</span><span class="p">(</span><span class="n">other</span><span class="p">)]</span> -</span><span id="L-758"><a href="#L-758"><span class="linenos"> 758</span></a> <span class="p">)</span> -</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">def</span> <span class="nf">isin</span><span class="p">(</span> -</span><span id="L-761"><a href="#L-761"><span class="linenos"> 761</span></a> <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">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="n">query</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">opts</span> -</span><span id="L-762"><a href="#L-762"><span class="linenos"> 762</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">In</span><span class="p">:</span> -</span><span id="L-763"><a href="#L-763"><span class="linenos"> 763</span></a> <span class="k">return</span> <span class="n">In</span><span class="p">(</span> -</span><span id="L-764"><a href="#L-764"><span class="linenos"> 764</span></a> <span class="n">this</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-765"><a href="#L-765"><span class="linenos"> 765</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">e</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">],</span> -</span><span id="L-766"><a href="#L-766"><span class="linenos"> 766</span></a> <span class="n">query</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">if</span> <span class="n">query</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-767"><a href="#L-767"><span class="linenos"> 767</span></a> <span class="p">)</span> -</span><span id="L-768"><a href="#L-768"><span class="linenos"> 768</span></a> -</span><span id="L-769"><a href="#L-769"><span class="linenos"> 769</span></a> <span class="k">def</span> <span class="nf">between</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">low</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="n">high</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="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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Between</span><span class="p">:</span> -</span><span id="L-770"><a href="#L-770"><span class="linenos"> 770</span></a> <span class="k">return</span> <span class="n">Between</span><span class="p">(</span> -</span><span id="L-771"><a href="#L-771"><span class="linenos"> 771</span></a> <span class="n">this</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-772"><a href="#L-772"><span class="linenos"> 772</span></a> <span class="n">low</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">low</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="L-773"><a href="#L-773"><span class="linenos"> 773</span></a> <span class="n">high</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">high</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="L-774"><a href="#L-774"><span class="linenos"> 774</span></a> <span class="p">)</span> +</span><span id="L-727"><a href="#L-727"><span class="linenos"> 727</span></a><span class="sd"> Returns:</span> +</span><span id="L-728"><a href="#L-728"><span class="linenos"> 728</span></a><span class="sd"> The new Not instance.</span> +</span><span id="L-729"><a href="#L-729"><span class="linenos"> 729</span></a><span class="sd"> """</span> +</span><span id="L-730"><a href="#L-730"><span class="linenos"> 730</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 class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> +</span><span id="L-731"><a href="#L-731"><span class="linenos"> 731</span></a> +</span><span id="L-732"><a href="#L-732"><span class="linenos"> 732</span></a> <span class="k">def</span> <span class="nf">as_</span><span class="p">(</span> +</span><span id="L-733"><a href="#L-733"><span class="linenos"> 733</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-734"><a href="#L-734"><span class="linenos"> 734</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-735"><a href="#L-735"><span class="linenos"> 735</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-736"><a href="#L-736"><span class="linenos"> 736</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-737"><a href="#L-737"><span class="linenos"> 737</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-738"><a href="#L-738"><span class="linenos"> 738</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-739"><a href="#L-739"><span class="linenos"> 739</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Alias</span><span class="p">:</span> +</span><span id="L-740"><a href="#L-740"><span class="linenos"> 740</span></a> <span class="k">return</span> <span class="n">alias_</span><span class="p">(</span><span class="bp">self</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 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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-741"><a href="#L-741"><span class="linenos"> 741</span></a> +</span><span id="L-742"><a href="#L-742"><span class="linenos"> 742</span></a> <span class="k">def</span> <span class="nf">_binop</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">klass</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">E</span><span class="p">],</span> <span class="n">other</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="n">reverse</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="L-743"><a href="#L-743"><span class="linenos"> 743</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><span id="L-744"><a href="#L-744"><span class="linenos"> 744</span></a> <span class="n">other</span> <span class="o">=</span> <span class="n">convert</span><span class="p">(</span><span class="n">other</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-745"><a href="#L-745"><span class="linenos"> 745</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">klass</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">other</span><span class="p">,</span> <span class="n">klass</span><span class="p">):</span> +</span><span id="L-746"><a href="#L-746"><span class="linenos"> 746</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">_wrap</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">Binary</span><span class="p">)</span> +</span><span id="L-747"><a href="#L-747"><span class="linenos"> 747</span></a> <span class="n">other</span> <span class="o">=</span> <span class="n">_wrap</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="n">Binary</span><span class="p">)</span> +</span><span id="L-748"><a href="#L-748"><span class="linenos"> 748</span></a> <span class="k">if</span> <span class="n">reverse</span><span class="p">:</span> +</span><span id="L-749"><a href="#L-749"><span class="linenos"> 749</span></a> <span class="k">return</span> <span class="n">klass</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">other</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">this</span><span class="p">)</span> +</span><span id="L-750"><a href="#L-750"><span class="linenos"> 750</span></a> <span class="k">return</span> <span class="n">klass</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">other</span><span class="p">)</span> +</span><span id="L-751"><a href="#L-751"><span class="linenos"> 751</span></a> +</span><span id="L-752"><a href="#L-752"><span class="linenos"> 752</span></a> <span class="k">def</span> <span class="fm">__getitem__</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="n">ExpOrStr</span> <span class="o">|</span> <span class="n">t</span><span class="o">.</span><span class="n">Tuple</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]):</span> +</span><span id="L-753"><a href="#L-753"><span class="linenos"> 753</span></a> <span class="k">return</span> <span class="n">Bracket</span><span class="p">(</span> +</span><span id="L-754"><a href="#L-754"><span class="linenos"> 754</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="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">e</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="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">ensure_list</span><span class="p">(</span><span class="n">other</span><span class="p">)]</span> +</span><span id="L-755"><a href="#L-755"><span class="linenos"> 755</span></a> <span class="p">)</span> +</span><span id="L-756"><a href="#L-756"><span class="linenos"> 756</span></a> +</span><span id="L-757"><a href="#L-757"><span class="linenos"> 757</span></a> <span class="k">def</span> <span class="nf">isin</span><span class="p">(</span> +</span><span id="L-758"><a href="#L-758"><span class="linenos"> 758</span></a> <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">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="n">query</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">opts</span> +</span><span id="L-759"><a href="#L-759"><span class="linenos"> 759</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">In</span><span class="p">:</span> +</span><span id="L-760"><a href="#L-760"><span class="linenos"> 760</span></a> <span class="k">return</span> <span class="n">In</span><span class="p">(</span> +</span><span id="L-761"><a href="#L-761"><span class="linenos"> 761</span></a> <span class="n">this</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-762"><a href="#L-762"><span class="linenos"> 762</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">e</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">],</span> +</span><span id="L-763"><a href="#L-763"><span class="linenos"> 763</span></a> <span class="n">query</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">if</span> <span class="n">query</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-764"><a href="#L-764"><span class="linenos"> 764</span></a> <span class="p">)</span> +</span><span id="L-765"><a href="#L-765"><span class="linenos"> 765</span></a> +</span><span id="L-766"><a href="#L-766"><span class="linenos"> 766</span></a> <span class="k">def</span> <span class="nf">between</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">low</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="n">high</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="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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Between</span><span class="p">:</span> +</span><span id="L-767"><a href="#L-767"><span class="linenos"> 767</span></a> <span class="k">return</span> <span class="n">Between</span><span class="p">(</span> +</span><span id="L-768"><a href="#L-768"><span class="linenos"> 768</span></a> <span class="n">this</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-769"><a href="#L-769"><span class="linenos"> 769</span></a> <span class="n">low</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">low</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="L-770"><a href="#L-770"><span class="linenos"> 770</span></a> <span class="n">high</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">high</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</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 class="k">def</span> <span class="nf">is_</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">Is</span><span class="p">:</span> +</span><span id="L-774"><a href="#L-774"><span class="linenos"> 774</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Is</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-775"><a href="#L-775"><span class="linenos"> 775</span></a> -</span><span id="L-776"><a href="#L-776"><span class="linenos"> 776</span></a> <span class="k">def</span> <span class="nf">is_</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">Is</span><span class="p">:</span> -</span><span id="L-777"><a href="#L-777"><span class="linenos"> 777</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Is</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-776"><a href="#L-776"><span class="linenos"> 776</span></a> <span class="k">def</span> <span class="nf">like</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">Like</span><span class="p">:</span> +</span><span id="L-777"><a href="#L-777"><span class="linenos"> 777</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Like</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-778"><a href="#L-778"><span class="linenos"> 778</span></a> -</span><span id="L-779"><a href="#L-779"><span class="linenos"> 779</span></a> <span class="k">def</span> <span class="nf">like</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">Like</span><span class="p">:</span> -</span><span id="L-780"><a href="#L-780"><span class="linenos"> 780</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Like</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-779"><a href="#L-779"><span class="linenos"> 779</span></a> <span class="k">def</span> <span class="nf">ilike</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">ILike</span><span class="p">:</span> +</span><span id="L-780"><a href="#L-780"><span class="linenos"> 780</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">ILike</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-781"><a href="#L-781"><span class="linenos"> 781</span></a> -</span><span id="L-782"><a href="#L-782"><span class="linenos"> 782</span></a> <span class="k">def</span> <span class="nf">ilike</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">ILike</span><span class="p">:</span> -</span><span id="L-783"><a href="#L-783"><span class="linenos"> 783</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">ILike</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-782"><a href="#L-782"><span class="linenos"> 782</span></a> <span class="k">def</span> <span class="nf">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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">EQ</span><span class="p">:</span> +</span><span id="L-783"><a href="#L-783"><span class="linenos"> 783</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">EQ</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-784"><a href="#L-784"><span class="linenos"> 784</span></a> -</span><span id="L-785"><a href="#L-785"><span class="linenos"> 785</span></a> <span class="k">def</span> <span class="nf">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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">EQ</span><span class="p">:</span> -</span><span id="L-786"><a href="#L-786"><span class="linenos"> 786</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">EQ</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-785"><a href="#L-785"><span class="linenos"> 785</span></a> <span class="k">def</span> <span class="nf">neq</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">NEQ</span><span class="p">:</span> +</span><span id="L-786"><a href="#L-786"><span class="linenos"> 786</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">NEQ</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-787"><a href="#L-787"><span class="linenos"> 787</span></a> -</span><span id="L-788"><a href="#L-788"><span class="linenos"> 788</span></a> <span class="k">def</span> <span class="nf">neq</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">NEQ</span><span class="p">:</span> -</span><span id="L-789"><a href="#L-789"><span class="linenos"> 789</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">NEQ</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-788"><a href="#L-788"><span class="linenos"> 788</span></a> <span class="k">def</span> <span class="nf">rlike</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">RegexpLike</span><span class="p">:</span> +</span><span id="L-789"><a href="#L-789"><span class="linenos"> 789</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">RegexpLike</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </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">def</span> <span class="nf">rlike</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">RegexpLike</span><span class="p">:</span> -</span><span id="L-792"><a href="#L-792"><span class="linenos"> 792</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">RegexpLike</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-791"><a href="#L-791"><span class="linenos"> 791</span></a> <span class="k">def</span> <span class="fm">__lt__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">LT</span><span class="p">:</span> +</span><span id="L-792"><a href="#L-792"><span class="linenos"> 792</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">LT</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </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 class="k">def</span> <span class="fm">__lt__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">LT</span><span class="p">:</span> -</span><span id="L-795"><a href="#L-795"><span class="linenos"> 795</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">LT</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-794"><a href="#L-794"><span class="linenos"> 794</span></a> <span class="k">def</span> <span class="fm">__le__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">LTE</span><span class="p">:</span> +</span><span id="L-795"><a href="#L-795"><span class="linenos"> 795</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">LTE</span><span class="p">,</span> <span class="n">other</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 class="k">def</span> <span class="fm">__le__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">LTE</span><span class="p">:</span> -</span><span id="L-798"><a href="#L-798"><span class="linenos"> 798</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">LTE</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-797"><a href="#L-797"><span class="linenos"> 797</span></a> <span class="k">def</span> <span class="fm">__gt__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">GT</span><span class="p">:</span> +</span><span id="L-798"><a href="#L-798"><span class="linenos"> 798</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">GT</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-799"><a href="#L-799"><span class="linenos"> 799</span></a> -</span><span id="L-800"><a href="#L-800"><span class="linenos"> 800</span></a> <span class="k">def</span> <span class="fm">__gt__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">GT</span><span class="p">:</span> -</span><span id="L-801"><a href="#L-801"><span class="linenos"> 801</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">GT</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-800"><a href="#L-800"><span class="linenos"> 800</span></a> <span class="k">def</span> <span class="fm">__ge__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">GTE</span><span class="p">:</span> +</span><span id="L-801"><a href="#L-801"><span class="linenos"> 801</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">GTE</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-802"><a href="#L-802"><span class="linenos"> 802</span></a> -</span><span id="L-803"><a href="#L-803"><span class="linenos"> 803</span></a> <span class="k">def</span> <span class="fm">__ge__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">GTE</span><span class="p">:</span> -</span><span id="L-804"><a href="#L-804"><span class="linenos"> 804</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">GTE</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-803"><a href="#L-803"><span class="linenos"> 803</span></a> <span class="k">def</span> <span class="fm">__add__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Add</span><span class="p">:</span> +</span><span id="L-804"><a href="#L-804"><span class="linenos"> 804</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Add</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-805"><a href="#L-805"><span class="linenos"> 805</span></a> -</span><span id="L-806"><a href="#L-806"><span class="linenos"> 806</span></a> <span class="k">def</span> <span class="fm">__add__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Add</span><span class="p">:</span> -</span><span id="L-807"><a href="#L-807"><span class="linenos"> 807</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Add</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-806"><a href="#L-806"><span class="linenos"> 806</span></a> <span class="k">def</span> <span class="fm">__radd__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Add</span><span class="p">:</span> +</span><span id="L-807"><a href="#L-807"><span class="linenos"> 807</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Add</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </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">def</span> <span class="fm">__radd__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Add</span><span class="p">:</span> -</span><span id="L-810"><a href="#L-810"><span class="linenos"> 810</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Add</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-809"><a href="#L-809"><span class="linenos"> 809</span></a> <span class="k">def</span> <span class="fm">__sub__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Sub</span><span class="p">:</span> +</span><span id="L-810"><a href="#L-810"><span class="linenos"> 810</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Sub</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </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">def</span> <span class="fm">__sub__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Sub</span><span class="p">:</span> -</span><span id="L-813"><a href="#L-813"><span class="linenos"> 813</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Sub</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-812"><a href="#L-812"><span class="linenos"> 812</span></a> <span class="k">def</span> <span class="fm">__rsub__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Sub</span><span class="p">:</span> +</span><span id="L-813"><a href="#L-813"><span class="linenos"> 813</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Sub</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="L-814"><a href="#L-814"><span class="linenos"> 814</span></a> -</span><span id="L-815"><a href="#L-815"><span class="linenos"> 815</span></a> <span class="k">def</span> <span class="fm">__rsub__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Sub</span><span class="p">:</span> -</span><span id="L-816"><a href="#L-816"><span class="linenos"> 816</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Sub</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</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="k">def</span> <span class="fm">__mul__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mul</span><span class="p">:</span> +</span><span id="L-816"><a href="#L-816"><span class="linenos"> 816</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mul</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-817"><a href="#L-817"><span class="linenos"> 817</span></a> -</span><span id="L-818"><a href="#L-818"><span class="linenos"> 818</span></a> <span class="k">def</span> <span class="fm">__mul__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mul</span><span class="p">:</span> -</span><span id="L-819"><a href="#L-819"><span class="linenos"> 819</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mul</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-818"><a href="#L-818"><span class="linenos"> 818</span></a> <span class="k">def</span> <span class="fm">__rmul__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mul</span><span class="p">:</span> +</span><span id="L-819"><a href="#L-819"><span class="linenos"> 819</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mul</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="L-820"><a href="#L-820"><span class="linenos"> 820</span></a> -</span><span id="L-821"><a href="#L-821"><span class="linenos"> 821</span></a> <span class="k">def</span> <span class="fm">__rmul__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mul</span><span class="p">:</span> -</span><span id="L-822"><a href="#L-822"><span class="linenos"> 822</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mul</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-821"><a href="#L-821"><span class="linenos"> 821</span></a> <span class="k">def</span> <span class="fm">__truediv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Div</span><span class="p">:</span> +</span><span id="L-822"><a href="#L-822"><span class="linenos"> 822</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Div</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-823"><a href="#L-823"><span class="linenos"> 823</span></a> -</span><span id="L-824"><a href="#L-824"><span class="linenos"> 824</span></a> <span class="k">def</span> <span class="fm">__truediv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Div</span><span class="p">:</span> -</span><span id="L-825"><a href="#L-825"><span class="linenos"> 825</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Div</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-824"><a href="#L-824"><span class="linenos"> 824</span></a> <span class="k">def</span> <span class="fm">__rtruediv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Div</span><span class="p">:</span> +</span><span id="L-825"><a href="#L-825"><span class="linenos"> 825</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Div</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="L-826"><a href="#L-826"><span class="linenos"> 826</span></a> -</span><span id="L-827"><a href="#L-827"><span class="linenos"> 827</span></a> <span class="k">def</span> <span class="fm">__rtruediv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Div</span><span class="p">:</span> -</span><span id="L-828"><a href="#L-828"><span class="linenos"> 828</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Div</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-827"><a href="#L-827"><span class="linenos"> 827</span></a> <span class="k">def</span> <span class="fm">__floordiv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">IntDiv</span><span class="p">:</span> +</span><span id="L-828"><a href="#L-828"><span class="linenos"> 828</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">IntDiv</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-829"><a href="#L-829"><span class="linenos"> 829</span></a> -</span><span id="L-830"><a href="#L-830"><span class="linenos"> 830</span></a> <span class="k">def</span> <span class="fm">__floordiv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">IntDiv</span><span class="p">:</span> -</span><span id="L-831"><a href="#L-831"><span class="linenos"> 831</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">IntDiv</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-830"><a href="#L-830"><span class="linenos"> 830</span></a> <span class="k">def</span> <span class="fm">__rfloordiv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">IntDiv</span><span class="p">:</span> +</span><span id="L-831"><a href="#L-831"><span class="linenos"> 831</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">IntDiv</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </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">def</span> <span class="fm">__rfloordiv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">IntDiv</span><span class="p">:</span> -</span><span id="L-834"><a href="#L-834"><span class="linenos"> 834</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">IntDiv</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-833"><a href="#L-833"><span class="linenos"> 833</span></a> <span class="k">def</span> <span class="fm">__mod__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mod</span><span class="p">:</span> +</span><span id="L-834"><a href="#L-834"><span class="linenos"> 834</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mod</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </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 class="k">def</span> <span class="fm">__mod__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mod</span><span class="p">:</span> -</span><span id="L-837"><a href="#L-837"><span class="linenos"> 837</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mod</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-836"><a href="#L-836"><span class="linenos"> 836</span></a> <span class="k">def</span> <span class="fm">__rmod__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mod</span><span class="p">:</span> +</span><span id="L-837"><a href="#L-837"><span class="linenos"> 837</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mod</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</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 class="k">def</span> <span class="fm">__rmod__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mod</span><span class="p">:</span> -</span><span id="L-840"><a href="#L-840"><span class="linenos"> 840</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mod</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-839"><a href="#L-839"><span class="linenos"> 839</span></a> <span class="k">def</span> <span class="fm">__pow__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Pow</span><span class="p">:</span> +</span><span id="L-840"><a href="#L-840"><span class="linenos"> 840</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Pow</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-841"><a href="#L-841"><span class="linenos"> 841</span></a> -</span><span id="L-842"><a href="#L-842"><span class="linenos"> 842</span></a> <span class="k">def</span> <span class="fm">__pow__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Pow</span><span class="p">:</span> -</span><span id="L-843"><a href="#L-843"><span class="linenos"> 843</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Pow</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-842"><a href="#L-842"><span class="linenos"> 842</span></a> <span class="k">def</span> <span class="fm">__rpow__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Pow</span><span class="p">:</span> +</span><span id="L-843"><a href="#L-843"><span class="linenos"> 843</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Pow</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </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">def</span> <span class="fm">__rpow__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Pow</span><span class="p">:</span> -</span><span id="L-846"><a href="#L-846"><span class="linenos"> 846</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Pow</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-845"><a href="#L-845"><span class="linenos"> 845</span></a> <span class="k">def</span> <span class="fm">__and__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">And</span><span class="p">:</span> +</span><span id="L-846"><a href="#L-846"><span class="linenos"> 846</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">And</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </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 class="k">def</span> <span class="fm">__and__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">And</span><span class="p">:</span> -</span><span id="L-849"><a href="#L-849"><span class="linenos"> 849</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">And</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-848"><a href="#L-848"><span class="linenos"> 848</span></a> <span class="k">def</span> <span class="fm">__rand__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">And</span><span class="p">:</span> +</span><span id="L-849"><a href="#L-849"><span class="linenos"> 849</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">And</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</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 class="k">def</span> <span class="fm">__rand__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">And</span><span class="p">:</span> -</span><span id="L-852"><a href="#L-852"><span class="linenos"> 852</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">And</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-851"><a href="#L-851"><span class="linenos"> 851</span></a> <span class="k">def</span> <span class="fm">__or__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Or</span><span class="p">:</span> +</span><span id="L-852"><a href="#L-852"><span class="linenos"> 852</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Or</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="L-853"><a href="#L-853"><span class="linenos"> 853</span></a> -</span><span id="L-854"><a href="#L-854"><span class="linenos"> 854</span></a> <span class="k">def</span> <span class="fm">__or__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Or</span><span class="p">:</span> -</span><span id="L-855"><a href="#L-855"><span class="linenos"> 855</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Or</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="L-854"><a href="#L-854"><span class="linenos"> 854</span></a> <span class="k">def</span> <span class="fm">__ror__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Or</span><span class="p">:</span> +</span><span id="L-855"><a href="#L-855"><span class="linenos"> 855</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Or</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="L-856"><a href="#L-856"><span class="linenos"> 856</span></a> -</span><span id="L-857"><a href="#L-857"><span class="linenos"> 857</span></a> <span class="k">def</span> <span class="fm">__ror__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Or</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">_binop</span><span class="p">(</span><span class="n">Or</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-857"><a href="#L-857"><span class="linenos"> 857</span></a> <span class="k">def</span> <span class="fm">__neg__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Neg</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="n">Neg</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">_wrap</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">(),</span> <span class="n">Binary</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 class="k">def</span> <span class="fm">__neg__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Neg</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="n">Neg</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">_wrap</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">(),</span> <span class="n">Binary</span><span class="p">))</span> +</span><span id="L-860"><a href="#L-860"><span class="linenos"> 860</span></a> <span class="k">def</span> <span class="fm">__invert__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Not</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="n">not_</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">copy</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 class="k">def</span> <span class="fm">__invert__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Not</span><span class="p">:</span> -</span><span id="L-864"><a href="#L-864"><span class="linenos"> 864</span></a> <span class="k">return</span> <span class="n">not_</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">())</span> -</span><span id="L-865"><a href="#L-865"><span class="linenos"> 865</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 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-865"><a href="#L-865"><span class="linenos"> 865</span></a><span class="w"> </span><span class="sd">"""Relationships like x = y, x > 1, x >= y."""</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 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-868"><a href="#L-868"><span class="linenos"> 868</span></a><span class="w"> </span><span class="sd">"""Relationships like x = y, x > 1, x >= y."""</span> -</span><span id="L-869"><a href="#L-869"><span class="linenos"> 869</span></a> -</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 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-872"><a href="#L-872"><span class="linenos"> 872</span></a> <span class="nd">@property</span> -</span><span id="L-873"><a href="#L-873"><span class="linenos"> 873</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 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-874"><a href="#L-874"><span class="linenos"> 874</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-875"><a href="#L-875"><span class="linenos"> 875</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-876"><a href="#L-876"><span class="linenos"> 876</span></a> <span class="k">return</span> <span class="p">[]</span> -</span><span id="L-877"><a href="#L-877"><span class="linenos"> 877</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">table_alias</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-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">selects</span><span class="p">(</span><span class="bp">self</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">this</span><span class="o">.</span><span class="n">selects</span> <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">this</span><span class="p">,</span> <span class="n">Subqueryable</span><span class="p">)</span> <span class="k">else</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">named_selects</span><span class="p">(</span><span class="bp">self</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="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-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><span id="L-888"><a href="#L-888"><span class="linenos"> 888</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-889"><a href="#L-889"><span class="linenos"> 889</span></a> <span class="k">def</span> <span class="nf">union</span><span class="p">(</span> -</span><span id="L-890"><a href="#L-890"><span class="linenos"> 890</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="L-891"><a href="#L-891"><span class="linenos"> 891</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> -</span><span id="L-892"><a href="#L-892"><span class="linenos"> 892</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-893"><a href="#L-893"><span class="linenos"> 893</span></a><span class="sd"> Builds a UNION expression.</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 class="sd"> Example:</span> -</span><span id="L-896"><a href="#L-896"><span class="linenos"> 896</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-897"><a href="#L-897"><span class="linenos"> 897</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()</span> -</span><span id="L-898"><a href="#L-898"><span class="linenos"> 898</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> -</span><span id="L-899"><a href="#L-899"><span class="linenos"> 899</span></a> -</span><span id="L-900"><a href="#L-900"><span class="linenos"> 900</span></a><span class="sd"> Args:</span> -</span><span id="L-901"><a href="#L-901"><span class="linenos"> 901</span></a><span class="sd"> expression: the SQL code string.</span> -</span><span id="L-902"><a href="#L-902"><span class="linenos"> 902</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-903"><a href="#L-903"><span class="linenos"> 903</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="L-904"><a href="#L-904"><span class="linenos"> 904</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-905"><a href="#L-905"><span class="linenos"> 905</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-906"><a href="#L-906"><span class="linenos"> 906</span></a> -</span><span id="L-907"><a href="#L-907"><span class="linenos"> 907</span></a><span class="sd"> Returns:</span> -</span><span id="L-908"><a href="#L-908"><span class="linenos"> 908</span></a><span class="sd"> The new Union expression.</span> -</span><span id="L-909"><a href="#L-909"><span class="linenos"> 909</span></a><span class="sd"> """</span> -</span><span id="L-910"><a href="#L-910"><span class="linenos"> 910</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-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 class="k">def</span> <span class="nf">intersect</span><span class="p">(</span> -</span><span id="L-913"><a href="#L-913"><span class="linenos"> 913</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="L-914"><a href="#L-914"><span class="linenos"> 914</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> -</span><span id="L-915"><a href="#L-915"><span class="linenos"> 915</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-916"><a href="#L-916"><span class="linenos"> 916</span></a><span class="sd"> Builds an INTERSECT expression.</span> -</span><span id="L-917"><a href="#L-917"><span class="linenos"> 917</span></a> -</span><span id="L-918"><a href="#L-918"><span class="linenos"> 918</span></a><span class="sd"> Example:</span> -</span><span id="L-919"><a href="#L-919"><span class="linenos"> 919</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-920"><a href="#L-920"><span class="linenos"> 920</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()</span> -</span><span id="L-921"><a href="#L-921"><span class="linenos"> 921</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</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 class="sd"> Args:</span> -</span><span id="L-924"><a href="#L-924"><span class="linenos"> 924</span></a><span class="sd"> expression: the SQL code string.</span> -</span><span id="L-925"><a href="#L-925"><span class="linenos"> 925</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-926"><a href="#L-926"><span class="linenos"> 926</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="L-927"><a href="#L-927"><span class="linenos"> 927</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-928"><a href="#L-928"><span class="linenos"> 928</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-929"><a href="#L-929"><span class="linenos"> 929</span></a> -</span><span id="L-930"><a href="#L-930"><span class="linenos"> 930</span></a><span class="sd"> Returns:</span> -</span><span id="L-931"><a href="#L-931"><span class="linenos"> 931</span></a><span class="sd"> The new Intersect expression.</span> -</span><span id="L-932"><a href="#L-932"><span class="linenos"> 932</span></a><span class="sd"> """</span> -</span><span id="L-933"><a href="#L-933"><span class="linenos"> 933</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-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 class="k">def</span> <span class="nf">except_</span><span class="p">(</span> -</span><span id="L-936"><a href="#L-936"><span class="linenos"> 936</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="L-937"><a href="#L-937"><span class="linenos"> 937</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> -</span><span id="L-938"><a href="#L-938"><span class="linenos"> 938</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-939"><a href="#L-939"><span class="linenos"> 939</span></a><span class="sd"> Builds an EXCEPT expression.</span> -</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="sd"> Example:</span> -</span><span id="L-942"><a href="#L-942"><span class="linenos"> 942</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-943"><a href="#L-943"><span class="linenos"> 943</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()</span> -</span><span id="L-944"><a href="#L-944"><span class="linenos"> 944</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> -</span><span id="L-945"><a href="#L-945"><span class="linenos"> 945</span></a> -</span><span id="L-946"><a href="#L-946"><span class="linenos"> 946</span></a><span class="sd"> Args:</span> -</span><span id="L-947"><a href="#L-947"><span class="linenos"> 947</span></a><span class="sd"> expression: the SQL code string.</span> -</span><span id="L-948"><a href="#L-948"><span class="linenos"> 948</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-949"><a href="#L-949"><span class="linenos"> 949</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="L-950"><a href="#L-950"><span class="linenos"> 950</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-951"><a href="#L-951"><span class="linenos"> 951</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</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="sd"> Returns:</span> -</span><span id="L-954"><a href="#L-954"><span class="linenos"> 954</span></a><span class="sd"> The new Except expression.</span> -</span><span id="L-955"><a href="#L-955"><span class="linenos"> 955</span></a><span class="sd"> """</span> -</span><span id="L-956"><a href="#L-956"><span class="linenos"> 956</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-957"><a href="#L-957"><span class="linenos"> 957</span></a> -</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 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-960"><a href="#L-960"><span class="linenos"> 960</span></a> <span class="nd">@property</span> -</span><span id="L-961"><a href="#L-961"><span class="linenos"> 961</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-962"><a href="#L-962"><span class="linenos"> 962</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-963"><a href="#L-963"><span class="linenos"> 963</span></a> <span class="k">return</span> <span class="n">alias</span><span class="o">.</span><span class="n">columns</span> <span class="k">if</span> <span class="n">alias</span> <span class="k">else</span> <span class="p">[]</span> -</span><span id="L-964"><a href="#L-964"><span class="linenos"> 964</span></a> -</span><span id="L-965"><a href="#L-965"><span class="linenos"> 965</span></a> -</span><span id="L-966"><a href="#L-966"><span class="linenos"> 966</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-967"><a href="#L-967"><span class="linenos"> 967</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-968"><a href="#L-968"><span class="linenos"> 968</span></a> <span class="s2">"with"</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">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-970"><a href="#L-970"><span class="linenos"> 970</span></a> <span class="s2">"lazy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-971"><a href="#L-971"><span class="linenos"> 971</span></a> <span class="s2">"options"</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">"expression"</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="p">}</span> -</span><span id="L-974"><a href="#L-974"><span class="linenos"> 974</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 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-869"><a href="#L-869"><span class="linenos"> 869</span></a> <span class="nd">@property</span> +</span><span id="L-870"><a href="#L-870"><span class="linenos"> 870</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 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-871"><a href="#L-871"><span class="linenos"> 871</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-872"><a href="#L-872"><span class="linenos"> 872</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-873"><a href="#L-873"><span class="linenos"> 873</span></a> <span class="k">return</span> <span class="p">[]</span> +</span><span id="L-874"><a href="#L-874"><span class="linenos"> 874</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">table_alias</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-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">selects</span><span class="p">(</span><span class="bp">self</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">this</span><span class="o">.</span><span class="n">selects</span> <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">this</span><span class="p">,</span> <span class="n">Subqueryable</span><span class="p">)</span> <span class="k">else</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">named_selects</span><span class="p">(</span><span class="bp">self</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="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-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><span id="L-885"><a href="#L-885"><span class="linenos"> 885</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-886"><a href="#L-886"><span class="linenos"> 886</span></a> <span class="k">def</span> <span class="nf">union</span><span class="p">(</span> +</span><span id="L-887"><a href="#L-887"><span class="linenos"> 887</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="L-888"><a href="#L-888"><span class="linenos"> 888</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> +</span><span id="L-889"><a href="#L-889"><span class="linenos"> 889</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-890"><a href="#L-890"><span class="linenos"> 890</span></a><span class="sd"> Builds a UNION expression.</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 class="sd"> Example:</span> +</span><span id="L-893"><a href="#L-893"><span class="linenos"> 893</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-894"><a href="#L-894"><span class="linenos"> 894</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()</span> +</span><span id="L-895"><a href="#L-895"><span class="linenos"> 895</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> +</span><span id="L-896"><a href="#L-896"><span class="linenos"> 896</span></a> +</span><span id="L-897"><a href="#L-897"><span class="linenos"> 897</span></a><span class="sd"> Args:</span> +</span><span id="L-898"><a href="#L-898"><span class="linenos"> 898</span></a><span class="sd"> expression: the SQL code string.</span> +</span><span id="L-899"><a href="#L-899"><span class="linenos"> 899</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-900"><a href="#L-900"><span class="linenos"> 900</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="L-901"><a href="#L-901"><span class="linenos"> 901</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-902"><a href="#L-902"><span class="linenos"> 902</span></a><span class="sd"> opts: other options to use to parse the input expressions.</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 class="sd"> Returns:</span> +</span><span id="L-905"><a href="#L-905"><span class="linenos"> 905</span></a><span class="sd"> The new Union expression.</span> +</span><span id="L-906"><a href="#L-906"><span class="linenos"> 906</span></a><span class="sd"> """</span> +</span><span id="L-907"><a href="#L-907"><span class="linenos"> 907</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-908"><a href="#L-908"><span class="linenos"> 908</span></a> +</span><span id="L-909"><a href="#L-909"><span class="linenos"> 909</span></a> <span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span> +</span><span id="L-910"><a href="#L-910"><span class="linenos"> 910</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="L-911"><a href="#L-911"><span class="linenos"> 911</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> +</span><span id="L-912"><a href="#L-912"><span class="linenos"> 912</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-913"><a href="#L-913"><span class="linenos"> 913</span></a><span class="sd"> Builds an INTERSECT expression.</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 class="sd"> Example:</span> +</span><span id="L-916"><a href="#L-916"><span class="linenos"> 916</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-917"><a href="#L-917"><span class="linenos"> 917</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()</span> +</span><span id="L-918"><a href="#L-918"><span class="linenos"> 918</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> +</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 class="sd"> Args:</span> +</span><span id="L-921"><a href="#L-921"><span class="linenos"> 921</span></a><span class="sd"> expression: the SQL code string.</span> +</span><span id="L-922"><a href="#L-922"><span class="linenos"> 922</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-923"><a href="#L-923"><span class="linenos"> 923</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="L-924"><a href="#L-924"><span class="linenos"> 924</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-925"><a href="#L-925"><span class="linenos"> 925</span></a><span class="sd"> opts: other options to use to parse the input expressions.</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 class="sd"> Returns:</span> +</span><span id="L-928"><a href="#L-928"><span class="linenos"> 928</span></a><span class="sd"> The new Intersect expression.</span> +</span><span id="L-929"><a href="#L-929"><span class="linenos"> 929</span></a><span class="sd"> """</span> +</span><span id="L-930"><a href="#L-930"><span class="linenos"> 930</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-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 class="k">def</span> <span class="nf">except_</span><span class="p">(</span> +</span><span id="L-933"><a href="#L-933"><span class="linenos"> 933</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="L-934"><a href="#L-934"><span class="linenos"> 934</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> +</span><span id="L-935"><a href="#L-935"><span class="linenos"> 935</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-936"><a href="#L-936"><span class="linenos"> 936</span></a><span class="sd"> Builds an EXCEPT expression.</span> +</span><span id="L-937"><a href="#L-937"><span class="linenos"> 937</span></a> +</span><span id="L-938"><a href="#L-938"><span class="linenos"> 938</span></a><span class="sd"> Example:</span> +</span><span id="L-939"><a href="#L-939"><span class="linenos"> 939</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-940"><a href="#L-940"><span class="linenos"> 940</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()</span> +</span><span id="L-941"><a href="#L-941"><span class="linenos"> 941</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</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 class="sd"> Args:</span> +</span><span id="L-944"><a href="#L-944"><span class="linenos"> 944</span></a><span class="sd"> expression: the SQL code string.</span> +</span><span id="L-945"><a href="#L-945"><span class="linenos"> 945</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-946"><a href="#L-946"><span class="linenos"> 946</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="L-947"><a href="#L-947"><span class="linenos"> 947</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-948"><a href="#L-948"><span class="linenos"> 948</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-949"><a href="#L-949"><span class="linenos"> 949</span></a> +</span><span id="L-950"><a href="#L-950"><span class="linenos"> 950</span></a><span class="sd"> Returns:</span> +</span><span id="L-951"><a href="#L-951"><span class="linenos"> 951</span></a><span class="sd"> The new Except expression.</span> +</span><span id="L-952"><a href="#L-952"><span class="linenos"> 952</span></a><span class="sd"> """</span> +</span><span id="L-953"><a href="#L-953"><span class="linenos"> 953</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-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 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-957"><a href="#L-957"><span class="linenos"> 957</span></a> <span class="nd">@property</span> +</span><span id="L-958"><a href="#L-958"><span class="linenos"> 958</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-959"><a href="#L-959"><span class="linenos"> 959</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-960"><a href="#L-960"><span class="linenos"> 960</span></a> <span class="k">return</span> <span class="n">alias</span><span class="o">.</span><span class="n">columns</span> <span class="k">if</span> <span class="n">alias</span> <span class="k">else</span> <span class="p">[]</span> +</span><span id="L-961"><a href="#L-961"><span class="linenos"> 961</span></a> +</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 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-964"><a href="#L-964"><span class="linenos"> 964</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-965"><a href="#L-965"><span class="linenos"> 965</span></a> <span class="s2">"with"</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">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-967"><a href="#L-967"><span class="linenos"> 967</span></a> <span class="s2">"lazy"</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">"options"</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">"expression"</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">Uncache</span><span class="p">(</span><span class="n">Expression</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">"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-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 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-977"><a href="#L-977"><span class="linenos"> 977</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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 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-981"><a href="#L-981"><span class="linenos"> 981</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-982"><a href="#L-982"><span class="linenos"> 982</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-983"><a href="#L-983"><span class="linenos"> 983</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-984"><a href="#L-984"><span class="linenos"> 984</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-985"><a href="#L-985"><span class="linenos"> 985</span></a> <span class="s2">"expression"</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 class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-987"><a href="#L-987"><span class="linenos"> 987</span></a> <span class="s2">"properties"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-988"><a href="#L-988"><span class="linenos"> 988</span></a> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-989"><a href="#L-989"><span class="linenos"> 989</span></a> <span class="s2">"unique"</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 class="s2">"indexes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-991"><a href="#L-991"><span class="linenos"> 991</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-992"><a href="#L-992"><span class="linenos"> 992</span></a> <span class="s2">"begin"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-993"><a href="#L-993"><span class="linenos"> 993</span></a> <span class="s2">"clone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-994"><a href="#L-994"><span class="linenos"> 994</span></a> <span class="p">}</span> -</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="c1"># https://docs.snowflake.com/en/sql-reference/sql/create-clone</span> -</span><span id="L-998"><a href="#L-998"><span class="linenos"> 998</span></a><span class="k">class</span> <span class="nc">Clone</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-999"><a href="#L-999"><span class="linenos"> 999</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1000"><a href="#L-1000"><span class="linenos">1000</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1001"><a href="#L-1001"><span class="linenos">1001</span></a> <span class="s2">"when"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1002"><a href="#L-1002"><span class="linenos">1002</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1003"><a href="#L-1003"><span class="linenos">1003</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1004"><a href="#L-1004"><span class="linenos">1004</span></a> <span class="p">}</span> -</span><span id="L-1005"><a href="#L-1005"><span class="linenos">1005</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">Create</span><span class="p">(</span><span class="n">Expression</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><span id="L-979"><a href="#L-979"><span class="linenos"> 979</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-980"><a href="#L-980"><span class="linenos"> 980</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-981"><a href="#L-981"><span class="linenos"> 981</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-982"><a href="#L-982"><span class="linenos"> 982</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-983"><a href="#L-983"><span class="linenos"> 983</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-984"><a href="#L-984"><span class="linenos"> 984</span></a> <span class="s2">"properties"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-985"><a href="#L-985"><span class="linenos"> 985</span></a> <span class="s2">"replace"</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 class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-987"><a href="#L-987"><span class="linenos"> 987</span></a> <span class="s2">"indexes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-988"><a href="#L-988"><span class="linenos"> 988</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-989"><a href="#L-989"><span class="linenos"> 989</span></a> <span class="s2">"begin"</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 class="s2">"clone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-991"><a href="#L-991"><span class="linenos"> 991</span></a> <span class="p">}</span> +</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><span id="L-994"><a href="#L-994"><span class="linenos"> 994</span></a><span class="c1"># https://docs.snowflake.com/en/sql-reference/sql/create-clone</span> +</span><span id="L-995"><a href="#L-995"><span class="linenos"> 995</span></a><span class="k">class</span> <span class="nc">Clone</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-996"><a href="#L-996"><span class="linenos"> 996</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-997"><a href="#L-997"><span class="linenos"> 997</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-998"><a href="#L-998"><span class="linenos"> 998</span></a> <span class="s2">"when"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-999"><a href="#L-999"><span class="linenos"> 999</span></a> <span class="s2">"kind"</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="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1001"><a href="#L-1001"><span class="linenos">1001</span></a> <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 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-1005"><a href="#L-1005"><span class="linenos">1005</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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 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-1008"><a href="#L-1008"><span class="linenos">1008</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1009"><a href="#L-1009"><span class="linenos">1009</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">Pragma</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="k">pass</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 class="k">class</span> <span class="nc">Pragma</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1012"><a href="#L-1012"><span class="linenos">1012</span></a> <span class="k">pass</span> -</span><span id="L-1013"><a href="#L-1013"><span class="linenos">1013</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">Set</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">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"unset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"tag"</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 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-1016"><a href="#L-1016"><span class="linenos">1016</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">"unset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"tag"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1017"><a href="#L-1017"><span class="linenos">1017</span></a> -</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 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-1020"><a href="#L-1020"><span class="linenos">1020</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1021"><a href="#L-1021"><span class="linenos">1021</span></a> <span class="s2">"this"</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">"expressions"</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">"kind"</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="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-1025"><a href="#L-1025"><span class="linenos">1025</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1026"><a href="#L-1026"><span class="linenos">1026</span></a> <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">Show</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">"this"</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">"target"</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">"offset"</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">"limit"</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="s2">"like"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1036"><a href="#L-1036"><span class="linenos">1036</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1037"><a href="#L-1037"><span class="linenos">1037</span></a> <span class="s2">"db"</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 class="s2">"full"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1039"><a href="#L-1039"><span class="linenos">1039</span></a> <span class="s2">"mutex"</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 class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1041"><a href="#L-1041"><span class="linenos">1041</span></a> <span class="s2">"channel"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1042"><a href="#L-1042"><span class="linenos">1042</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1043"><a href="#L-1043"><span class="linenos">1043</span></a> <span class="s2">"log"</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">"position"</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">"types"</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-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">SetItem</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">"expressions"</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">"kind"</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">"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-1022"><a href="#L-1022"><span class="linenos">1022</span></a> <span class="s2">"global"</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="p">}</span> +</span><span id="L-1024"><a href="#L-1024"><span class="linenos">1024</span></a> +</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 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-1027"><a href="#L-1027"><span class="linenos">1027</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1028"><a href="#L-1028"><span class="linenos">1028</span></a> <span class="s2">"this"</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 class="s2">"target"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1030"><a href="#L-1030"><span class="linenos">1030</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1031"><a href="#L-1031"><span class="linenos">1031</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1032"><a href="#L-1032"><span class="linenos">1032</span></a> <span class="s2">"like"</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">"where"</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">"db"</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="s2">"full"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1036"><a href="#L-1036"><span class="linenos">1036</span></a> <span class="s2">"mutex"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1037"><a href="#L-1037"><span class="linenos">1037</span></a> <span class="s2">"query"</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 class="s2">"channel"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1039"><a href="#L-1039"><span class="linenos">1039</span></a> <span class="s2">"global"</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 class="s2">"log"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1041"><a href="#L-1041"><span class="linenos">1041</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1042"><a href="#L-1042"><span class="linenos">1042</span></a> <span class="s2">"types"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1043"><a href="#L-1043"><span class="linenos">1043</span></a> <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="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-1047"><a href="#L-1047"><span class="linenos">1047</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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">UserDefinedFunction</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">"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-1051"><a href="#L-1051"><span class="linenos">1051</span></a> +</span><span id="L-1049"><a href="#L-1049"><span class="linenos">1049</span></a> +</span><span id="L-1050"><a href="#L-1050"><span class="linenos">1050</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-1051"><a href="#L-1051"><span class="linenos">1051</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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">CharacterSet</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">"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-1055"><a href="#L-1055"><span class="linenos">1055</span></a> +</span><span id="L-1053"><a href="#L-1053"><span class="linenos">1053</span></a> +</span><span id="L-1054"><a href="#L-1054"><span class="linenos">1054</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-1055"><a href="#L-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 class="s2">"recursive"</span><span class="p">:</span> <span class="kc">False</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="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-1058"><a href="#L-1058"><span class="linenos">1058</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-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="nd">@property</span> -</span><span id="L-1061"><a href="#L-1061"><span class="linenos">1061</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-1062"><a href="#L-1062"><span class="linenos">1062</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-1063"><a href="#L-1063"><span class="linenos">1063</span></a> +</span><span id="L-1057"><a href="#L-1057"><span class="linenos">1057</span></a> <span class="nd">@property</span> +</span><span id="L-1058"><a href="#L-1058"><span class="linenos">1058</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-1059"><a href="#L-1059"><span class="linenos">1059</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-1060"><a href="#L-1060"><span class="linenos">1060</span></a> +</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 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-1063"><a href="#L-1063"><span class="linenos">1063</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1064"><a href="#L-1064"><span class="linenos">1064</span></a> -</span><span id="L-1065"><a href="#L-1065"><span class="linenos">1065</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-1066"><a href="#L-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">"expression"</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><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 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-1067"><a href="#L-1067"><span class="linenos">1067</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1068"><a href="#L-1068"><span class="linenos">1068</span></a> -</span><span id="L-1069"><a href="#L-1069"><span class="linenos">1069</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-1070"><a href="#L-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">"alias"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1071"><a href="#L-1071"><span class="linenos">1071</span></a> +</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 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-1071"><a href="#L-1071"><span class="linenos">1071</span></a> <span class="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-1072"><a href="#L-1072"><span class="linenos">1072</span></a> -</span><span id="L-1073"><a href="#L-1073"><span class="linenos">1073</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-1074"><a href="#L-1074"><span class="linenos">1074</span></a> <span class="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-1075"><a href="#L-1075"><span class="linenos">1075</span></a> -</span><span id="L-1076"><a href="#L-1076"><span class="linenos">1076</span></a> <span class="nd">@property</span> -</span><span id="L-1077"><a href="#L-1077"><span class="linenos">1077</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-1078"><a href="#L-1078"><span class="linenos">1078</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-1079"><a href="#L-1079"><span class="linenos">1079</span></a> +</span><span id="L-1073"><a href="#L-1073"><span class="linenos">1073</span></a> <span class="nd">@property</span> +</span><span id="L-1074"><a href="#L-1074"><span class="linenos">1074</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-1075"><a href="#L-1075"><span class="linenos">1075</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-1076"><a href="#L-1076"><span class="linenos">1076</span></a> +</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">class</span> <span class="nc">BitString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-1079"><a href="#L-1079"><span class="linenos">1079</span></a> <span class="k">pass</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="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-1082"><a href="#L-1082"><span class="linenos">1082</span></a> <span class="k">pass</span> -</span><span id="L-1083"><a href="#L-1083"><span class="linenos">1083</span></a> +</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="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-1083"><a href="#L-1083"><span class="linenos">1083</span></a> <span class="k">pass</span> </span><span id="L-1084"><a href="#L-1084"><span class="linenos">1084</span></a> -</span><span id="L-1085"><a href="#L-1085"><span class="linenos">1085</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-1086"><a href="#L-1086"><span class="linenos">1086</span></a> <span class="k">pass</span> -</span><span id="L-1087"><a href="#L-1087"><span class="linenos">1087</span></a> +</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">ByteString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-1087"><a href="#L-1087"><span class="linenos">1087</span></a> <span class="k">pass</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">class</span> <span class="nc">ByteString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-1090"><a href="#L-1090"><span class="linenos">1090</span></a> <span class="k">pass</span> -</span><span id="L-1091"><a href="#L-1091"><span class="linenos">1091</span></a> +</span><span id="L-1089"><a href="#L-1089"><span class="linenos">1089</span></a> +</span><span id="L-1090"><a href="#L-1090"><span class="linenos">1090</span></a><span class="k">class</span> <span class="nc">RawString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-1091"><a href="#L-1091"><span class="linenos">1091</span></a> <span class="k">pass</span> </span><span id="L-1092"><a href="#L-1092"><span class="linenos">1092</span></a> -</span><span id="L-1093"><a href="#L-1093"><span class="linenos">1093</span></a><span class="k">class</span> <span class="nc">RawString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-1094"><a href="#L-1094"><span class="linenos">1094</span></a> <span class="k">pass</span> -</span><span id="L-1095"><a href="#L-1095"><span class="linenos">1095</span></a> +</span><span id="L-1093"><a href="#L-1093"><span class="linenos">1093</span></a> +</span><span id="L-1094"><a href="#L-1094"><span class="linenos">1094</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-1095"><a href="#L-1095"><span class="linenos">1095</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"join_mark"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </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 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-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 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 class="s2">"join_mark"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1099"><a href="#L-1099"><span class="linenos">1099</span></a> -</span><span id="L-1100"><a href="#L-1100"><span class="linenos">1100</span></a> <span class="nd">@property</span> -</span><span id="L-1101"><a href="#L-1101"><span class="linenos">1101</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-1102"><a href="#L-1102"><span class="linenos">1102</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-1103"><a href="#L-1103"><span class="linenos">1103</span></a> -</span><span id="L-1104"><a href="#L-1104"><span class="linenos">1104</span></a> <span class="nd">@property</span> -</span><span id="L-1105"><a href="#L-1105"><span class="linenos">1105</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-1106"><a href="#L-1106"><span class="linenos">1106</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-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 class="nd">@property</span> -</span><span id="L-1109"><a href="#L-1109"><span class="linenos">1109</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-1110"><a href="#L-1110"><span class="linenos">1110</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-1111"><a href="#L-1111"><span class="linenos">1111</span></a> -</span><span id="L-1112"><a href="#L-1112"><span class="linenos">1112</span></a> <span class="nd">@property</span> -</span><span id="L-1113"><a href="#L-1113"><span class="linenos">1113</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-1114"><a href="#L-1114"><span class="linenos">1114</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-1115"><a href="#L-1115"><span class="linenos">1115</span></a> -</span><span id="L-1116"><a href="#L-1116"><span class="linenos">1116</span></a> <span class="nd">@property</span> -</span><span id="L-1117"><a href="#L-1117"><span class="linenos">1117</span></a> <span class="k">def</span> <span class="nf">parts</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">Identifier</span><span class="p">]:</span> -</span><span id="L-1118"><a href="#L-1118"><span class="linenos">1118</span></a><span class="w"> </span><span class="sd">"""Return the parts of a column in order catalog, db, table, name."""</span> -</span><span id="L-1119"><a href="#L-1119"><span class="linenos">1119</span></a> <span class="k">return</span> <span class="p">[</span> -</span><span id="L-1120"><a href="#L-1120"><span class="linenos">1120</span></a> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Identifier</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="n">part</span><span class="p">])</span> -</span><span id="L-1121"><a href="#L-1121"><span class="linenos">1121</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"catalog"</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">,</span> <span class="s2">"table"</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="L-1122"><a href="#L-1122"><span class="linenos">1122</span></a> <span class="k">if</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">part</span><span class="p">)</span> -</span><span id="L-1123"><a href="#L-1123"><span class="linenos">1123</span></a> <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 class="k">def</span> <span class="nf">to_dot</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Dot</span><span class="p">:</span> -</span><span id="L-1126"><a href="#L-1126"><span class="linenos">1126</span></a><span class="w"> </span><span class="sd">"""Converts the column into a dot expression."""</span> -</span><span id="L-1127"><a href="#L-1127"><span class="linenos">1127</span></a> <span class="n">parts</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parts</span> -</span><span id="L-1128"><a href="#L-1128"><span class="linenos">1128</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-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 class="k">while</span> <span class="n">parent</span><span class="p">:</span> -</span><span id="L-1131"><a href="#L-1131"><span class="linenos">1131</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="n">Dot</span><span class="p">):</span> -</span><span id="L-1132"><a href="#L-1132"><span class="linenos">1132</span></a> <span class="n">parts</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">parent</span><span class="o">.</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">parent</span> <span class="o">=</span> <span class="n">parent</span><span class="o">.</span><span class="n">parent</span> +</span><span id="L-1097"><a href="#L-1097"><span class="linenos">1097</span></a> <span class="nd">@property</span> +</span><span id="L-1098"><a href="#L-1098"><span class="linenos">1098</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-1099"><a href="#L-1099"><span class="linenos">1099</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-1100"><a href="#L-1100"><span class="linenos">1100</span></a> +</span><span id="L-1101"><a href="#L-1101"><span class="linenos">1101</span></a> <span class="nd">@property</span> +</span><span id="L-1102"><a href="#L-1102"><span class="linenos">1102</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-1103"><a href="#L-1103"><span class="linenos">1103</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-1104"><a href="#L-1104"><span class="linenos">1104</span></a> +</span><span id="L-1105"><a href="#L-1105"><span class="linenos">1105</span></a> <span class="nd">@property</span> +</span><span id="L-1106"><a href="#L-1106"><span class="linenos">1106</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-1107"><a href="#L-1107"><span class="linenos">1107</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-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 class="nd">@property</span> +</span><span id="L-1110"><a href="#L-1110"><span class="linenos">1110</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-1111"><a href="#L-1111"><span class="linenos">1111</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-1112"><a href="#L-1112"><span class="linenos">1112</span></a> +</span><span id="L-1113"><a href="#L-1113"><span class="linenos">1113</span></a> <span class="nd">@property</span> +</span><span id="L-1114"><a href="#L-1114"><span class="linenos">1114</span></a> <span class="k">def</span> <span class="nf">parts</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">Identifier</span><span class="p">]:</span> +</span><span id="L-1115"><a href="#L-1115"><span class="linenos">1115</span></a><span class="w"> </span><span class="sd">"""Return the parts of a column in order catalog, db, table, name."""</span> +</span><span id="L-1116"><a href="#L-1116"><span class="linenos">1116</span></a> <span class="k">return</span> <span class="p">[</span> +</span><span id="L-1117"><a href="#L-1117"><span class="linenos">1117</span></a> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Identifier</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="n">part</span><span class="p">])</span> +</span><span id="L-1118"><a href="#L-1118"><span class="linenos">1118</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"catalog"</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">,</span> <span class="s2">"table"</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="L-1119"><a href="#L-1119"><span class="linenos">1119</span></a> <span class="k">if</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">part</span><span class="p">)</span> +</span><span id="L-1120"><a href="#L-1120"><span class="linenos">1120</span></a> <span class="p">]</span> +</span><span id="L-1121"><a href="#L-1121"><span class="linenos">1121</span></a> +</span><span id="L-1122"><a href="#L-1122"><span class="linenos">1122</span></a> <span class="k">def</span> <span class="nf">to_dot</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Dot</span><span class="p">:</span> +</span><span id="L-1123"><a href="#L-1123"><span class="linenos">1123</span></a><span class="w"> </span><span class="sd">"""Converts the column into a dot expression."""</span> +</span><span id="L-1124"><a href="#L-1124"><span class="linenos">1124</span></a> <span class="n">parts</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parts</span> +</span><span id="L-1125"><a href="#L-1125"><span class="linenos">1125</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-1126"><a href="#L-1126"><span class="linenos">1126</span></a> +</span><span id="L-1127"><a href="#L-1127"><span class="linenos">1127</span></a> <span class="k">while</span> <span class="n">parent</span><span class="p">:</span> +</span><span id="L-1128"><a href="#L-1128"><span class="linenos">1128</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="n">Dot</span><span class="p">):</span> +</span><span id="L-1129"><a href="#L-1129"><span class="linenos">1129</span></a> <span class="n">parts</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">parent</span><span class="o">.</span><span class="n">expression</span><span class="p">)</span> +</span><span id="L-1130"><a href="#L-1130"><span class="linenos">1130</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span><span class="o">.</span><span class="n">parent</span> +</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">return</span> <span class="n">Dot</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">parts</span><span class="p">)</span> +</span><span id="L-1133"><a href="#L-1133"><span class="linenos">1133</span></a> </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 class="k">return</span> <span class="n">Dot</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">parts</span><span class="p">)</span> -</span><span id="L-1136"><a href="#L-1136"><span class="linenos">1136</span></a> +</span><span id="L-1135"><a href="#L-1135"><span class="linenos">1135</span></a><span class="k">class</span> <span class="nc">ColumnPosition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1136"><a href="#L-1136"><span class="linenos">1136</span></a> <span class="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">"position"</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><span id="L-1138"><a href="#L-1138"><span class="linenos">1138</span></a><span class="k">class</span> <span class="nc">ColumnPosition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1139"><a href="#L-1139"><span class="linenos">1139</span></a> <span class="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">"position"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1140"><a href="#L-1140"><span class="linenos">1140</span></a> -</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 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-1143"><a href="#L-1143"><span class="linenos">1143</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1144"><a href="#L-1144"><span class="linenos">1144</span></a> <span class="s2">"this"</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 class="s2">"kind"</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="s2">"constraints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1147"><a href="#L-1147"><span class="linenos">1147</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1148"><a href="#L-1148"><span class="linenos">1148</span></a> <span class="s2">"position"</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 class="p">}</span> -</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="nd">@property</span> -</span><span id="L-1152"><a href="#L-1152"><span class="linenos">1152</span></a> <span class="k">def</span> <span class="nf">constraints</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">ColumnConstraint</span><span class="p">]:</span> -</span><span id="L-1153"><a href="#L-1153"><span class="linenos">1153</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">"constraints"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> -</span><span id="L-1154"><a href="#L-1154"><span class="linenos">1154</span></a> -</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 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-1157"><a href="#L-1157"><span class="linenos">1157</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1158"><a href="#L-1158"><span class="linenos">1158</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1159"><a href="#L-1159"><span class="linenos">1159</span></a> <span class="s2">"dtype"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1160"><a href="#L-1160"><span class="linenos">1160</span></a> <span class="s2">"collate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1161"><a href="#L-1161"><span class="linenos">1161</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1162"><a href="#L-1162"><span class="linenos">1162</span></a> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1163"><a href="#L-1163"><span class="linenos">1163</span></a> <span class="s2">"drop"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1164"><a href="#L-1164"><span class="linenos">1164</span></a> <span class="p">}</span> -</span><span id="L-1165"><a href="#L-1165"><span class="linenos">1165</span></a> +</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 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-1140"><a href="#L-1140"><span class="linenos">1140</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1141"><a href="#L-1141"><span class="linenos">1141</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1142"><a href="#L-1142"><span class="linenos">1142</span></a> <span class="s2">"kind"</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">"constraints"</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">"exists"</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">"position"</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 class="nd">@property</span> +</span><span id="L-1149"><a href="#L-1149"><span class="linenos">1149</span></a> <span class="k">def</span> <span class="nf">constraints</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">ColumnConstraint</span><span class="p">]:</span> +</span><span id="L-1150"><a href="#L-1150"><span class="linenos">1150</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">"constraints"</span><span class="p">)</span> <span class="ow">or</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">AlterColumn</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><span id="L-1155"><a href="#L-1155"><span class="linenos">1155</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1156"><a href="#L-1156"><span class="linenos">1156</span></a> <span class="s2">"dtype"</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="s2">"collate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1158"><a href="#L-1158"><span class="linenos">1158</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1159"><a href="#L-1159"><span class="linenos">1159</span></a> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1160"><a href="#L-1160"><span class="linenos">1160</span></a> <span class="s2">"drop"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1161"><a href="#L-1161"><span class="linenos">1161</span></a> <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">RenameTable</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="k">pass</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">class</span> <span class="nc">RenameTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1168"><a href="#L-1168"><span class="linenos">1168</span></a> <span class="k">pass</span> -</span><span id="L-1169"><a href="#L-1169"><span class="linenos">1169</span></a> +</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">Comment</span><span class="p">(</span><span class="n">Expression</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">"kind"</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">"exists"</span><span class="p">:</span> <span class="kc">False</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">class</span> <span class="nc">Comment</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1172"><a href="#L-1172"><span class="linenos">1172</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">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">"exists"</span><span class="p">:</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><span id="L-1175"><a href="#L-1175"><span class="linenos">1175</span></a><span class="c1"># https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#mergetree-table-ttl</span> -</span><span id="L-1176"><a href="#L-1176"><span class="linenos">1176</span></a><span class="k">class</span> <span class="nc">MergeTreeTTLAction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1177"><a href="#L-1177"><span class="linenos">1177</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1178"><a href="#L-1178"><span class="linenos">1178</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1179"><a href="#L-1179"><span class="linenos">1179</span></a> <span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1180"><a href="#L-1180"><span class="linenos">1180</span></a> <span class="s2">"recompress"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1181"><a href="#L-1181"><span class="linenos">1181</span></a> <span class="s2">"to_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1182"><a href="#L-1182"><span class="linenos">1182</span></a> <span class="s2">"to_volume"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1183"><a href="#L-1183"><span class="linenos">1183</span></a> <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><span id="L-1186"><a href="#L-1186"><span class="linenos">1186</span></a><span class="c1"># https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#mergetree-table-ttl</span> -</span><span id="L-1187"><a href="#L-1187"><span class="linenos">1187</span></a><span class="k">class</span> <span class="nc">MergeTreeTTL</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1188"><a href="#L-1188"><span class="linenos">1188</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1189"><a href="#L-1189"><span class="linenos">1189</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1190"><a href="#L-1190"><span class="linenos">1190</span></a> <span class="s2">"where"</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="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1192"><a href="#L-1192"><span class="linenos">1192</span></a> <span class="s2">"aggregates"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1193"><a href="#L-1193"><span class="linenos">1193</span></a> <span class="p">}</span> -</span><span id="L-1194"><a href="#L-1194"><span class="linenos">1194</span></a> +</span><span id="L-1171"><a href="#L-1171"><span class="linenos">1171</span></a> +</span><span id="L-1172"><a href="#L-1172"><span class="linenos">1172</span></a><span class="c1"># https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#mergetree-table-ttl</span> +</span><span id="L-1173"><a href="#L-1173"><span class="linenos">1173</span></a><span class="k">class</span> <span class="nc">MergeTreeTTLAction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1174"><a href="#L-1174"><span class="linenos">1174</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1175"><a href="#L-1175"><span class="linenos">1175</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1176"><a href="#L-1176"><span class="linenos">1176</span></a> <span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1177"><a href="#L-1177"><span class="linenos">1177</span></a> <span class="s2">"recompress"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1178"><a href="#L-1178"><span class="linenos">1178</span></a> <span class="s2">"to_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1179"><a href="#L-1179"><span class="linenos">1179</span></a> <span class="s2">"to_volume"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1180"><a href="#L-1180"><span class="linenos">1180</span></a> <span class="p">}</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="c1"># https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#mergetree-table-ttl</span> +</span><span id="L-1184"><a href="#L-1184"><span class="linenos">1184</span></a><span class="k">class</span> <span class="nc">MergeTreeTTL</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1185"><a href="#L-1185"><span class="linenos">1185</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1186"><a href="#L-1186"><span class="linenos">1186</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1187"><a href="#L-1187"><span class="linenos">1187</span></a> <span class="s2">"where"</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">"group"</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">"aggregates"</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="p">}</span> +</span><span id="L-1191"><a href="#L-1191"><span class="linenos">1191</span></a> +</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="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-1194"><a href="#L-1194"><span class="linenos">1194</span></a> <span class="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-1195"><a href="#L-1195"><span class="linenos">1195</span></a> -</span><span id="L-1196"><a href="#L-1196"><span class="linenos">1196</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-1197"><a href="#L-1197"><span class="linenos">1197</span></a> <span class="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-1198"><a href="#L-1198"><span class="linenos">1198</span></a> -</span><span id="L-1199"><a href="#L-1199"><span class="linenos">1199</span></a> <span class="nd">@property</span> -</span><span id="L-1200"><a href="#L-1200"><span class="linenos">1200</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 class="o">-></span> <span class="n">ColumnConstraintKind</span><span class="p">:</span> -</span><span id="L-1201"><a href="#L-1201"><span class="linenos">1201</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">"kind"</span><span class="p">]</span> -</span><span id="L-1202"><a href="#L-1202"><span class="linenos">1202</span></a> +</span><span id="L-1196"><a href="#L-1196"><span class="linenos">1196</span></a> <span class="nd">@property</span> +</span><span id="L-1197"><a href="#L-1197"><span class="linenos">1197</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 class="o">-></span> <span class="n">ColumnConstraintKind</span><span class="p">:</span> +</span><span id="L-1198"><a href="#L-1198"><span class="linenos">1198</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">"kind"</span><span class="p">]</span> +</span><span id="L-1199"><a href="#L-1199"><span class="linenos">1199</span></a> +</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="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-1202"><a href="#L-1202"><span class="linenos">1202</span></a> <span class="k">pass</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="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-1205"><a href="#L-1205"><span class="linenos">1205</span></a> <span class="k">pass</span> -</span><span id="L-1206"><a href="#L-1206"><span class="linenos">1206</span></a> +</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">class</span> <span class="nc">AutoIncrementColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-1206"><a href="#L-1206"><span class="linenos">1206</span></a> <span class="k">pass</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="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-1209"><a href="#L-1209"><span class="linenos">1209</span></a> <span class="k">pass</span> -</span><span id="L-1210"><a href="#L-1210"><span class="linenos">1210</span></a> +</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="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-1210"><a href="#L-1210"><span class="linenos">1210</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-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="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-1213"><a href="#L-1213"><span class="linenos">1213</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-1214"><a href="#L-1214"><span class="linenos">1214</span></a> +</span><span id="L-1212"><a href="#L-1212"><span class="linenos">1212</span></a> +</span><span id="L-1213"><a href="#L-1213"><span class="linenos">1213</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-1214"><a href="#L-1214"><span class="linenos">1214</span></a> <span class="n">arg_types</span> <span class="o">=</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-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">class</span> <span class="nc">CharacterSetColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-1217"><a href="#L-1217"><span class="linenos">1217</span></a> <span class="n">arg_types</span> <span class="o">=</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-1218"><a href="#L-1218"><span class="linenos">1218</span></a> +</span><span id="L-1216"><a href="#L-1216"><span class="linenos">1216</span></a> +</span><span id="L-1217"><a href="#L-1217"><span class="linenos">1217</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-1218"><a href="#L-1218"><span class="linenos">1218</span></a> <span class="k">pass</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="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-1221"><a href="#L-1221"><span class="linenos">1221</span></a> <span class="k">pass</span> -</span><span id="L-1222"><a href="#L-1222"><span class="linenos">1222</span></a> +</span><span id="L-1220"><a href="#L-1220"><span class="linenos">1220</span></a> +</span><span id="L-1221"><a href="#L-1221"><span class="linenos">1221</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-1222"><a href="#L-1222"><span class="linenos">1222</span></a> <span class="k">pass</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="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-1225"><a href="#L-1225"><span class="linenos">1225</span></a> <span class="k">pass</span> -</span><span id="L-1226"><a href="#L-1226"><span class="linenos">1226</span></a> +</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="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-1226"><a href="#L-1226"><span class="linenos">1226</span></a> <span class="k">pass</span> </span><span id="L-1227"><a href="#L-1227"><span class="linenos">1227</span></a> -</span><span id="L-1228"><a href="#L-1228"><span class="linenos">1228</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-1229"><a href="#L-1229"><span class="linenos">1229</span></a> <span class="k">pass</span> -</span><span id="L-1230"><a href="#L-1230"><span class="linenos">1230</span></a> +</span><span id="L-1228"><a href="#L-1228"><span class="linenos">1228</span></a> +</span><span id="L-1229"><a href="#L-1229"><span class="linenos">1229</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-1230"><a href="#L-1230"><span class="linenos">1230</span></a> <span class="k">pass</span> </span><span id="L-1231"><a href="#L-1231"><span class="linenos">1231</span></a> -</span><span id="L-1232"><a href="#L-1232"><span class="linenos">1232</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-1233"><a href="#L-1233"><span class="linenos">1233</span></a> <span class="k">pass</span> -</span><span id="L-1234"><a href="#L-1234"><span class="linenos">1234</span></a> +</span><span id="L-1232"><a href="#L-1232"><span class="linenos">1232</span></a> +</span><span id="L-1233"><a href="#L-1233"><span class="linenos">1233</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-1234"><a href="#L-1234"><span class="linenos">1234</span></a> <span class="n">arg_types</span> <span class="o">=</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-1235"><a href="#L-1235"><span class="linenos">1235</span></a> -</span><span id="L-1236"><a href="#L-1236"><span class="linenos">1236</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-1237"><a href="#L-1237"><span class="linenos">1237</span></a> <span class="n">arg_types</span> <span class="o">=</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-1238"><a href="#L-1238"><span class="linenos">1238</span></a> +</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">class</span> <span class="nc">DefaultColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-1238"><a href="#L-1238"><span class="linenos">1238</span></a> <span class="k">pass</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">class</span> <span class="nc">DefaultColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-1241"><a href="#L-1241"><span class="linenos">1241</span></a> <span class="k">pass</span> -</span><span id="L-1242"><a href="#L-1242"><span class="linenos">1242</span></a> +</span><span id="L-1240"><a href="#L-1240"><span class="linenos">1240</span></a> +</span><span id="L-1241"><a href="#L-1241"><span class="linenos">1241</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-1242"><a href="#L-1242"><span class="linenos">1242</span></a> <span class="k">pass</span> </span><span id="L-1243"><a href="#L-1243"><span class="linenos">1243</span></a> -</span><span id="L-1244"><a href="#L-1244"><span class="linenos">1244</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-1245"><a href="#L-1245"><span class="linenos">1245</span></a> <span class="k">pass</span> -</span><span id="L-1246"><a href="#L-1246"><span class="linenos">1246</span></a> -</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">class</span> <span class="nc">GeneratedAsIdentityColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-1249"><a href="#L-1249"><span class="linenos">1249</span></a> <span class="c1"># this: True -> ALWAYS, this: False -> BY DEFAULT</span> -</span><span id="L-1250"><a href="#L-1250"><span class="linenos">1250</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1251"><a href="#L-1251"><span class="linenos">1251</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1252"><a href="#L-1252"><span class="linenos">1252</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1253"><a href="#L-1253"><span class="linenos">1253</span></a> <span class="s2">"on_null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1254"><a href="#L-1254"><span class="linenos">1254</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1255"><a href="#L-1255"><span class="linenos">1255</span></a> <span class="s2">"increment"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1256"><a href="#L-1256"><span class="linenos">1256</span></a> <span class="s2">"minvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1257"><a href="#L-1257"><span class="linenos">1257</span></a> <span class="s2">"maxvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1258"><a href="#L-1258"><span class="linenos">1258</span></a> <span class="s2">"cycle"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1259"><a href="#L-1259"><span class="linenos">1259</span></a> <span class="p">}</span> -</span><span id="L-1260"><a href="#L-1260"><span class="linenos">1260</span></a> +</span><span id="L-1244"><a href="#L-1244"><span class="linenos">1244</span></a> +</span><span id="L-1245"><a href="#L-1245"><span class="linenos">1245</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-1246"><a href="#L-1246"><span class="linenos">1246</span></a> <span class="c1"># this: True -> ALWAYS, this: False -> BY DEFAULT</span> +</span><span id="L-1247"><a href="#L-1247"><span class="linenos">1247</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1248"><a href="#L-1248"><span class="linenos">1248</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1249"><a href="#L-1249"><span class="linenos">1249</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1250"><a href="#L-1250"><span class="linenos">1250</span></a> <span class="s2">"on_null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1251"><a href="#L-1251"><span class="linenos">1251</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1252"><a href="#L-1252"><span class="linenos">1252</span></a> <span class="s2">"increment"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1253"><a href="#L-1253"><span class="linenos">1253</span></a> <span class="s2">"minvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1254"><a href="#L-1254"><span class="linenos">1254</span></a> <span class="s2">"maxvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1255"><a href="#L-1255"><span class="linenos">1255</span></a> <span class="s2">"cycle"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1256"><a href="#L-1256"><span class="linenos">1256</span></a> <span class="p">}</span> +</span><span id="L-1257"><a href="#L-1257"><span class="linenos">1257</span></a> +</span><span id="L-1258"><a href="#L-1258"><span class="linenos">1258</span></a> +</span><span id="L-1259"><a href="#L-1259"><span class="linenos">1259</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-1260"><a href="#L-1260"><span class="linenos">1260</span></a> <span class="k">pass</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="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-1263"><a href="#L-1263"><span class="linenos">1263</span></a> <span class="k">pass</span> -</span><span id="L-1264"><a href="#L-1264"><span class="linenos">1264</span></a> +</span><span id="L-1262"><a href="#L-1262"><span class="linenos">1262</span></a> +</span><span id="L-1263"><a href="#L-1263"><span class="linenos">1263</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-1264"><a href="#L-1264"><span class="linenos">1264</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-1265"><a href="#L-1265"><span class="linenos">1265</span></a> -</span><span id="L-1266"><a href="#L-1266"><span class="linenos">1266</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-1267"><a href="#L-1267"><span class="linenos">1267</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-1268"><a href="#L-1268"><span class="linenos">1268</span></a> -</span><span id="L-1269"><a href="#L-1269"><span class="linenos">1269</span></a> -</span><span id="L-1270"><a href="#L-1270"><span class="linenos">1270</span></a><span class="c1"># https://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html</span> -</span><span id="L-1271"><a href="#L-1271"><span class="linenos">1271</span></a><span class="k">class</span> <span class="nc">OnUpdateColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-1272"><a href="#L-1272"><span class="linenos">1272</span></a> <span class="k">pass</span> -</span><span id="L-1273"><a href="#L-1273"><span class="linenos">1273</span></a> +</span><span id="L-1266"><a href="#L-1266"><span class="linenos">1266</span></a> +</span><span id="L-1267"><a href="#L-1267"><span class="linenos">1267</span></a><span class="c1"># https://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html</span> +</span><span id="L-1268"><a href="#L-1268"><span class="linenos">1268</span></a><span class="k">class</span> <span class="nc">OnUpdateColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-1269"><a href="#L-1269"><span class="linenos">1269</span></a> <span class="k">pass</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><span id="L-1272"><a href="#L-1272"><span class="linenos">1272</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-1273"><a href="#L-1273"><span class="linenos">1273</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-1274"><a href="#L-1274"><span class="linenos">1274</span></a> -</span><span id="L-1275"><a href="#L-1275"><span class="linenos">1275</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-1276"><a href="#L-1276"><span class="linenos">1276</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-1277"><a href="#L-1277"><span class="linenos">1277</span></a> +</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">class</span> <span class="nc">TitleColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-1277"><a href="#L-1277"><span class="linenos">1277</span></a> <span class="k">pass</span> </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">TitleColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-1280"><a href="#L-1280"><span class="linenos">1280</span></a> <span class="k">pass</span> -</span><span id="L-1281"><a href="#L-1281"><span class="linenos">1281</span></a> +</span><span id="L-1279"><a href="#L-1279"><span class="linenos">1279</span></a> +</span><span id="L-1280"><a href="#L-1280"><span class="linenos">1280</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-1281"><a href="#L-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">False</span><span class="p">}</span> </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">UniqueColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</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 class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1285"><a href="#L-1285"><span class="linenos">1285</span></a> +</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">class</span> <span class="nc">UppercaseColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-1285"><a href="#L-1285"><span class="linenos">1285</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-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">class</span> <span class="nc">UppercaseColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-1288"><a href="#L-1288"><span class="linenos">1288</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-1289"><a href="#L-1289"><span class="linenos">1289</span></a> +</span><span id="L-1287"><a href="#L-1287"><span class="linenos">1287</span></a> +</span><span id="L-1288"><a href="#L-1288"><span class="linenos">1288</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-1289"><a href="#L-1289"><span class="linenos">1289</span></a> <span class="k">pass</span> </span><span id="L-1290"><a href="#L-1290"><span class="linenos">1290</span></a> -</span><span id="L-1291"><a href="#L-1291"><span class="linenos">1291</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-1292"><a href="#L-1292"><span class="linenos">1292</span></a> <span class="k">pass</span> -</span><span id="L-1293"><a href="#L-1293"><span class="linenos">1293</span></a> +</span><span id="L-1291"><a href="#L-1291"><span class="linenos">1291</span></a> +</span><span id="L-1292"><a href="#L-1292"><span class="linenos">1292</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-1293"><a href="#L-1293"><span class="linenos">1293</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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="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-1296"><a href="#L-1296"><span class="linenos">1296</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1297"><a href="#L-1297"><span class="linenos">1297</span></a> -</span><span id="L-1298"><a href="#L-1298"><span class="linenos">1298</span></a> -</span><span id="L-1299"><a href="#L-1299"><span class="linenos">1299</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-1300"><a href="#L-1300"><span class="linenos">1300</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1301"><a href="#L-1301"><span class="linenos">1301</span></a> <span class="s2">"with"</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">"this"</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="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1304"><a href="#L-1304"><span class="linenos">1304</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1305"><a href="#L-1305"><span class="linenos">1305</span></a> <span class="s2">"returning"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1306"><a href="#L-1306"><span class="linenos">1306</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1307"><a href="#L-1307"><span class="linenos">1307</span></a> <span class="p">}</span> -</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="k">def</span> <span class="nf">delete</span><span class="p">(</span> -</span><span id="L-1310"><a href="#L-1310"><span class="linenos">1310</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-1311"><a href="#L-1311"><span class="linenos">1311</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-1312"><a href="#L-1312"><span class="linenos">1312</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-1313"><a href="#L-1313"><span class="linenos">1313</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-1314"><a href="#L-1314"><span class="linenos">1314</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1315"><a href="#L-1315"><span class="linenos">1315</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="L-1316"><a href="#L-1316"><span class="linenos">1316</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1317"><a href="#L-1317"><span class="linenos">1317</span></a><span class="sd"> Create a DELETE expression or replace the table on an existing DELETE expression.</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="sd"> Example:</span> -</span><span id="L-1320"><a href="#L-1320"><span class="linenos">1320</span></a><span class="sd"> >>> delete("tbl").sql()</span> -</span><span id="L-1321"><a href="#L-1321"><span class="linenos">1321</span></a><span class="sd"> 'DELETE FROM tbl'</span> -</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="sd"> Args:</span> -</span><span id="L-1324"><a href="#L-1324"><span class="linenos">1324</span></a><span class="sd"> table: the table from which to delete.</span> -</span><span id="L-1325"><a href="#L-1325"><span class="linenos">1325</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-1326"><a href="#L-1326"><span class="linenos">1326</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-1327"><a href="#L-1327"><span class="linenos">1327</span></a><span class="sd"> opts: other options to use to parse the input expressions.</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 class="sd"> Returns:</span> -</span><span id="L-1330"><a href="#L-1330"><span class="linenos">1330</span></a><span class="sd"> Delete: the modified expression.</span> -</span><span id="L-1331"><a href="#L-1331"><span class="linenos">1331</span></a><span class="sd"> """</span> -</span><span id="L-1332"><a href="#L-1332"><span class="linenos">1332</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="L-1333"><a href="#L-1333"><span class="linenos">1333</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">table</span><span class="p">,</span> -</span><span id="L-1334"><a href="#L-1334"><span class="linenos">1334</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-1335"><a href="#L-1335"><span class="linenos">1335</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"this"</span><span class="p">,</span> -</span><span id="L-1336"><a href="#L-1336"><span class="linenos">1336</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1337"><a href="#L-1337"><span class="linenos">1337</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> -</span><span id="L-1338"><a href="#L-1338"><span class="linenos">1338</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-1339"><a href="#L-1339"><span class="linenos">1339</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1340"><a href="#L-1340"><span class="linenos">1340</span></a> <span class="p">)</span> -</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 class="k">def</span> <span class="nf">where</span><span class="p">(</span> -</span><span id="L-1343"><a href="#L-1343"><span class="linenos">1343</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-1344"><a href="#L-1344"><span class="linenos">1344</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-1345"><a href="#L-1345"><span class="linenos">1345</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-1346"><a href="#L-1346"><span class="linenos">1346</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-1347"><a href="#L-1347"><span class="linenos">1347</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-1348"><a href="#L-1348"><span class="linenos">1348</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1349"><a href="#L-1349"><span class="linenos">1349</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="L-1350"><a href="#L-1350"><span class="linenos">1350</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1351"><a href="#L-1351"><span class="linenos">1351</span></a><span class="sd"> Append to or set the WHERE expressions.</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 class="sd"> Example:</span> -</span><span id="L-1354"><a href="#L-1354"><span class="linenos">1354</span></a><span class="sd"> >>> delete("tbl").where("x = 'a' OR x < 'b'").sql()</span> -</span><span id="L-1355"><a href="#L-1355"><span class="linenos">1355</span></a><span class="sd"> "DELETE FROM tbl WHERE x = 'a' OR x < 'b'"</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 class="sd"> Args:</span> -</span><span id="L-1358"><a href="#L-1358"><span class="linenos">1358</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-1359"><a href="#L-1359"><span class="linenos">1359</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-1360"><a href="#L-1360"><span class="linenos">1360</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="L-1361"><a href="#L-1361"><span class="linenos">1361</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> -</span><span id="L-1362"><a href="#L-1362"><span class="linenos">1362</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="L-1363"><a href="#L-1363"><span class="linenos">1363</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-1364"><a href="#L-1364"><span class="linenos">1364</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-1365"><a href="#L-1365"><span class="linenos">1365</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</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="sd"> Returns:</span> -</span><span id="L-1368"><a href="#L-1368"><span class="linenos">1368</span></a><span class="sd"> Delete: the modified expression.</span> -</span><span id="L-1369"><a href="#L-1369"><span class="linenos">1369</span></a><span class="sd"> """</span> -</span><span id="L-1370"><a href="#L-1370"><span class="linenos">1370</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="L-1371"><a href="#L-1371"><span class="linenos">1371</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-1372"><a href="#L-1372"><span class="linenos">1372</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-1373"><a href="#L-1373"><span class="linenos">1373</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> -</span><span id="L-1374"><a href="#L-1374"><span class="linenos">1374</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-1375"><a href="#L-1375"><span class="linenos">1375</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> -</span><span id="L-1376"><a href="#L-1376"><span class="linenos">1376</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1377"><a href="#L-1377"><span class="linenos">1377</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-1378"><a href="#L-1378"><span class="linenos">1378</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1379"><a href="#L-1379"><span class="linenos">1379</span></a> <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 class="k">def</span> <span class="nf">returning</span><span class="p">(</span> -</span><span id="L-1382"><a href="#L-1382"><span class="linenos">1382</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-1383"><a href="#L-1383"><span class="linenos">1383</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-1384"><a href="#L-1384"><span class="linenos">1384</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-1385"><a href="#L-1385"><span class="linenos">1385</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-1386"><a href="#L-1386"><span class="linenos">1386</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1387"><a href="#L-1387"><span class="linenos">1387</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="L-1388"><a href="#L-1388"><span class="linenos">1388</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1389"><a href="#L-1389"><span class="linenos">1389</span></a><span class="sd"> Set the RETURNING expression. Not supported by all dialects.</span> -</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="sd"> Example:</span> -</span><span id="L-1392"><a href="#L-1392"><span class="linenos">1392</span></a><span class="sd"> >>> delete("tbl").returning("*", dialect="postgres").sql()</span> -</span><span id="L-1393"><a href="#L-1393"><span class="linenos">1393</span></a><span class="sd"> 'DELETE FROM tbl RETURNING *'</span> -</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="sd"> Args:</span> -</span><span id="L-1396"><a href="#L-1396"><span class="linenos">1396</span></a><span class="sd"> expression: the SQL code strings to parse.</span> -</span><span id="L-1397"><a href="#L-1397"><span class="linenos">1397</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-1398"><a href="#L-1398"><span class="linenos">1398</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-1399"><a href="#L-1399"><span class="linenos">1399</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-1400"><a href="#L-1400"><span class="linenos">1400</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</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 class="sd"> Returns:</span> -</span><span id="L-1403"><a href="#L-1403"><span class="linenos">1403</span></a><span class="sd"> Delete: the modified expression.</span> -</span><span id="L-1404"><a href="#L-1404"><span class="linenos">1404</span></a><span class="sd"> """</span> -</span><span id="L-1405"><a href="#L-1405"><span class="linenos">1405</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="L-1406"><a href="#L-1406"><span class="linenos">1406</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="L-1407"><a href="#L-1407"><span class="linenos">1407</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-1408"><a href="#L-1408"><span class="linenos">1408</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"returning"</span><span class="p">,</span> -</span><span id="L-1409"><a href="#L-1409"><span class="linenos">1409</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"RETURNING"</span><span class="p">,</span> -</span><span id="L-1410"><a href="#L-1410"><span class="linenos">1410</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1411"><a href="#L-1411"><span class="linenos">1411</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-1412"><a href="#L-1412"><span class="linenos">1412</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Returning</span><span class="p">,</span> -</span><span id="L-1413"><a href="#L-1413"><span class="linenos">1413</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1414"><a href="#L-1414"><span class="linenos">1414</span></a> <span class="p">)</span> -</span><span id="L-1415"><a href="#L-1415"><span class="linenos">1415</span></a> -</span><span id="L-1416"><a href="#L-1416"><span class="linenos">1416</span></a> -</span><span id="L-1417"><a href="#L-1417"><span class="linenos">1417</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-1418"><a href="#L-1418"><span class="linenos">1418</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1419"><a href="#L-1419"><span class="linenos">1419</span></a> <span class="s2">"this"</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">"kind"</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="s2">"exists"</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 class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1423"><a href="#L-1423"><span class="linenos">1423</span></a> <span class="s2">"materialized"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1424"><a href="#L-1424"><span class="linenos">1424</span></a> <span class="s2">"cascade"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1425"><a href="#L-1425"><span class="linenos">1425</span></a> <span class="s2">"constraints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1426"><a href="#L-1426"><span class="linenos">1426</span></a> <span class="s2">"purge"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1427"><a href="#L-1427"><span class="linenos">1427</span></a> <span class="p">}</span> -</span><span id="L-1428"><a href="#L-1428"><span class="linenos">1428</span></a> -</span><span id="L-1429"><a href="#L-1429"><span class="linenos">1429</span></a> -</span><span id="L-1430"><a href="#L-1430"><span class="linenos">1430</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-1431"><a href="#L-1431"><span class="linenos">1431</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1432"><a href="#L-1432"><span class="linenos">1432</span></a> -</span><span id="L-1433"><a href="#L-1433"><span class="linenos">1433</span></a> -</span><span id="L-1434"><a href="#L-1434"><span class="linenos">1434</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-1435"><a href="#L-1435"><span class="linenos">1435</span></a> <span class="k">pass</span> -</span><span id="L-1436"><a href="#L-1436"><span class="linenos">1436</span></a> -</span><span id="L-1437"><a href="#L-1437"><span class="linenos">1437</span></a> -</span><span id="L-1438"><a href="#L-1438"><span class="linenos">1438</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-1439"><a href="#L-1439"><span class="linenos">1439</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-1440"><a href="#L-1440"><span class="linenos">1440</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1441"><a href="#L-1441"><span class="linenos">1441</span></a> -</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 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-1444"><a href="#L-1444"><span class="linenos">1444</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1445"><a href="#L-1445"><span class="linenos">1445</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1446"><a href="#L-1446"><span class="linenos">1446</span></a> <span class="s2">"reference"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1447"><a href="#L-1447"><span class="linenos">1447</span></a> <span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1448"><a href="#L-1448"><span class="linenos">1448</span></a> <span class="s2">"update"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1449"><a href="#L-1449"><span class="linenos">1449</span></a> <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">PrimaryKey</span><span class="p">(</span><span class="n">Expression</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">"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-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="c1"># https://www.postgresql.org/docs/9.1/sql-selectinto.html</span> -</span><span id="L-1457"><a href="#L-1457"><span class="linenos">1457</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-1458"><a href="#L-1458"><span class="linenos">1458</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-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">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-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">From</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1463"><a href="#L-1463"><span class="linenos">1463</span></a> <span class="nd">@property</span> -</span><span id="L-1464"><a href="#L-1464"><span class="linenos">1464</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-1465"><a href="#L-1465"><span class="linenos">1465</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-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 class="nd">@property</span> -</span><span id="L-1468"><a href="#L-1468"><span class="linenos">1468</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-1469"><a href="#L-1469"><span class="linenos">1469</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-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">Having</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1473"><a href="#L-1473"><span class="linenos">1473</span></a> <span class="k">pass</span> -</span><span id="L-1474"><a href="#L-1474"><span class="linenos">1474</span></a> -</span><span id="L-1475"><a href="#L-1475"><span class="linenos">1475</span></a> -</span><span id="L-1476"><a href="#L-1476"><span class="linenos">1476</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-1477"><a href="#L-1477"><span class="linenos">1477</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-1478"><a href="#L-1478"><span class="linenos">1478</span></a> -</span><span id="L-1479"><a href="#L-1479"><span class="linenos">1479</span></a> -</span><span id="L-1480"><a href="#L-1480"><span class="linenos">1480</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-1481"><a href="#L-1481"><span class="linenos">1481</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1482"><a href="#L-1482"><span class="linenos">1482</span></a> -</span><span id="L-1483"><a href="#L-1483"><span class="linenos">1483</span></a> -</span><span id="L-1484"><a href="#L-1484"><span class="linenos">1484</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-1485"><a href="#L-1485"><span class="linenos">1485</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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="nd">@property</span> -</span><span id="L-1488"><a href="#L-1488"><span class="linenos">1488</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 class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="L-1489"><a href="#L-1489"><span class="linenos">1489</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-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 class="nd">@property</span> -</span><span id="L-1492"><a href="#L-1492"><span class="linenos">1492</span></a> <span class="k">def</span> <span class="nf">hashable_args</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">Any</span><span class="p">:</span> -</span><span id="L-1493"><a href="#L-1493"><span class="linenos">1493</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">quoted</span> <span class="ow">and</span> <span class="nb">any</span><span class="p">(</span><span class="n">char</span><span class="o">.</span><span class="n">isupper</span><span class="p">()</span> <span class="k">for</span> <span class="n">char</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">):</span> -</span><span id="L-1494"><a href="#L-1494"><span class="linenos">1494</span></a> <span class="k">return</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">quoted</span><span class="p">)</span> -</span><span id="L-1495"><a href="#L-1495"><span class="linenos">1495</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">lower</span><span class="p">()</span> +</span><span id="L-1295"><a href="#L-1295"><span class="linenos">1295</span></a> +</span><span id="L-1296"><a href="#L-1296"><span class="linenos">1296</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-1297"><a href="#L-1297"><span class="linenos">1297</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1298"><a href="#L-1298"><span class="linenos">1298</span></a> <span class="s2">"with"</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">"this"</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">"using"</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">"where"</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">"returning"</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="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1304"><a href="#L-1304"><span class="linenos">1304</span></a> <span class="s2">"tables"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># Multiple-Table Syntax (MySQL)</span> +</span><span id="L-1305"><a href="#L-1305"><span class="linenos">1305</span></a> <span class="p">}</span> +</span><span id="L-1306"><a href="#L-1306"><span class="linenos">1306</span></a> +</span><span id="L-1307"><a href="#L-1307"><span class="linenos">1307</span></a> <span class="k">def</span> <span class="nf">delete</span><span class="p">(</span> +</span><span id="L-1308"><a href="#L-1308"><span class="linenos">1308</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-1309"><a href="#L-1309"><span class="linenos">1309</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-1310"><a href="#L-1310"><span class="linenos">1310</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-1311"><a href="#L-1311"><span class="linenos">1311</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-1312"><a href="#L-1312"><span class="linenos">1312</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1313"><a href="#L-1313"><span class="linenos">1313</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="L-1314"><a href="#L-1314"><span class="linenos">1314</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1315"><a href="#L-1315"><span class="linenos">1315</span></a><span class="sd"> Create a DELETE expression or replace the table on an existing DELETE expression.</span> +</span><span id="L-1316"><a href="#L-1316"><span class="linenos">1316</span></a> +</span><span id="L-1317"><a href="#L-1317"><span class="linenos">1317</span></a><span class="sd"> Example:</span> +</span><span id="L-1318"><a href="#L-1318"><span class="linenos">1318</span></a><span class="sd"> >>> delete("tbl").sql()</span> +</span><span id="L-1319"><a href="#L-1319"><span class="linenos">1319</span></a><span class="sd"> 'DELETE FROM tbl'</span> +</span><span id="L-1320"><a href="#L-1320"><span class="linenos">1320</span></a> +</span><span id="L-1321"><a href="#L-1321"><span class="linenos">1321</span></a><span class="sd"> Args:</span> +</span><span id="L-1322"><a href="#L-1322"><span class="linenos">1322</span></a><span class="sd"> table: the table from which to delete.</span> +</span><span id="L-1323"><a href="#L-1323"><span class="linenos">1323</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-1324"><a href="#L-1324"><span class="linenos">1324</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-1325"><a href="#L-1325"><span class="linenos">1325</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</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="sd"> Returns:</span> +</span><span id="L-1328"><a href="#L-1328"><span class="linenos">1328</span></a><span class="sd"> Delete: the modified expression.</span> +</span><span id="L-1329"><a href="#L-1329"><span class="linenos">1329</span></a><span class="sd"> """</span> +</span><span id="L-1330"><a href="#L-1330"><span class="linenos">1330</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="L-1331"><a href="#L-1331"><span class="linenos">1331</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">table</span><span class="p">,</span> +</span><span id="L-1332"><a href="#L-1332"><span class="linenos">1332</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-1333"><a href="#L-1333"><span class="linenos">1333</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"this"</span><span class="p">,</span> +</span><span id="L-1334"><a href="#L-1334"><span class="linenos">1334</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-1335"><a href="#L-1335"><span class="linenos">1335</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> +</span><span id="L-1336"><a href="#L-1336"><span class="linenos">1336</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-1337"><a href="#L-1337"><span class="linenos">1337</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1338"><a href="#L-1338"><span class="linenos">1338</span></a> <span class="p">)</span> +</span><span id="L-1339"><a href="#L-1339"><span class="linenos">1339</span></a> +</span><span id="L-1340"><a href="#L-1340"><span class="linenos">1340</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span> +</span><span id="L-1341"><a href="#L-1341"><span class="linenos">1341</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-1342"><a href="#L-1342"><span class="linenos">1342</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-1343"><a href="#L-1343"><span class="linenos">1343</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-1344"><a href="#L-1344"><span class="linenos">1344</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-1345"><a href="#L-1345"><span class="linenos">1345</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-1346"><a href="#L-1346"><span class="linenos">1346</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1347"><a href="#L-1347"><span class="linenos">1347</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="L-1348"><a href="#L-1348"><span class="linenos">1348</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1349"><a href="#L-1349"><span class="linenos">1349</span></a><span class="sd"> Append to or set the WHERE expressions.</span> +</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="sd"> Example:</span> +</span><span id="L-1352"><a href="#L-1352"><span class="linenos">1352</span></a><span class="sd"> >>> delete("tbl").where("x = 'a' OR x < 'b'").sql()</span> +</span><span id="L-1353"><a href="#L-1353"><span class="linenos">1353</span></a><span class="sd"> "DELETE FROM tbl WHERE x = 'a' OR x < 'b'"</span> +</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="sd"> Args:</span> +</span><span id="L-1356"><a href="#L-1356"><span class="linenos">1356</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-1357"><a href="#L-1357"><span class="linenos">1357</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-1358"><a href="#L-1358"><span class="linenos">1358</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="L-1359"><a href="#L-1359"><span class="linenos">1359</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> +</span><span id="L-1360"><a href="#L-1360"><span class="linenos">1360</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="L-1361"><a href="#L-1361"><span class="linenos">1361</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-1362"><a href="#L-1362"><span class="linenos">1362</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-1363"><a href="#L-1363"><span class="linenos">1363</span></a><span class="sd"> opts: other options to use to parse the input expressions.</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 class="sd"> Returns:</span> +</span><span id="L-1366"><a href="#L-1366"><span class="linenos">1366</span></a><span class="sd"> Delete: the modified expression.</span> +</span><span id="L-1367"><a href="#L-1367"><span class="linenos">1367</span></a><span class="sd"> """</span> +</span><span id="L-1368"><a href="#L-1368"><span class="linenos">1368</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="L-1369"><a href="#L-1369"><span class="linenos">1369</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-1370"><a href="#L-1370"><span class="linenos">1370</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-1371"><a href="#L-1371"><span class="linenos">1371</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> +</span><span id="L-1372"><a href="#L-1372"><span class="linenos">1372</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-1373"><a href="#L-1373"><span class="linenos">1373</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> +</span><span id="L-1374"><a href="#L-1374"><span class="linenos">1374</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-1375"><a href="#L-1375"><span class="linenos">1375</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-1376"><a href="#L-1376"><span class="linenos">1376</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1377"><a href="#L-1377"><span class="linenos">1377</span></a> <span class="p">)</span> +</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">def</span> <span class="nf">returning</span><span class="p">(</span> +</span><span id="L-1380"><a href="#L-1380"><span class="linenos">1380</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-1381"><a href="#L-1381"><span class="linenos">1381</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-1382"><a href="#L-1382"><span class="linenos">1382</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-1383"><a href="#L-1383"><span class="linenos">1383</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-1384"><a href="#L-1384"><span class="linenos">1384</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1385"><a href="#L-1385"><span class="linenos">1385</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="L-1386"><a href="#L-1386"><span class="linenos">1386</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1387"><a href="#L-1387"><span class="linenos">1387</span></a><span class="sd"> Set the RETURNING expression. Not supported by all dialects.</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 class="sd"> Example:</span> +</span><span id="L-1390"><a href="#L-1390"><span class="linenos">1390</span></a><span class="sd"> >>> delete("tbl").returning("*", dialect="postgres").sql()</span> +</span><span id="L-1391"><a href="#L-1391"><span class="linenos">1391</span></a><span class="sd"> 'DELETE FROM tbl RETURNING *'</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 class="sd"> Args:</span> +</span><span id="L-1394"><a href="#L-1394"><span class="linenos">1394</span></a><span class="sd"> expression: the SQL code strings to parse.</span> +</span><span id="L-1395"><a href="#L-1395"><span class="linenos">1395</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-1396"><a href="#L-1396"><span class="linenos">1396</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-1397"><a href="#L-1397"><span class="linenos">1397</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-1398"><a href="#L-1398"><span class="linenos">1398</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-1399"><a href="#L-1399"><span class="linenos">1399</span></a> +</span><span id="L-1400"><a href="#L-1400"><span class="linenos">1400</span></a><span class="sd"> Returns:</span> +</span><span id="L-1401"><a href="#L-1401"><span class="linenos">1401</span></a><span class="sd"> Delete: the modified expression.</span> +</span><span id="L-1402"><a href="#L-1402"><span class="linenos">1402</span></a><span class="sd"> """</span> +</span><span id="L-1403"><a href="#L-1403"><span class="linenos">1403</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="L-1404"><a href="#L-1404"><span class="linenos">1404</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="L-1405"><a href="#L-1405"><span class="linenos">1405</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-1406"><a href="#L-1406"><span class="linenos">1406</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"returning"</span><span class="p">,</span> +</span><span id="L-1407"><a href="#L-1407"><span class="linenos">1407</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"RETURNING"</span><span class="p">,</span> +</span><span id="L-1408"><a href="#L-1408"><span class="linenos">1408</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-1409"><a href="#L-1409"><span class="linenos">1409</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-1410"><a href="#L-1410"><span class="linenos">1410</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Returning</span><span class="p">,</span> +</span><span id="L-1411"><a href="#L-1411"><span class="linenos">1411</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1412"><a href="#L-1412"><span class="linenos">1412</span></a> <span class="p">)</span> +</span><span id="L-1413"><a href="#L-1413"><span class="linenos">1413</span></a> +</span><span id="L-1414"><a href="#L-1414"><span class="linenos">1414</span></a> +</span><span id="L-1415"><a href="#L-1415"><span class="linenos">1415</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-1416"><a href="#L-1416"><span class="linenos">1416</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1417"><a href="#L-1417"><span class="linenos">1417</span></a> <span class="s2">"this"</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">"kind"</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">"exists"</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">"temporary"</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="s2">"materialized"</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 class="s2">"cascade"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1423"><a href="#L-1423"><span class="linenos">1423</span></a> <span class="s2">"constraints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1424"><a href="#L-1424"><span class="linenos">1424</span></a> <span class="s2">"purge"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1425"><a href="#L-1425"><span class="linenos">1425</span></a> <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">Filter</span><span class="p">(</span><span class="n">Expression</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">"expression"</span><span class="p">:</span> <span class="kc">True</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">Check</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1433"><a href="#L-1433"><span class="linenos">1433</span></a> <span class="k">pass</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">Directory</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1437"><a href="#L-1437"><span class="linenos">1437</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-1438"><a href="#L-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 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-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><span id="L-1441"><a href="#L-1441"><span class="linenos">1441</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-1442"><a href="#L-1442"><span class="linenos">1442</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1443"><a href="#L-1443"><span class="linenos">1443</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1444"><a href="#L-1444"><span class="linenos">1444</span></a> <span class="s2">"reference"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1445"><a href="#L-1445"><span class="linenos">1445</span></a> <span class="s2">"delete"</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 class="s2">"update"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1447"><a href="#L-1447"><span class="linenos">1447</span></a> <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">PrimaryKey</span><span class="p">(</span><span class="n">Expression</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">"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-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="c1"># https://www.postgresql.org/docs/9.1/sql-selectinto.html</span> +</span><span id="L-1455"><a href="#L-1455"><span class="linenos">1455</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-1456"><a href="#L-1456"><span class="linenos">1456</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-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">"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-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">From</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1461"><a href="#L-1461"><span class="linenos">1461</span></a> <span class="nd">@property</span> +</span><span id="L-1462"><a href="#L-1462"><span class="linenos">1462</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-1463"><a href="#L-1463"><span class="linenos">1463</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-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 class="nd">@property</span> +</span><span id="L-1466"><a href="#L-1466"><span class="linenos">1466</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-1467"><a href="#L-1467"><span class="linenos">1467</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-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">Having</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1471"><a href="#L-1471"><span class="linenos">1471</span></a> <span class="k">pass</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">Hint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1475"><a href="#L-1475"><span class="linenos">1475</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-1476"><a href="#L-1476"><span class="linenos">1476</span></a> +</span><span id="L-1477"><a href="#L-1477"><span class="linenos">1477</span></a> +</span><span id="L-1478"><a href="#L-1478"><span class="linenos">1478</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-1479"><a href="#L-1479"><span class="linenos">1479</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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">Identifier</span><span class="p">(</span><span class="n">Expression</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 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-1484"><a href="#L-1484"><span class="linenos">1484</span></a> +</span><span id="L-1485"><a href="#L-1485"><span class="linenos">1485</span></a> <span class="nd">@property</span> +</span><span id="L-1486"><a href="#L-1486"><span class="linenos">1486</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 class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="L-1487"><a href="#L-1487"><span class="linenos">1487</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-1488"><a href="#L-1488"><span class="linenos">1488</span></a> +</span><span id="L-1489"><a href="#L-1489"><span class="linenos">1489</span></a> <span class="nd">@property</span> +</span><span id="L-1490"><a href="#L-1490"><span class="linenos">1490</span></a> <span class="k">def</span> <span class="nf">hashable_args</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">Any</span><span class="p">:</span> +</span><span id="L-1491"><a href="#L-1491"><span class="linenos">1491</span></a> <span class="k">return</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">quoted</span><span class="p">)</span> +</span><span id="L-1492"><a href="#L-1492"><span class="linenos">1492</span></a> +</span><span id="L-1493"><a href="#L-1493"><span class="linenos">1493</span></a> <span class="nd">@property</span> +</span><span id="L-1494"><a href="#L-1494"><span class="linenos">1494</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-1495"><a href="#L-1495"><span class="linenos">1495</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-1496"><a href="#L-1496"><span class="linenos">1496</span></a> -</span><span id="L-1497"><a href="#L-1497"><span class="linenos">1497</span></a> <span class="nd">@property</span> -</span><span id="L-1498"><a href="#L-1498"><span class="linenos">1498</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-1499"><a href="#L-1499"><span class="linenos">1499</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-1500"><a href="#L-1500"><span class="linenos">1500</span></a> -</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 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-1503"><a href="#L-1503"><span class="linenos">1503</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1504"><a href="#L-1504"><span class="linenos">1504</span></a> <span class="s2">"this"</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 class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1506"><a href="#L-1506"><span class="linenos">1506</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1507"><a href="#L-1507"><span class="linenos">1507</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1508"><a href="#L-1508"><span class="linenos">1508</span></a> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1509"><a href="#L-1509"><span class="linenos">1509</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1510"><a href="#L-1510"><span class="linenos">1510</span></a> <span class="s2">"primary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1511"><a href="#L-1511"><span class="linenos">1511</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-1512"><a href="#L-1512"><span class="linenos">1512</span></a> <span class="s2">"partition_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># teradata</span> -</span><span id="L-1513"><a href="#L-1513"><span class="linenos">1513</span></a> <span class="p">}</span> -</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><span id="L-1516"><a href="#L-1516"><span class="linenos">1516</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-1517"><a href="#L-1517"><span class="linenos">1517</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1518"><a href="#L-1518"><span class="linenos">1518</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1519"><a href="#L-1519"><span class="linenos">1519</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1520"><a href="#L-1520"><span class="linenos">1520</span></a> <span class="s2">"expression"</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 class="s2">"conflict"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1522"><a href="#L-1522"><span class="linenos">1522</span></a> <span class="s2">"returning"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1523"><a href="#L-1523"><span class="linenos">1523</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1524"><a href="#L-1524"><span class="linenos">1524</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1525"><a href="#L-1525"><span class="linenos">1525</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1526"><a href="#L-1526"><span class="linenos">1526</span></a> <span class="s2">"alternative"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1527"><a href="#L-1527"><span class="linenos">1527</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1528"><a href="#L-1528"><span class="linenos">1528</span></a> <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 class="k">def</span> <span class="nf">with_</span><span class="p">(</span> -</span><span id="L-1531"><a href="#L-1531"><span class="linenos">1531</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-1532"><a href="#L-1532"><span class="linenos">1532</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-1533"><a href="#L-1533"><span class="linenos">1533</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-1534"><a href="#L-1534"><span class="linenos">1534</span></a> <span class="n">recursive</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-1535"><a href="#L-1535"><span class="linenos">1535</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-1536"><a href="#L-1536"><span class="linenos">1536</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-1537"><a href="#L-1537"><span class="linenos">1537</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-1538"><a href="#L-1538"><span class="linenos">1538</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1539"><a href="#L-1539"><span class="linenos">1539</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Insert</span><span class="p">:</span> -</span><span id="L-1540"><a href="#L-1540"><span class="linenos">1540</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1541"><a href="#L-1541"><span class="linenos">1541</span></a><span class="sd"> Append to or set the common table expressions.</span> -</span><span id="L-1542"><a href="#L-1542"><span class="linenos">1542</span></a> -</span><span id="L-1543"><a href="#L-1543"><span class="linenos">1543</span></a><span class="sd"> Example:</span> -</span><span id="L-1544"><a href="#L-1544"><span class="linenos">1544</span></a><span class="sd"> >>> insert("SELECT x FROM cte", "t").with_("cte", as_="SELECT * FROM tbl").sql()</span> -</span><span id="L-1545"><a href="#L-1545"><span class="linenos">1545</span></a><span class="sd"> 'WITH cte AS (SELECT * FROM tbl) INSERT INTO t SELECT x FROM cte'</span> -</span><span id="L-1546"><a href="#L-1546"><span class="linenos">1546</span></a> -</span><span id="L-1547"><a href="#L-1547"><span class="linenos">1547</span></a><span class="sd"> Args:</span> -</span><span id="L-1548"><a href="#L-1548"><span class="linenos">1548</span></a><span class="sd"> alias: the SQL code string to parse as the table name.</span> -</span><span id="L-1549"><a href="#L-1549"><span class="linenos">1549</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> -</span><span id="L-1550"><a href="#L-1550"><span class="linenos">1550</span></a><span class="sd"> as_: the SQL code string to parse as the table expression.</span> -</span><span id="L-1551"><a href="#L-1551"><span class="linenos">1551</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-1552"><a href="#L-1552"><span class="linenos">1552</span></a><span class="sd"> recursive: set the RECURSIVE part of the expression. Defaults to `False`.</span> -</span><span id="L-1553"><a href="#L-1553"><span class="linenos">1553</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="L-1554"><a href="#L-1554"><span class="linenos">1554</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="L-1555"><a href="#L-1555"><span class="linenos">1555</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-1556"><a href="#L-1556"><span class="linenos">1556</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-1557"><a href="#L-1557"><span class="linenos">1557</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-1558"><a href="#L-1558"><span class="linenos">1558</span></a> -</span><span id="L-1559"><a href="#L-1559"><span class="linenos">1559</span></a><span class="sd"> Returns:</span> -</span><span id="L-1560"><a href="#L-1560"><span class="linenos">1560</span></a><span class="sd"> The modified expression.</span> -</span><span id="L-1561"><a href="#L-1561"><span class="linenos">1561</span></a><span class="sd"> """</span> -</span><span id="L-1562"><a href="#L-1562"><span class="linenos">1562</span></a> <span class="k">return</span> <span class="n">_apply_cte_builder</span><span class="p">(</span> -</span><span id="L-1563"><a href="#L-1563"><span class="linenos">1563</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="p">,</span> <span class="n">as_</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="n">recursive</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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> -</span><span id="L-1564"><a href="#L-1564"><span class="linenos">1564</span></a> <span class="p">)</span> -</span><span id="L-1565"><a href="#L-1565"><span class="linenos">1565</span></a> -</span><span id="L-1566"><a href="#L-1566"><span class="linenos">1566</span></a> -</span><span id="L-1567"><a href="#L-1567"><span class="linenos">1567</span></a><span class="k">class</span> <span class="nc">OnConflict</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1568"><a href="#L-1568"><span class="linenos">1568</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1569"><a href="#L-1569"><span class="linenos">1569</span></a> <span class="s2">"duplicate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1570"><a href="#L-1570"><span class="linenos">1570</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1571"><a href="#L-1571"><span class="linenos">1571</span></a> <span class="s2">"nothing"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1572"><a href="#L-1572"><span class="linenos">1572</span></a> <span class="s2">"key"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1573"><a href="#L-1573"><span class="linenos">1573</span></a> <span class="s2">"constraint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1574"><a href="#L-1574"><span class="linenos">1574</span></a> <span class="p">}</span> -</span><span id="L-1575"><a href="#L-1575"><span class="linenos">1575</span></a> +</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 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-1499"><a href="#L-1499"><span class="linenos">1499</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1500"><a href="#L-1500"><span class="linenos">1500</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1501"><a href="#L-1501"><span class="linenos">1501</span></a> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1502"><a href="#L-1502"><span class="linenos">1502</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1503"><a href="#L-1503"><span class="linenos">1503</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1504"><a href="#L-1504"><span class="linenos">1504</span></a> <span class="s2">"columns"</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 class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1506"><a href="#L-1506"><span class="linenos">1506</span></a> <span class="s2">"primary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1507"><a href="#L-1507"><span class="linenos">1507</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-1508"><a href="#L-1508"><span class="linenos">1508</span></a> <span class="s2">"partition_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># teradata</span> +</span><span id="L-1509"><a href="#L-1509"><span class="linenos">1509</span></a> <span class="p">}</span> +</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><span id="L-1512"><a href="#L-1512"><span class="linenos">1512</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-1513"><a href="#L-1513"><span class="linenos">1513</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1514"><a href="#L-1514"><span class="linenos">1514</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1515"><a href="#L-1515"><span class="linenos">1515</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1516"><a href="#L-1516"><span class="linenos">1516</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1517"><a href="#L-1517"><span class="linenos">1517</span></a> <span class="s2">"conflict"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1518"><a href="#L-1518"><span class="linenos">1518</span></a> <span class="s2">"returning"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1519"><a href="#L-1519"><span class="linenos">1519</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1520"><a href="#L-1520"><span class="linenos">1520</span></a> <span class="s2">"exists"</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 class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1522"><a href="#L-1522"><span class="linenos">1522</span></a> <span class="s2">"alternative"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1523"><a href="#L-1523"><span class="linenos">1523</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1524"><a href="#L-1524"><span class="linenos">1524</span></a> <span class="s2">"ignore"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1525"><a href="#L-1525"><span class="linenos">1525</span></a> <span class="p">}</span> +</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">def</span> <span class="nf">with_</span><span class="p">(</span> +</span><span id="L-1528"><a href="#L-1528"><span class="linenos">1528</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-1529"><a href="#L-1529"><span class="linenos">1529</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-1530"><a href="#L-1530"><span class="linenos">1530</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-1531"><a href="#L-1531"><span class="linenos">1531</span></a> <span class="n">recursive</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-1532"><a href="#L-1532"><span class="linenos">1532</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-1533"><a href="#L-1533"><span class="linenos">1533</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-1534"><a href="#L-1534"><span class="linenos">1534</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-1535"><a href="#L-1535"><span class="linenos">1535</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1536"><a href="#L-1536"><span class="linenos">1536</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Insert</span><span class="p">:</span> +</span><span id="L-1537"><a href="#L-1537"><span class="linenos">1537</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1538"><a href="#L-1538"><span class="linenos">1538</span></a><span class="sd"> Append to or set the common table expressions.</span> +</span><span id="L-1539"><a href="#L-1539"><span class="linenos">1539</span></a> +</span><span id="L-1540"><a href="#L-1540"><span class="linenos">1540</span></a><span class="sd"> Example:</span> +</span><span id="L-1541"><a href="#L-1541"><span class="linenos">1541</span></a><span class="sd"> >>> insert("SELECT x FROM cte", "t").with_("cte", as_="SELECT * FROM tbl").sql()</span> +</span><span id="L-1542"><a href="#L-1542"><span class="linenos">1542</span></a><span class="sd"> 'WITH cte AS (SELECT * FROM tbl) INSERT INTO t SELECT x FROM cte'</span> +</span><span id="L-1543"><a href="#L-1543"><span class="linenos">1543</span></a> +</span><span id="L-1544"><a href="#L-1544"><span class="linenos">1544</span></a><span class="sd"> Args:</span> +</span><span id="L-1545"><a href="#L-1545"><span class="linenos">1545</span></a><span class="sd"> alias: the SQL code string to parse as the table name.</span> +</span><span id="L-1546"><a href="#L-1546"><span class="linenos">1546</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> +</span><span id="L-1547"><a href="#L-1547"><span class="linenos">1547</span></a><span class="sd"> as_: the SQL code string to parse as the table expression.</span> +</span><span id="L-1548"><a href="#L-1548"><span class="linenos">1548</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-1549"><a href="#L-1549"><span class="linenos">1549</span></a><span class="sd"> recursive: set the RECURSIVE part of the expression. Defaults to `False`.</span> +</span><span id="L-1550"><a href="#L-1550"><span class="linenos">1550</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="L-1551"><a href="#L-1551"><span class="linenos">1551</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="L-1552"><a href="#L-1552"><span class="linenos">1552</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-1553"><a href="#L-1553"><span class="linenos">1553</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-1554"><a href="#L-1554"><span class="linenos">1554</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</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="sd"> Returns:</span> +</span><span id="L-1557"><a href="#L-1557"><span class="linenos">1557</span></a><span class="sd"> The modified expression.</span> +</span><span id="L-1558"><a href="#L-1558"><span class="linenos">1558</span></a><span class="sd"> """</span> +</span><span id="L-1559"><a href="#L-1559"><span class="linenos">1559</span></a> <span class="k">return</span> <span class="n">_apply_cte_builder</span><span class="p">(</span> +</span><span id="L-1560"><a href="#L-1560"><span class="linenos">1560</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="p">,</span> <span class="n">as_</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="n">recursive</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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> +</span><span id="L-1561"><a href="#L-1561"><span class="linenos">1561</span></a> <span class="p">)</span> +</span><span id="L-1562"><a href="#L-1562"><span class="linenos">1562</span></a> +</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 class="k">class</span> <span class="nc">OnConflict</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1565"><a href="#L-1565"><span class="linenos">1565</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1566"><a href="#L-1566"><span class="linenos">1566</span></a> <span class="s2">"duplicate"</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 class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1568"><a href="#L-1568"><span class="linenos">1568</span></a> <span class="s2">"nothing"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1569"><a href="#L-1569"><span class="linenos">1569</span></a> <span class="s2">"key"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1570"><a href="#L-1570"><span class="linenos">1570</span></a> <span class="s2">"constraint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1571"><a href="#L-1571"><span class="linenos">1571</span></a> <span class="p">}</span> +</span><span id="L-1572"><a href="#L-1572"><span class="linenos">1572</span></a> +</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="k">class</span> <span class="nc">Returning</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1575"><a href="#L-1575"><span class="linenos">1575</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-1576"><a href="#L-1576"><span class="linenos">1576</span></a> -</span><span id="L-1577"><a href="#L-1577"><span class="linenos">1577</span></a><span class="k">class</span> <span class="nc">Returning</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1578"><a href="#L-1578"><span class="linenos">1578</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-1579"><a href="#L-1579"><span class="linenos">1579</span></a> -</span><span id="L-1580"><a href="#L-1580"><span class="linenos">1580</span></a> -</span><span id="L-1581"><a href="#L-1581"><span class="linenos">1581</span></a><span class="c1"># https://dev.mysql.com/doc/refman/8.0/en/charset-introducer.html</span> -</span><span id="L-1582"><a href="#L-1582"><span class="linenos">1582</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-1583"><a href="#L-1583"><span class="linenos">1583</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1584"><a href="#L-1584"><span class="linenos">1584</span></a> -</span><span id="L-1585"><a href="#L-1585"><span class="linenos">1585</span></a> -</span><span id="L-1586"><a href="#L-1586"><span class="linenos">1586</span></a><span class="c1"># national char, like n'utf8'</span> -</span><span id="L-1587"><a href="#L-1587"><span class="linenos">1587</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-1588"><a href="#L-1588"><span class="linenos">1588</span></a> <span class="k">pass</span> -</span><span id="L-1589"><a href="#L-1589"><span class="linenos">1589</span></a> -</span><span id="L-1590"><a href="#L-1590"><span class="linenos">1590</span></a> -</span><span id="L-1591"><a href="#L-1591"><span class="linenos">1591</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-1592"><a href="#L-1592"><span class="linenos">1592</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1593"><a href="#L-1593"><span class="linenos">1593</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1594"><a href="#L-1594"><span class="linenos">1594</span></a> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1595"><a href="#L-1595"><span class="linenos">1595</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1596"><a href="#L-1596"><span class="linenos">1596</span></a> <span class="s2">"inpath"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1597"><a href="#L-1597"><span class="linenos">1597</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1598"><a href="#L-1598"><span class="linenos">1598</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-1599"><a href="#L-1599"><span class="linenos">1599</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1600"><a href="#L-1600"><span class="linenos">1600</span></a> <span class="p">}</span> -</span><span id="L-1601"><a href="#L-1601"><span class="linenos">1601</span></a> +</span><span id="L-1577"><a href="#L-1577"><span class="linenos">1577</span></a> +</span><span id="L-1578"><a href="#L-1578"><span class="linenos">1578</span></a><span class="c1"># https://dev.mysql.com/doc/refman/8.0/en/charset-introducer.html</span> +</span><span id="L-1579"><a href="#L-1579"><span class="linenos">1579</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-1580"><a href="#L-1580"><span class="linenos">1580</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1581"><a href="#L-1581"><span class="linenos">1581</span></a> +</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="c1"># national char, like n'utf8'</span> +</span><span id="L-1584"><a href="#L-1584"><span class="linenos">1584</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-1585"><a href="#L-1585"><span class="linenos">1585</span></a> <span class="k">pass</span> +</span><span id="L-1586"><a href="#L-1586"><span class="linenos">1586</span></a> +</span><span id="L-1587"><a href="#L-1587"><span class="linenos">1587</span></a> +</span><span id="L-1588"><a href="#L-1588"><span class="linenos">1588</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-1589"><a href="#L-1589"><span class="linenos">1589</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1590"><a href="#L-1590"><span class="linenos">1590</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1591"><a href="#L-1591"><span class="linenos">1591</span></a> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1592"><a href="#L-1592"><span class="linenos">1592</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1593"><a href="#L-1593"><span class="linenos">1593</span></a> <span class="s2">"inpath"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1594"><a href="#L-1594"><span class="linenos">1594</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1595"><a href="#L-1595"><span class="linenos">1595</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-1596"><a href="#L-1596"><span class="linenos">1596</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1597"><a href="#L-1597"><span class="linenos">1597</span></a> <span class="p">}</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="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-1601"><a href="#L-1601"><span class="linenos">1601</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-1602"><a href="#L-1602"><span class="linenos">1602</span></a> -</span><span id="L-1603"><a href="#L-1603"><span class="linenos">1603</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-1604"><a href="#L-1604"><span class="linenos">1604</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-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><span id="L-1607"><a href="#L-1607"><span class="linenos">1607</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-1608"><a href="#L-1608"><span class="linenos">1608</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1609"><a href="#L-1609"><span class="linenos">1609</span></a> <span class="s2">"direction"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1610"><a href="#L-1610"><span class="linenos">1610</span></a> <span class="s2">"count"</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 class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1612"><a href="#L-1612"><span class="linenos">1612</span></a> <span class="s2">"with_ties"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1613"><a href="#L-1613"><span class="linenos">1613</span></a> <span class="p">}</span> -</span><span id="L-1614"><a href="#L-1614"><span class="linenos">1614</span></a> -</span><span id="L-1615"><a href="#L-1615"><span class="linenos">1615</span></a> -</span><span id="L-1616"><a href="#L-1616"><span class="linenos">1616</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-1617"><a href="#L-1617"><span class="linenos">1617</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1618"><a href="#L-1618"><span class="linenos">1618</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1619"><a href="#L-1619"><span class="linenos">1619</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-1620"><a href="#L-1620"><span class="linenos">1620</span></a> <span class="s2">"cube"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1621"><a href="#L-1621"><span class="linenos">1621</span></a> <span class="s2">"rollup"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1622"><a href="#L-1622"><span class="linenos">1622</span></a> <span class="s2">"totals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1623"><a href="#L-1623"><span class="linenos">1623</span></a> <span class="p">}</span> -</span><span id="L-1624"><a href="#L-1624"><span class="linenos">1624</span></a> -</span><span id="L-1625"><a href="#L-1625"><span class="linenos">1625</span></a> -</span><span id="L-1626"><a href="#L-1626"><span class="linenos">1626</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-1627"><a href="#L-1627"><span class="linenos">1627</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1628"><a href="#L-1628"><span class="linenos">1628</span></a> -</span><span id="L-1629"><a href="#L-1629"><span class="linenos">1629</span></a> -</span><span id="L-1630"><a href="#L-1630"><span class="linenos">1630</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-1631"><a href="#L-1631"><span class="linenos">1631</span></a> <span class="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 class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1632"><a href="#L-1632"><span class="linenos">1632</span></a> -</span><span id="L-1633"><a href="#L-1633"><span class="linenos">1633</span></a> -</span><span id="L-1634"><a href="#L-1634"><span class="linenos">1634</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-1635"><a href="#L-1635"><span class="linenos">1635</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1636"><a href="#L-1636"><span class="linenos">1636</span></a> -</span><span id="L-1637"><a href="#L-1637"><span class="linenos">1637</span></a> <span class="nd">@property</span> -</span><span id="L-1638"><a href="#L-1638"><span class="linenos">1638</span></a> <span class="k">def</span> <span class="nf">hashable_args</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">Any</span><span class="p">:</span> -</span><span id="L-1639"><a href="#L-1639"><span class="linenos">1639</span></a> <span class="k">return</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="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"is_string"</span><span class="p">))</span> -</span><span id="L-1640"><a href="#L-1640"><span class="linenos">1640</span></a> -</span><span id="L-1641"><a href="#L-1641"><span class="linenos">1641</span></a> <span class="nd">@classmethod</span> -</span><span id="L-1642"><a href="#L-1642"><span class="linenos">1642</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-1643"><a href="#L-1643"><span class="linenos">1643</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-1644"><a href="#L-1644"><span class="linenos">1644</span></a> -</span><span id="L-1645"><a href="#L-1645"><span class="linenos">1645</span></a> <span class="nd">@classmethod</span> -</span><span id="L-1646"><a href="#L-1646"><span class="linenos">1646</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-1647"><a href="#L-1647"><span class="linenos">1647</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-1648"><a href="#L-1648"><span class="linenos">1648</span></a> -</span><span id="L-1649"><a href="#L-1649"><span class="linenos">1649</span></a> <span class="nd">@property</span> -</span><span id="L-1650"><a href="#L-1650"><span class="linenos">1650</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-1651"><a href="#L-1651"><span class="linenos">1651</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-1652"><a href="#L-1652"><span class="linenos">1652</span></a> -</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">class</span> <span class="nc">Join</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1655"><a href="#L-1655"><span class="linenos">1655</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1656"><a href="#L-1656"><span class="linenos">1656</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1657"><a href="#L-1657"><span class="linenos">1657</span></a> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1658"><a href="#L-1658"><span class="linenos">1658</span></a> <span class="s2">"side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1659"><a href="#L-1659"><span class="linenos">1659</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1660"><a href="#L-1660"><span class="linenos">1660</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1661"><a href="#L-1661"><span class="linenos">1661</span></a> <span class="s2">"method"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1662"><a href="#L-1662"><span class="linenos">1662</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1663"><a href="#L-1663"><span class="linenos">1663</span></a> <span class="s2">"hint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1664"><a href="#L-1664"><span class="linenos">1664</span></a> <span class="p">}</span> -</span><span id="L-1665"><a href="#L-1665"><span class="linenos">1665</span></a> -</span><span id="L-1666"><a href="#L-1666"><span class="linenos">1666</span></a> <span class="nd">@property</span> -</span><span id="L-1667"><a href="#L-1667"><span class="linenos">1667</span></a> <span class="k">def</span> <span class="nf">method</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-1668"><a href="#L-1668"><span class="linenos">1668</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">"method"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="L-1669"><a href="#L-1669"><span class="linenos">1669</span></a> -</span><span id="L-1670"><a href="#L-1670"><span class="linenos">1670</span></a> <span class="nd">@property</span> -</span><span id="L-1671"><a href="#L-1671"><span class="linenos">1671</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-1672"><a href="#L-1672"><span class="linenos">1672</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-1673"><a href="#L-1673"><span class="linenos">1673</span></a> -</span><span id="L-1674"><a href="#L-1674"><span class="linenos">1674</span></a> <span class="nd">@property</span> -</span><span id="L-1675"><a href="#L-1675"><span class="linenos">1675</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-1676"><a href="#L-1676"><span class="linenos">1676</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-1677"><a href="#L-1677"><span class="linenos">1677</span></a> -</span><span id="L-1678"><a href="#L-1678"><span class="linenos">1678</span></a> <span class="nd">@property</span> -</span><span id="L-1679"><a href="#L-1679"><span class="linenos">1679</span></a> <span class="k">def</span> <span class="nf">hint</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-1680"><a href="#L-1680"><span class="linenos">1680</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">"hint"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="L-1681"><a href="#L-1681"><span class="linenos">1681</span></a> -</span><span id="L-1682"><a href="#L-1682"><span class="linenos">1682</span></a> <span class="nd">@property</span> -</span><span id="L-1683"><a href="#L-1683"><span class="linenos">1683</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-1684"><a href="#L-1684"><span class="linenos">1684</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-1685"><a href="#L-1685"><span class="linenos">1685</span></a> -</span><span id="L-1686"><a href="#L-1686"><span class="linenos">1686</span></a> <span class="k">def</span> <span class="nf">on</span><span class="p">(</span> -</span><span id="L-1687"><a href="#L-1687"><span class="linenos">1687</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-1688"><a href="#L-1688"><span class="linenos">1688</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-1689"><a href="#L-1689"><span class="linenos">1689</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-1690"><a href="#L-1690"><span class="linenos">1690</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-1691"><a href="#L-1691"><span class="linenos">1691</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-1692"><a href="#L-1692"><span class="linenos">1692</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1693"><a href="#L-1693"><span class="linenos">1693</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Join</span><span class="p">:</span> -</span><span id="L-1694"><a href="#L-1694"><span class="linenos">1694</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1695"><a href="#L-1695"><span class="linenos">1695</span></a><span class="sd"> Append to or set the ON expressions.</span> -</span><span id="L-1696"><a href="#L-1696"><span class="linenos">1696</span></a> -</span><span id="L-1697"><a href="#L-1697"><span class="linenos">1697</span></a><span class="sd"> Example:</span> -</span><span id="L-1698"><a href="#L-1698"><span class="linenos">1698</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-1699"><a href="#L-1699"><span class="linenos">1699</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()</span> -</span><span id="L-1700"><a href="#L-1700"><span class="linenos">1700</span></a><span class="sd"> 'JOIN x ON y = 1'</span> -</span><span id="L-1701"><a href="#L-1701"><span class="linenos">1701</span></a> -</span><span id="L-1702"><a href="#L-1702"><span class="linenos">1702</span></a><span class="sd"> Args:</span> -</span><span id="L-1703"><a href="#L-1703"><span class="linenos">1703</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-1704"><a href="#L-1704"><span class="linenos">1704</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-1705"><a href="#L-1705"><span class="linenos">1705</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="L-1706"><a href="#L-1706"><span class="linenos">1706</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> -</span><span id="L-1707"><a href="#L-1707"><span class="linenos">1707</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="L-1708"><a href="#L-1708"><span class="linenos">1708</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-1709"><a href="#L-1709"><span class="linenos">1709</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-1710"><a href="#L-1710"><span class="linenos">1710</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</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="sd"> Returns:</span> -</span><span id="L-1713"><a href="#L-1713"><span class="linenos">1713</span></a><span class="sd"> The modified Join expression.</span> -</span><span id="L-1714"><a href="#L-1714"><span class="linenos">1714</span></a><span class="sd"> """</span> -</span><span id="L-1715"><a href="#L-1715"><span class="linenos">1715</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-1716"><a href="#L-1716"><span class="linenos">1716</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-1717"><a href="#L-1717"><span class="linenos">1717</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-1718"><a href="#L-1718"><span class="linenos">1718</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"on"</span><span class="p">,</span> -</span><span id="L-1719"><a href="#L-1719"><span class="linenos">1719</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-1720"><a href="#L-1720"><span class="linenos">1720</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1721"><a href="#L-1721"><span class="linenos">1721</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-1722"><a href="#L-1722"><span class="linenos">1722</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1723"><a href="#L-1723"><span class="linenos">1723</span></a> <span class="p">)</span> -</span><span id="L-1724"><a href="#L-1724"><span class="linenos">1724</span></a> -</span><span id="L-1725"><a href="#L-1725"><span class="linenos">1725</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-1726"><a href="#L-1726"><span class="linenos">1726</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-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 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-1605"><a href="#L-1605"><span class="linenos">1605</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1606"><a href="#L-1606"><span class="linenos">1606</span></a> <span class="s2">"direction"</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 class="s2">"count"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1608"><a href="#L-1608"><span class="linenos">1608</span></a> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1609"><a href="#L-1609"><span class="linenos">1609</span></a> <span class="s2">"with_ties"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1610"><a href="#L-1610"><span class="linenos">1610</span></a> <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">Group</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1614"><a href="#L-1614"><span class="linenos">1614</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1615"><a href="#L-1615"><span class="linenos">1615</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1616"><a href="#L-1616"><span class="linenos">1616</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-1617"><a href="#L-1617"><span class="linenos">1617</span></a> <span class="s2">"cube"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1618"><a href="#L-1618"><span class="linenos">1618</span></a> <span class="s2">"rollup"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1619"><a href="#L-1619"><span class="linenos">1619</span></a> <span class="s2">"totals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1620"><a href="#L-1620"><span class="linenos">1620</span></a> <span class="s2">"all"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1621"><a href="#L-1621"><span class="linenos">1621</span></a> <span class="p">}</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><span id="L-1624"><a href="#L-1624"><span class="linenos">1624</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-1625"><a href="#L-1625"><span class="linenos">1625</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-1628"><a href="#L-1628"><span class="linenos">1628</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-1629"><a href="#L-1629"><span class="linenos">1629</span></a> <span class="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 class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1630"><a href="#L-1630"><span class="linenos">1630</span></a> +</span><span id="L-1631"><a href="#L-1631"><span class="linenos">1631</span></a> +</span><span id="L-1632"><a href="#L-1632"><span class="linenos">1632</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-1633"><a href="#L-1633"><span class="linenos">1633</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1634"><a href="#L-1634"><span class="linenos">1634</span></a> +</span><span id="L-1635"><a href="#L-1635"><span class="linenos">1635</span></a> <span class="nd">@property</span> +</span><span id="L-1636"><a href="#L-1636"><span class="linenos">1636</span></a> <span class="k">def</span> <span class="nf">hashable_args</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">Any</span><span class="p">:</span> +</span><span id="L-1637"><a href="#L-1637"><span class="linenos">1637</span></a> <span class="k">return</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="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"is_string"</span><span class="p">))</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="nd">@classmethod</span> +</span><span id="L-1640"><a href="#L-1640"><span class="linenos">1640</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-1641"><a href="#L-1641"><span class="linenos">1641</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-1642"><a href="#L-1642"><span class="linenos">1642</span></a> +</span><span id="L-1643"><a href="#L-1643"><span class="linenos">1643</span></a> <span class="nd">@classmethod</span> +</span><span id="L-1644"><a href="#L-1644"><span class="linenos">1644</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-1645"><a href="#L-1645"><span class="linenos">1645</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-1646"><a href="#L-1646"><span class="linenos">1646</span></a> +</span><span id="L-1647"><a href="#L-1647"><span class="linenos">1647</span></a> <span class="nd">@property</span> +</span><span id="L-1648"><a href="#L-1648"><span class="linenos">1648</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-1649"><a href="#L-1649"><span class="linenos">1649</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-1650"><a href="#L-1650"><span class="linenos">1650</span></a> +</span><span id="L-1651"><a href="#L-1651"><span class="linenos">1651</span></a> +</span><span id="L-1652"><a href="#L-1652"><span class="linenos">1652</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-1653"><a href="#L-1653"><span class="linenos">1653</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1654"><a href="#L-1654"><span class="linenos">1654</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1655"><a href="#L-1655"><span class="linenos">1655</span></a> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1656"><a href="#L-1656"><span class="linenos">1656</span></a> <span class="s2">"side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1657"><a href="#L-1657"><span class="linenos">1657</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1658"><a href="#L-1658"><span class="linenos">1658</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1659"><a href="#L-1659"><span class="linenos">1659</span></a> <span class="s2">"method"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1660"><a href="#L-1660"><span class="linenos">1660</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1661"><a href="#L-1661"><span class="linenos">1661</span></a> <span class="s2">"hint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1662"><a href="#L-1662"><span class="linenos">1662</span></a> <span class="p">}</span> +</span><span id="L-1663"><a href="#L-1663"><span class="linenos">1663</span></a> +</span><span id="L-1664"><a href="#L-1664"><span class="linenos">1664</span></a> <span class="nd">@property</span> +</span><span id="L-1665"><a href="#L-1665"><span class="linenos">1665</span></a> <span class="k">def</span> <span class="nf">method</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-1666"><a href="#L-1666"><span class="linenos">1666</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">"method"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</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="nd">@property</span> +</span><span id="L-1669"><a href="#L-1669"><span class="linenos">1669</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-1670"><a href="#L-1670"><span class="linenos">1670</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-1671"><a href="#L-1671"><span class="linenos">1671</span></a> +</span><span id="L-1672"><a href="#L-1672"><span class="linenos">1672</span></a> <span class="nd">@property</span> +</span><span id="L-1673"><a href="#L-1673"><span class="linenos">1673</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-1674"><a href="#L-1674"><span class="linenos">1674</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-1675"><a href="#L-1675"><span class="linenos">1675</span></a> +</span><span id="L-1676"><a href="#L-1676"><span class="linenos">1676</span></a> <span class="nd">@property</span> +</span><span id="L-1677"><a href="#L-1677"><span class="linenos">1677</span></a> <span class="k">def</span> <span class="nf">hint</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-1678"><a href="#L-1678"><span class="linenos">1678</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">"hint"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="L-1679"><a href="#L-1679"><span class="linenos">1679</span></a> +</span><span id="L-1680"><a href="#L-1680"><span class="linenos">1680</span></a> <span class="nd">@property</span> +</span><span id="L-1681"><a href="#L-1681"><span class="linenos">1681</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-1682"><a href="#L-1682"><span class="linenos">1682</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-1683"><a href="#L-1683"><span class="linenos">1683</span></a> +</span><span id="L-1684"><a href="#L-1684"><span class="linenos">1684</span></a> <span class="k">def</span> <span class="nf">on</span><span class="p">(</span> +</span><span id="L-1685"><a href="#L-1685"><span class="linenos">1685</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-1686"><a href="#L-1686"><span class="linenos">1686</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-1687"><a href="#L-1687"><span class="linenos">1687</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-1688"><a href="#L-1688"><span class="linenos">1688</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-1689"><a href="#L-1689"><span class="linenos">1689</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-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 class="o">-></span> <span class="n">Join</span><span class="p">:</span> +</span><span id="L-1692"><a href="#L-1692"><span class="linenos">1692</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1693"><a href="#L-1693"><span class="linenos">1693</span></a><span class="sd"> Append to or set the ON expressions.</span> +</span><span id="L-1694"><a href="#L-1694"><span class="linenos">1694</span></a> +</span><span id="L-1695"><a href="#L-1695"><span class="linenos">1695</span></a><span class="sd"> Example:</span> +</span><span id="L-1696"><a href="#L-1696"><span class="linenos">1696</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-1697"><a href="#L-1697"><span class="linenos">1697</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()</span> +</span><span id="L-1698"><a href="#L-1698"><span class="linenos">1698</span></a><span class="sd"> 'JOIN x ON y = 1'</span> +</span><span id="L-1699"><a href="#L-1699"><span class="linenos">1699</span></a> +</span><span id="L-1700"><a href="#L-1700"><span class="linenos">1700</span></a><span class="sd"> Args:</span> +</span><span id="L-1701"><a href="#L-1701"><span class="linenos">1701</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-1702"><a href="#L-1702"><span class="linenos">1702</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-1703"><a href="#L-1703"><span class="linenos">1703</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="L-1704"><a href="#L-1704"><span class="linenos">1704</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> +</span><span id="L-1705"><a href="#L-1705"><span class="linenos">1705</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="L-1706"><a href="#L-1706"><span class="linenos">1706</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-1707"><a href="#L-1707"><span class="linenos">1707</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-1708"><a href="#L-1708"><span class="linenos">1708</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</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="sd"> Returns:</span> +</span><span id="L-1711"><a href="#L-1711"><span class="linenos">1711</span></a><span class="sd"> The modified Join expression.</span> +</span><span id="L-1712"><a href="#L-1712"><span class="linenos">1712</span></a><span class="sd"> """</span> +</span><span id="L-1713"><a href="#L-1713"><span class="linenos">1713</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-1714"><a href="#L-1714"><span class="linenos">1714</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-1715"><a href="#L-1715"><span class="linenos">1715</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-1716"><a href="#L-1716"><span class="linenos">1716</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"on"</span><span class="p">,</span> +</span><span id="L-1717"><a href="#L-1717"><span class="linenos">1717</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-1718"><a href="#L-1718"><span class="linenos">1718</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-1719"><a href="#L-1719"><span class="linenos">1719</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-1720"><a href="#L-1720"><span class="linenos">1720</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1721"><a href="#L-1721"><span class="linenos">1721</span></a> <span class="p">)</span> +</span><span id="L-1722"><a href="#L-1722"><span class="linenos">1722</span></a> +</span><span id="L-1723"><a href="#L-1723"><span class="linenos">1723</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-1724"><a href="#L-1724"><span class="linenos">1724</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-1725"><a href="#L-1725"><span class="linenos">1725</span></a> +</span><span id="L-1726"><a href="#L-1726"><span class="linenos">1726</span></a> <span class="k">return</span> <span class="n">join</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">return</span> <span class="n">join</span> -</span><span id="L-1729"><a href="#L-1729"><span class="linenos">1729</span></a> -</span><span id="L-1730"><a href="#L-1730"><span class="linenos">1730</span></a> <span class="k">def</span> <span class="nf">using</span><span class="p">(</span> -</span><span id="L-1731"><a href="#L-1731"><span class="linenos">1731</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-1732"><a href="#L-1732"><span class="linenos">1732</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-1733"><a href="#L-1733"><span class="linenos">1733</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-1734"><a href="#L-1734"><span class="linenos">1734</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-1735"><a href="#L-1735"><span class="linenos">1735</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-1736"><a href="#L-1736"><span class="linenos">1736</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1737"><a href="#L-1737"><span class="linenos">1737</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Join</span><span class="p">:</span> -</span><span id="L-1738"><a href="#L-1738"><span class="linenos">1738</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1739"><a href="#L-1739"><span class="linenos">1739</span></a><span class="sd"> Append to or set the USING expressions.</span> -</span><span id="L-1740"><a href="#L-1740"><span class="linenos">1740</span></a> -</span><span id="L-1741"><a href="#L-1741"><span class="linenos">1741</span></a><span class="sd"> Example:</span> -</span><span id="L-1742"><a href="#L-1742"><span class="linenos">1742</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-1743"><a href="#L-1743"><span class="linenos">1743</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()</span> -</span><span id="L-1744"><a href="#L-1744"><span class="linenos">1744</span></a><span class="sd"> 'JOIN x USING (foo, bla)'</span> -</span><span id="L-1745"><a href="#L-1745"><span class="linenos">1745</span></a> -</span><span id="L-1746"><a href="#L-1746"><span class="linenos">1746</span></a><span class="sd"> Args:</span> -</span><span id="L-1747"><a href="#L-1747"><span class="linenos">1747</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-1748"><a href="#L-1748"><span class="linenos">1748</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-1749"><a href="#L-1749"><span class="linenos">1749</span></a><span class="sd"> append: if `True`, concatenate the new expressions to the existing "using" list.</span> -</span><span id="L-1750"><a href="#L-1750"><span class="linenos">1750</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="L-1751"><a href="#L-1751"><span class="linenos">1751</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-1752"><a href="#L-1752"><span class="linenos">1752</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-1753"><a href="#L-1753"><span class="linenos">1753</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-1754"><a href="#L-1754"><span class="linenos">1754</span></a> -</span><span id="L-1755"><a href="#L-1755"><span class="linenos">1755</span></a><span class="sd"> Returns:</span> -</span><span id="L-1756"><a href="#L-1756"><span class="linenos">1756</span></a><span class="sd"> The modified Join expression.</span> -</span><span id="L-1757"><a href="#L-1757"><span class="linenos">1757</span></a><span class="sd"> """</span> -</span><span id="L-1758"><a href="#L-1758"><span class="linenos">1758</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-1759"><a href="#L-1759"><span class="linenos">1759</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-1760"><a href="#L-1760"><span class="linenos">1760</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-1761"><a href="#L-1761"><span class="linenos">1761</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> -</span><span id="L-1762"><a href="#L-1762"><span class="linenos">1762</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-1763"><a href="#L-1763"><span class="linenos">1763</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1764"><a href="#L-1764"><span class="linenos">1764</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-1765"><a href="#L-1765"><span class="linenos">1765</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1766"><a href="#L-1766"><span class="linenos">1766</span></a> <span class="p">)</span> -</span><span id="L-1767"><a href="#L-1767"><span class="linenos">1767</span></a> -</span><span id="L-1768"><a href="#L-1768"><span class="linenos">1768</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-1769"><a href="#L-1769"><span class="linenos">1769</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-1728"><a href="#L-1728"><span class="linenos">1728</span></a> <span class="k">def</span> <span class="nf">using</span><span class="p">(</span> +</span><span id="L-1729"><a href="#L-1729"><span class="linenos">1729</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-1730"><a href="#L-1730"><span class="linenos">1730</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-1731"><a href="#L-1731"><span class="linenos">1731</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-1732"><a href="#L-1732"><span class="linenos">1732</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-1733"><a href="#L-1733"><span class="linenos">1733</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-1734"><a href="#L-1734"><span class="linenos">1734</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1735"><a href="#L-1735"><span class="linenos">1735</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Join</span><span class="p">:</span> +</span><span id="L-1736"><a href="#L-1736"><span class="linenos">1736</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1737"><a href="#L-1737"><span class="linenos">1737</span></a><span class="sd"> Append to or set the USING expressions.</span> +</span><span id="L-1738"><a href="#L-1738"><span class="linenos">1738</span></a> +</span><span id="L-1739"><a href="#L-1739"><span class="linenos">1739</span></a><span class="sd"> Example:</span> +</span><span id="L-1740"><a href="#L-1740"><span class="linenos">1740</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-1741"><a href="#L-1741"><span class="linenos">1741</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()</span> +</span><span id="L-1742"><a href="#L-1742"><span class="linenos">1742</span></a><span class="sd"> 'JOIN x USING (foo, bla)'</span> +</span><span id="L-1743"><a href="#L-1743"><span class="linenos">1743</span></a> +</span><span id="L-1744"><a href="#L-1744"><span class="linenos">1744</span></a><span class="sd"> Args:</span> +</span><span id="L-1745"><a href="#L-1745"><span class="linenos">1745</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-1746"><a href="#L-1746"><span class="linenos">1746</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-1747"><a href="#L-1747"><span class="linenos">1747</span></a><span class="sd"> append: if `True`, concatenate the new expressions to the existing "using" list.</span> +</span><span id="L-1748"><a href="#L-1748"><span class="linenos">1748</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="L-1749"><a href="#L-1749"><span class="linenos">1749</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-1750"><a href="#L-1750"><span class="linenos">1750</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-1751"><a href="#L-1751"><span class="linenos">1751</span></a><span class="sd"> opts: other options to use to parse the input expressions.</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 class="sd"> Returns:</span> +</span><span id="L-1754"><a href="#L-1754"><span class="linenos">1754</span></a><span class="sd"> The modified Join expression.</span> +</span><span id="L-1755"><a href="#L-1755"><span class="linenos">1755</span></a><span class="sd"> """</span> +</span><span id="L-1756"><a href="#L-1756"><span class="linenos">1756</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-1757"><a href="#L-1757"><span class="linenos">1757</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-1758"><a href="#L-1758"><span class="linenos">1758</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-1759"><a href="#L-1759"><span class="linenos">1759</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> +</span><span id="L-1760"><a href="#L-1760"><span class="linenos">1760</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-1761"><a href="#L-1761"><span class="linenos">1761</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-1762"><a href="#L-1762"><span class="linenos">1762</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-1763"><a href="#L-1763"><span class="linenos">1763</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1764"><a href="#L-1764"><span class="linenos">1764</span></a> <span class="p">)</span> +</span><span id="L-1765"><a href="#L-1765"><span class="linenos">1765</span></a> +</span><span id="L-1766"><a href="#L-1766"><span class="linenos">1766</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-1767"><a href="#L-1767"><span class="linenos">1767</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-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="k">return</span> <span class="n">join</span> </span><span id="L-1770"><a href="#L-1770"><span class="linenos">1770</span></a> -</span><span id="L-1771"><a href="#L-1771"><span class="linenos">1771</span></a> <span class="k">return</span> <span class="n">join</span> -</span><span id="L-1772"><a href="#L-1772"><span class="linenos">1772</span></a> -</span><span id="L-1773"><a href="#L-1773"><span class="linenos">1773</span></a> -</span><span id="L-1774"><a href="#L-1774"><span class="linenos">1774</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-1775"><a href="#L-1775"><span class="linenos">1775</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1776"><a href="#L-1776"><span class="linenos">1776</span></a> -</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="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-1779"><a href="#L-1779"><span class="linenos">1779</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1780"><a href="#L-1780"><span class="linenos">1780</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-1781"><a href="#L-1781"><span class="linenos">1781</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1782"><a href="#L-1782"><span class="linenos">1782</span></a> <span class="s2">"measures"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1783"><a href="#L-1783"><span class="linenos">1783</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1784"><a href="#L-1784"><span class="linenos">1784</span></a> <span class="s2">"after"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1785"><a href="#L-1785"><span class="linenos">1785</span></a> <span class="s2">"pattern"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1786"><a href="#L-1786"><span class="linenos">1786</span></a> <span class="s2">"define"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1787"><a href="#L-1787"><span class="linenos">1787</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1788"><a href="#L-1788"><span class="linenos">1788</span></a> <span class="p">}</span> -</span><span id="L-1789"><a href="#L-1789"><span class="linenos">1789</span></a> -</span><span id="L-1790"><a href="#L-1790"><span class="linenos">1790</span></a> -</span><span id="L-1791"><a href="#L-1791"><span class="linenos">1791</span></a><span class="c1"># Clickhouse FROM FINAL modifier</span> -</span><span id="L-1792"><a href="#L-1792"><span class="linenos">1792</span></a><span class="c1"># https://clickhouse.com/docs/en/sql-reference/statements/select/from/#final-modifier</span> -</span><span id="L-1793"><a href="#L-1793"><span class="linenos">1793</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-1794"><a href="#L-1794"><span class="linenos">1794</span></a> <span class="k">pass</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><span id="L-1797"><a href="#L-1797"><span class="linenos">1797</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-1798"><a href="#L-1798"><span class="linenos">1798</span></a> <span class="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-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><span id="L-1801"><a href="#L-1801"><span class="linenos">1801</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-1802"><a href="#L-1802"><span class="linenos">1802</span></a> <span class="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-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="c1"># hive specific sorts</span> -</span><span id="L-1806"><a href="#L-1806"><span class="linenos">1806</span></a><span class="c1"># https://cwiki.apache.org/confluence/display/Hive/LanguageManual+SortBy</span> -</span><span id="L-1807"><a href="#L-1807"><span class="linenos">1807</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-1808"><a href="#L-1808"><span class="linenos">1808</span></a> <span class="k">pass</span> -</span><span id="L-1809"><a href="#L-1809"><span class="linenos">1809</span></a> -</span><span id="L-1810"><a href="#L-1810"><span class="linenos">1810</span></a> -</span><span id="L-1811"><a href="#L-1811"><span class="linenos">1811</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-1812"><a href="#L-1812"><span class="linenos">1812</span></a> <span class="k">pass</span> -</span><span id="L-1813"><a href="#L-1813"><span class="linenos">1813</span></a> -</span><span id="L-1814"><a href="#L-1814"><span class="linenos">1814</span></a> -</span><span id="L-1815"><a href="#L-1815"><span class="linenos">1815</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-1816"><a href="#L-1816"><span class="linenos">1816</span></a> <span class="k">pass</span> -</span><span id="L-1817"><a href="#L-1817"><span class="linenos">1817</span></a> -</span><span id="L-1818"><a href="#L-1818"><span class="linenos">1818</span></a> -</span><span id="L-1819"><a href="#L-1819"><span class="linenos">1819</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-1820"><a href="#L-1820"><span class="linenos">1820</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-1823"><a href="#L-1823"><span class="linenos">1823</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-1824"><a href="#L-1824"><span class="linenos">1824</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1825"><a href="#L-1825"><span class="linenos">1825</span></a> -</span><span id="L-1826"><a href="#L-1826"><span class="linenos">1826</span></a> -</span><span id="L-1827"><a href="#L-1827"><span class="linenos">1827</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-1828"><a href="#L-1828"><span class="linenos">1828</span></a> <span class="n">arg_types</span> <span class="o">=</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-1829"><a href="#L-1829"><span class="linenos">1829</span></a> -</span><span id="L-1830"><a href="#L-1830"><span class="linenos">1830</span></a> -</span><span id="L-1831"><a href="#L-1831"><span class="linenos">1831</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-1832"><a href="#L-1832"><span class="linenos">1832</span></a> <span class="n">arg_types</span> <span class="o">=</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-1833"><a href="#L-1833"><span class="linenos">1833</span></a> -</span><span id="L-1834"><a href="#L-1834"><span class="linenos">1834</span></a> -</span><span id="L-1835"><a href="#L-1835"><span class="linenos">1835</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-1836"><a href="#L-1836"><span class="linenos">1836</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-1837"><a href="#L-1837"><span class="linenos">1837</span></a> -</span><span id="L-1838"><a href="#L-1838"><span class="linenos">1838</span></a> -</span><span id="L-1839"><a href="#L-1839"><span class="linenos">1839</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-1840"><a href="#L-1840"><span class="linenos">1840</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1841"><a href="#L-1841"><span class="linenos">1841</span></a> -</span><span id="L-1842"><a href="#L-1842"><span class="linenos">1842</span></a> -</span><span id="L-1843"><a href="#L-1843"><span class="linenos">1843</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-1844"><a href="#L-1844"><span class="linenos">1844</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-1845"><a href="#L-1845"><span class="linenos">1845</span></a> -</span><span id="L-1846"><a href="#L-1846"><span class="linenos">1846</span></a> -</span><span id="L-1847"><a href="#L-1847"><span class="linenos">1847</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-1848"><a href="#L-1848"><span class="linenos">1848</span></a> <span class="n">arg_types</span> <span class="o">=</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-1849"><a href="#L-1849"><span class="linenos">1849</span></a> -</span><span id="L-1850"><a href="#L-1850"><span class="linenos">1850</span></a> -</span><span id="L-1851"><a href="#L-1851"><span class="linenos">1851</span></a><span class="k">class</span> <span class="nc">CopyGrantsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1852"><a href="#L-1852"><span class="linenos">1852</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{}</span> -</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><span id="L-1855"><a href="#L-1855"><span class="linenos">1855</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-1856"><a href="#L-1856"><span class="linenos">1856</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1857"><a href="#L-1857"><span class="linenos">1857</span></a> <span class="s2">"size"</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">"units"</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">"minimum"</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">"maximum"</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">"default"</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="p">}</span> -</span><span id="L-1863"><a href="#L-1863"><span class="linenos">1863</span></a> -</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">class</span> <span class="nc">DefinerProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1866"><a href="#L-1866"><span class="linenos">1866</span></a> <span class="n">arg_types</span> <span class="o">=</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-1867"><a href="#L-1867"><span class="linenos">1867</span></a> -</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="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-1870"><a href="#L-1870"><span class="linenos">1870</span></a> <span class="n">arg_types</span> <span class="o">=</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-1871"><a href="#L-1871"><span class="linenos">1871</span></a> -</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="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-1874"><a href="#L-1874"><span class="linenos">1874</span></a> <span class="n">arg_types</span> <span class="o">=</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-1875"><a href="#L-1875"><span class="linenos">1875</span></a> -</span><span id="L-1876"><a href="#L-1876"><span class="linenos">1876</span></a> -</span><span id="L-1877"><a href="#L-1877"><span class="linenos">1877</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-1878"><a href="#L-1878"><span class="linenos">1878</span></a> <span class="n">arg_types</span> <span class="o">=</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-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><span id="L-1881"><a href="#L-1881"><span class="linenos">1881</span></a><span class="k">class</span> <span class="nc">ToTableProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1882"><a href="#L-1882"><span class="linenos">1882</span></a> <span class="n">arg_types</span> <span class="o">=</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-1883"><a href="#L-1883"><span class="linenos">1883</span></a> -</span><span id="L-1884"><a href="#L-1884"><span class="linenos">1884</span></a> -</span><span id="L-1885"><a href="#L-1885"><span class="linenos">1885</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-1886"><a href="#L-1886"><span class="linenos">1886</span></a> <span class="n">arg_types</span> <span class="o">=</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-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><span id="L-1889"><a href="#L-1889"><span class="linenos">1889</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-1890"><a href="#L-1890"><span class="linenos">1890</span></a> <span class="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-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><span id="L-1893"><a href="#L-1893"><span class="linenos">1893</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-1894"><a href="#L-1894"><span class="linenos">1894</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-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><span id="L-1897"><a href="#L-1897"><span class="linenos">1897</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-1898"><a href="#L-1898"><span class="linenos">1898</span></a> <span class="n">arg_types</span> <span class="o">=</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-1899"><a href="#L-1899"><span class="linenos">1899</span></a> -</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 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-1902"><a href="#L-1902"><span class="linenos">1902</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1903"><a href="#L-1903"><span class="linenos">1903</span></a> -</span><span id="L-1904"><a href="#L-1904"><span class="linenos">1904</span></a> -</span><span id="L-1905"><a href="#L-1905"><span class="linenos">1905</span></a><span class="k">class</span> <span class="nc">InputOutputFormat</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1906"><a href="#L-1906"><span class="linenos">1906</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"input_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"output_format"</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><span id="L-1908"><a href="#L-1908"><span class="linenos">1908</span></a> -</span><span id="L-1909"><a href="#L-1909"><span class="linenos">1909</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-1910"><a href="#L-1910"><span class="linenos">1910</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1911"><a href="#L-1911"><span class="linenos">1911</span></a> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1912"><a href="#L-1912"><span class="linenos">1912</span></a> <span class="s2">"concurrent"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1913"><a href="#L-1913"><span class="linenos">1913</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-1914"><a href="#L-1914"><span class="linenos">1914</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-1915"><a href="#L-1915"><span class="linenos">1915</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-1916"><a href="#L-1916"><span class="linenos">1916</span></a> <span class="p">}</span> -</span><span id="L-1917"><a href="#L-1917"><span class="linenos">1917</span></a> -</span><span id="L-1918"><a href="#L-1918"><span class="linenos">1918</span></a> -</span><span id="L-1919"><a href="#L-1919"><span class="linenos">1919</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-1920"><a href="#L-1920"><span class="linenos">1920</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1921"><a href="#L-1921"><span class="linenos">1921</span></a> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1922"><a href="#L-1922"><span class="linenos">1922</span></a> <span class="s2">"dual"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1923"><a href="#L-1923"><span class="linenos">1923</span></a> <span class="s2">"before"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1924"><a href="#L-1924"><span class="linenos">1924</span></a> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1925"><a href="#L-1925"><span class="linenos">1925</span></a> <span class="s2">"after"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1926"><a href="#L-1926"><span class="linenos">1926</span></a> <span class="p">}</span> -</span><span id="L-1927"><a href="#L-1927"><span class="linenos">1927</span></a> -</span><span id="L-1928"><a href="#L-1928"><span class="linenos">1928</span></a> -</span><span id="L-1929"><a href="#L-1929"><span class="linenos">1929</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-1930"><a href="#L-1930"><span class="linenos">1930</span></a> <span class="n">arg_types</span> <span class="o">=</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-1931"><a href="#L-1931"><span class="linenos">1931</span></a> -</span><span id="L-1932"><a href="#L-1932"><span class="linenos">1932</span></a> -</span><span id="L-1933"><a href="#L-1933"><span class="linenos">1933</span></a><span class="c1"># spark ddl</span> -</span><span id="L-1934"><a href="#L-1934"><span class="linenos">1934</span></a><span class="k">class</span> <span class="nc">ClusteredByProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1935"><a href="#L-1935"><span class="linenos">1935</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">"sorted_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"buckets"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1936"><a href="#L-1936"><span class="linenos">1936</span></a> -</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="k">class</span> <span class="nc">DictProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1939"><a href="#L-1939"><span class="linenos">1939</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">True</span><span class="p">,</span> <span class="s2">"settings"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1940"><a href="#L-1940"><span class="linenos">1940</span></a> -</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="k">class</span> <span class="nc">DictSubProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1943"><a href="#L-1943"><span class="linenos">1943</span></a> <span class="k">pass</span> -</span><span id="L-1944"><a href="#L-1944"><span class="linenos">1944</span></a> -</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">class</span> <span class="nc">DictRange</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1947"><a href="#L-1947"><span class="linenos">1947</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"min"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"max"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1948"><a href="#L-1948"><span class="linenos">1948</span></a> -</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="c1"># Clickhouse CREATE ... ON CLUSTER modifier</span> -</span><span id="L-1951"><a href="#L-1951"><span class="linenos">1951</span></a><span class="c1"># https://clickhouse.com/docs/en/sql-reference/distributed-ddl</span> -</span><span id="L-1952"><a href="#L-1952"><span class="linenos">1952</span></a><span class="k">class</span> <span class="nc">OnCluster</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1953"><a href="#L-1953"><span class="linenos">1953</span></a> <span class="n">arg_types</span> <span class="o">=</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-1954"><a href="#L-1954"><span class="linenos">1954</span></a> -</span><span id="L-1955"><a href="#L-1955"><span class="linenos">1955</span></a> -</span><span id="L-1956"><a href="#L-1956"><span class="linenos">1956</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-1957"><a href="#L-1957"><span class="linenos">1957</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1958"><a href="#L-1958"><span class="linenos">1958</span></a> -</span><span id="L-1959"><a href="#L-1959"><span class="linenos">1959</span></a> -</span><span id="L-1960"><a href="#L-1960"><span class="linenos">1960</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-1961"><a href="#L-1961"><span class="linenos">1961</span></a> <span class="n">arg_types</span> <span class="o">=</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-1962"><a href="#L-1962"><span class="linenos">1962</span></a> -</span><span id="L-1963"><a href="#L-1963"><span class="linenos">1963</span></a> -</span><span id="L-1964"><a href="#L-1964"><span class="linenos">1964</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-1965"><a href="#L-1965"><span class="linenos">1965</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1966"><a href="#L-1966"><span class="linenos">1966</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1967"><a href="#L-1967"><span class="linenos">1967</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1968"><a href="#L-1968"><span class="linenos">1968</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-1969"><a href="#L-1969"><span class="linenos">1969</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-1970"><a href="#L-1970"><span class="linenos">1970</span></a> <span class="s2">"override"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1971"><a href="#L-1971"><span class="linenos">1971</span></a> <span class="p">}</span> -</span><span id="L-1972"><a href="#L-1972"><span class="linenos">1972</span></a> -</span><span id="L-1973"><a href="#L-1973"><span class="linenos">1973</span></a> -</span><span id="L-1974"><a href="#L-1974"><span class="linenos">1974</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-1975"><a href="#L-1975"><span class="linenos">1975</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-1976"><a href="#L-1976"><span class="linenos">1976</span></a> -</span><span id="L-1977"><a href="#L-1977"><span class="linenos">1977</span></a> -</span><span id="L-1978"><a href="#L-1978"><span class="linenos">1978</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-1979"><a href="#L-1979"><span class="linenos">1979</span></a> <span class="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-1980"><a href="#L-1980"><span class="linenos">1980</span></a> -</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">class</span> <span class="nc">MergeBlockRatioProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1983"><a href="#L-1983"><span class="linenos">1983</span></a> <span class="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-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><span id="L-1986"><a href="#L-1986"><span class="linenos">1986</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-1987"><a href="#L-1987"><span class="linenos">1987</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{}</span> -</span><span id="L-1988"><a href="#L-1988"><span class="linenos">1988</span></a> -</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="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-1991"><a href="#L-1991"><span class="linenos">1991</span></a> <span class="n">arg_type</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1992"><a href="#L-1992"><span class="linenos">1992</span></a> -</span><span id="L-1993"><a href="#L-1993"><span class="linenos">1993</span></a> -</span><span id="L-1994"><a href="#L-1994"><span class="linenos">1994</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-1995"><a href="#L-1995"><span class="linenos">1995</span></a> <span class="n">arg_types</span> <span class="o">=</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-1996"><a href="#L-1996"><span class="linenos">1996</span></a> -</span><span id="L-1997"><a href="#L-1997"><span class="linenos">1997</span></a> -</span><span id="L-1998"><a href="#L-1998"><span class="linenos">1998</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-1999"><a href="#L-1999"><span class="linenos">1999</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-2000"><a href="#L-2000"><span class="linenos">2000</span></a> -</span><span id="L-2001"><a href="#L-2001"><span class="linenos">2001</span></a> -</span><span id="L-2002"><a href="#L-2002"><span class="linenos">2002</span></a><span class="k">class</span> <span class="nc">RowFormatProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-2003"><a href="#L-2003"><span class="linenos">2003</span></a> <span class="n">arg_types</span> <span class="o">=</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-2004"><a href="#L-2004"><span class="linenos">2004</span></a> -</span><span id="L-2005"><a href="#L-2005"><span class="linenos">2005</span></a> -</span><span id="L-2006"><a href="#L-2006"><span class="linenos">2006</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-2007"><a href="#L-2007"><span class="linenos">2007</span></a> <span class="c1"># https://cwiki.apache.org/confluence/display/hive/languagemanual+dml</span> -</span><span id="L-2008"><a href="#L-2008"><span class="linenos">2008</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2009"><a href="#L-2009"><span class="linenos">2009</span></a> <span class="s2">"fields"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2010"><a href="#L-2010"><span class="linenos">2010</span></a> <span class="s2">"escaped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2011"><a href="#L-2011"><span class="linenos">2011</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-2012"><a href="#L-2012"><span class="linenos">2012</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-2013"><a href="#L-2013"><span class="linenos">2013</span></a> <span class="s2">"lines"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2014"><a href="#L-2014"><span class="linenos">2014</span></a> <span class="s2">"null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2015"><a href="#L-2015"><span class="linenos">2015</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2016"><a href="#L-2016"><span class="linenos">2016</span></a> <span class="p">}</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><span id="L-2019"><a href="#L-2019"><span class="linenos">2019</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-2020"><a href="#L-2020"><span class="linenos">2020</span></a> <span class="n">arg_types</span> <span class="o">=</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-2021"><a href="#L-2021"><span class="linenos">2021</span></a> -</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="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-2024"><a href="#L-2024"><span class="linenos">2024</span></a> <span class="n">arg_types</span> <span class="o">=</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-2025"><a href="#L-2025"><span class="linenos">2025</span></a> -</span><span id="L-2026"><a href="#L-2026"><span class="linenos">2026</span></a> -</span><span id="L-2027"><a href="#L-2027"><span class="linenos">2027</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-2028"><a href="#L-2028"><span class="linenos">2028</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-2029"><a href="#L-2029"><span class="linenos">2029</span></a> -</span><span id="L-2030"><a href="#L-2030"><span class="linenos">2030</span></a> -</span><span id="L-2031"><a href="#L-2031"><span class="linenos">2031</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-2032"><a href="#L-2032"><span class="linenos">2032</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-2033"><a href="#L-2033"><span class="linenos">2033</span></a> -</span><span id="L-2034"><a href="#L-2034"><span class="linenos">2034</span></a> -</span><span id="L-2035"><a href="#L-2035"><span class="linenos">2035</span></a><span class="k">class</span> <span class="nc">SettingsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-2036"><a href="#L-2036"><span class="linenos">2036</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-2037"><a href="#L-2037"><span class="linenos">2037</span></a> -</span><span id="L-2038"><a href="#L-2038"><span class="linenos">2038</span></a> -</span><span id="L-2039"><a href="#L-2039"><span class="linenos">2039</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-2040"><a href="#L-2040"><span class="linenos">2040</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-2041"><a href="#L-2041"><span class="linenos">2041</span></a> -</span><span id="L-2042"><a href="#L-2042"><span class="linenos">2042</span></a> -</span><span id="L-2043"><a href="#L-2043"><span class="linenos">2043</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-2044"><a href="#L-2044"><span class="linenos">2044</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-2045"><a href="#L-2045"><span class="linenos">2045</span></a> -</span><span id="L-2046"><a href="#L-2046"><span class="linenos">2046</span></a> -</span><span id="L-2047"><a href="#L-2047"><span class="linenos">2047</span></a><span class="k">class</span> <span class="nc">StabilityProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-2048"><a href="#L-2048"><span class="linenos">2048</span></a> <span class="n">arg_types</span> <span class="o">=</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-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><span id="L-2051"><a href="#L-2051"><span class="linenos">2051</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-2052"><a href="#L-2052"><span class="linenos">2052</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{}</span> -</span><span id="L-2053"><a href="#L-2053"><span class="linenos">2053</span></a> -</span><span id="L-2054"><a href="#L-2054"><span class="linenos">2054</span></a> -</span><span id="L-2055"><a href="#L-2055"><span class="linenos">2055</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-2056"><a href="#L-2056"><span class="linenos">2056</span></a> <span class="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-2057"><a href="#L-2057"><span class="linenos">2057</span></a> -</span><span id="L-2058"><a href="#L-2058"><span class="linenos">2058</span></a> -</span><span id="L-2059"><a href="#L-2059"><span class="linenos">2059</span></a><span class="k">class</span> <span class="nc">VolatileProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-2060"><a href="#L-2060"><span class="linenos">2060</span></a> <span class="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-2061"><a href="#L-2061"><span class="linenos">2061</span></a> -</span><span id="L-2062"><a href="#L-2062"><span class="linenos">2062</span></a> -</span><span id="L-2063"><a href="#L-2063"><span class="linenos">2063</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-2064"><a href="#L-2064"><span class="linenos">2064</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-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><span id="L-2067"><a href="#L-2067"><span class="linenos">2067</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-2068"><a href="#L-2068"><span class="linenos">2068</span></a> <span class="n">arg_types</span> <span class="o">=</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-2069"><a href="#L-2069"><span class="linenos">2069</span></a> -</span><span id="L-2070"><a href="#L-2070"><span class="linenos">2070</span></a> -</span><span id="L-2071"><a href="#L-2071"><span class="linenos">2071</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-2072"><a href="#L-2072"><span class="linenos">2072</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-2073"><a href="#L-2073"><span class="linenos">2073</span></a> -</span><span id="L-2074"><a href="#L-2074"><span class="linenos">2074</span></a> <span class="n">NAME_TO_PROPERTY</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2075"><a href="#L-2075"><span class="linenos">2075</span></a> <span class="s2">"ALGORITHM"</span><span class="p">:</span> <span class="n">AlgorithmProperty</span><span class="p">,</span> -</span><span id="L-2076"><a href="#L-2076"><span class="linenos">2076</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-2077"><a href="#L-2077"><span class="linenos">2077</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-2078"><a href="#L-2078"><span class="linenos">2078</span></a> <span class="s2">"CLUSTERED_BY"</span><span class="p">:</span> <span class="n">ClusteredByProperty</span><span class="p">,</span> -</span><span id="L-2079"><a href="#L-2079"><span class="linenos">2079</span></a> <span class="s2">"COLLATE"</span><span class="p">:</span> <span class="n">CollateProperty</span><span class="p">,</span> -</span><span id="L-2080"><a href="#L-2080"><span class="linenos">2080</span></a> <span class="s2">"COMMENT"</span><span class="p">:</span> <span class="n">SchemaCommentProperty</span><span class="p">,</span> -</span><span id="L-2081"><a href="#L-2081"><span class="linenos">2081</span></a> <span class="s2">"DEFINER"</span><span class="p">:</span> <span class="n">DefinerProperty</span><span class="p">,</span> -</span><span id="L-2082"><a href="#L-2082"><span class="linenos">2082</span></a> <span class="s2">"DISTKEY"</span><span class="p">:</span> <span class="n">DistKeyProperty</span><span class="p">,</span> -</span><span id="L-2083"><a href="#L-2083"><span class="linenos">2083</span></a> <span class="s2">"DISTSTYLE"</span><span class="p">:</span> <span class="n">DistStyleProperty</span><span class="p">,</span> -</span><span id="L-2084"><a href="#L-2084"><span class="linenos">2084</span></a> <span class="s2">"ENGINE"</span><span class="p">:</span> <span class="n">EngineProperty</span><span class="p">,</span> -</span><span id="L-2085"><a href="#L-2085"><span class="linenos">2085</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-2086"><a href="#L-2086"><span class="linenos">2086</span></a> <span class="s2">"FORMAT"</span><span class="p">:</span> <span class="n">FileFormatProperty</span><span class="p">,</span> -</span><span id="L-2087"><a href="#L-2087"><span class="linenos">2087</span></a> <span class="s2">"LANGUAGE"</span><span class="p">:</span> <span class="n">LanguageProperty</span><span class="p">,</span> -</span><span id="L-2088"><a href="#L-2088"><span class="linenos">2088</span></a> <span class="s2">"LOCATION"</span><span class="p">:</span> <span class="n">LocationProperty</span><span class="p">,</span> -</span><span id="L-2089"><a href="#L-2089"><span class="linenos">2089</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-2090"><a href="#L-2090"><span class="linenos">2090</span></a> <span class="s2">"RETURNS"</span><span class="p">:</span> <span class="n">ReturnsProperty</span><span class="p">,</span> -</span><span id="L-2091"><a href="#L-2091"><span class="linenos">2091</span></a> <span class="s2">"ROW_FORMAT"</span><span class="p">:</span> <span class="n">RowFormatProperty</span><span class="p">,</span> -</span><span id="L-2092"><a href="#L-2092"><span class="linenos">2092</span></a> <span class="s2">"SORTKEY"</span><span class="p">:</span> <span class="n">SortKeyProperty</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-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">class</span> <span class="nc">Lateral</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> +</span><span id="L-1773"><a href="#L-1773"><span class="linenos">1773</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1774"><a href="#L-1774"><span class="linenos">1774</span></a> +</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="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-1777"><a href="#L-1777"><span class="linenos">1777</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1778"><a href="#L-1778"><span class="linenos">1778</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-1779"><a href="#L-1779"><span class="linenos">1779</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1780"><a href="#L-1780"><span class="linenos">1780</span></a> <span class="s2">"measures"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1781"><a href="#L-1781"><span class="linenos">1781</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1782"><a href="#L-1782"><span class="linenos">1782</span></a> <span class="s2">"after"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1783"><a href="#L-1783"><span class="linenos">1783</span></a> <span class="s2">"pattern"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1784"><a href="#L-1784"><span class="linenos">1784</span></a> <span class="s2">"define"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1785"><a href="#L-1785"><span class="linenos">1785</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1786"><a href="#L-1786"><span class="linenos">1786</span></a> <span class="p">}</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><span id="L-1789"><a href="#L-1789"><span class="linenos">1789</span></a><span class="c1"># Clickhouse FROM FINAL modifier</span> +</span><span id="L-1790"><a href="#L-1790"><span class="linenos">1790</span></a><span class="c1"># https://clickhouse.com/docs/en/sql-reference/statements/select/from/#final-modifier</span> +</span><span id="L-1791"><a href="#L-1791"><span class="linenos">1791</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-1792"><a href="#L-1792"><span class="linenos">1792</span></a> <span class="k">pass</span> +</span><span id="L-1793"><a href="#L-1793"><span class="linenos">1793</span></a> +</span><span id="L-1794"><a href="#L-1794"><span class="linenos">1794</span></a> +</span><span id="L-1795"><a href="#L-1795"><span class="linenos">1795</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-1796"><a href="#L-1796"><span class="linenos">1796</span></a> <span class="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-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><span id="L-1799"><a href="#L-1799"><span class="linenos">1799</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-1800"><a href="#L-1800"><span class="linenos">1800</span></a> <span class="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-1801"><a href="#L-1801"><span class="linenos">1801</span></a> +</span><span id="L-1802"><a href="#L-1802"><span class="linenos">1802</span></a> +</span><span id="L-1803"><a href="#L-1803"><span class="linenos">1803</span></a><span class="c1"># hive specific sorts</span> +</span><span id="L-1804"><a href="#L-1804"><span class="linenos">1804</span></a><span class="c1"># https://cwiki.apache.org/confluence/display/Hive/LanguageManual+SortBy</span> +</span><span id="L-1805"><a href="#L-1805"><span class="linenos">1805</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-1806"><a href="#L-1806"><span class="linenos">1806</span></a> <span class="k">pass</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">Distribute</span><span class="p">(</span><span class="n">Order</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-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">Sort</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> +</span><span id="L-1814"><a href="#L-1814"><span class="linenos">1814</span></a> <span class="k">pass</span> +</span><span id="L-1815"><a href="#L-1815"><span class="linenos">1815</span></a> +</span><span id="L-1816"><a href="#L-1816"><span class="linenos">1816</span></a> +</span><span id="L-1817"><a href="#L-1817"><span class="linenos">1817</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-1818"><a href="#L-1818"><span class="linenos">1818</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1819"><a href="#L-1819"><span class="linenos">1819</span></a> +</span><span id="L-1820"><a href="#L-1820"><span class="linenos">1820</span></a> +</span><span id="L-1821"><a href="#L-1821"><span class="linenos">1821</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-1822"><a href="#L-1822"><span class="linenos">1822</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1823"><a href="#L-1823"><span class="linenos">1823</span></a> +</span><span id="L-1824"><a href="#L-1824"><span class="linenos">1824</span></a> +</span><span id="L-1825"><a href="#L-1825"><span class="linenos">1825</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-1826"><a href="#L-1826"><span class="linenos">1826</span></a> <span class="n">arg_types</span> <span class="o">=</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-1827"><a href="#L-1827"><span class="linenos">1827</span></a> +</span><span id="L-1828"><a href="#L-1828"><span class="linenos">1828</span></a> +</span><span id="L-1829"><a href="#L-1829"><span class="linenos">1829</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-1830"><a href="#L-1830"><span class="linenos">1830</span></a> <span class="n">arg_types</span> <span class="o">=</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-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><span id="L-1833"><a href="#L-1833"><span class="linenos">1833</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-1834"><a href="#L-1834"><span class="linenos">1834</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-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><span id="L-1837"><a href="#L-1837"><span class="linenos">1837</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-1838"><a href="#L-1838"><span class="linenos">1838</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-1841"><a href="#L-1841"><span class="linenos">1841</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-1842"><a href="#L-1842"><span class="linenos">1842</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-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><span id="L-1845"><a href="#L-1845"><span class="linenos">1845</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-1846"><a href="#L-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">True</span><span class="p">}</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><span id="L-1849"><a href="#L-1849"><span class="linenos">1849</span></a><span class="k">class</span> <span class="nc">CopyGrantsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1850"><a href="#L-1850"><span class="linenos">1850</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{}</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 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-1854"><a href="#L-1854"><span class="linenos">1854</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1855"><a href="#L-1855"><span class="linenos">1855</span></a> <span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1856"><a href="#L-1856"><span class="linenos">1856</span></a> <span class="s2">"units"</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">"minimum"</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">"maximum"</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">"default"</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="p">}</span> +</span><span id="L-1861"><a href="#L-1861"><span class="linenos">1861</span></a> +</span><span id="L-1862"><a href="#L-1862"><span class="linenos">1862</span></a> +</span><span id="L-1863"><a href="#L-1863"><span class="linenos">1863</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-1864"><a href="#L-1864"><span class="linenos">1864</span></a> <span class="n">arg_types</span> <span class="o">=</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-1865"><a href="#L-1865"><span class="linenos">1865</span></a> +</span><span id="L-1866"><a href="#L-1866"><span class="linenos">1866</span></a> +</span><span id="L-1867"><a href="#L-1867"><span class="linenos">1867</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-1868"><a href="#L-1868"><span class="linenos">1868</span></a> <span class="n">arg_types</span> <span class="o">=</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-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><span id="L-1871"><a href="#L-1871"><span class="linenos">1871</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-1872"><a href="#L-1872"><span class="linenos">1872</span></a> <span class="n">arg_types</span> <span class="o">=</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-1873"><a href="#L-1873"><span class="linenos">1873</span></a> +</span><span id="L-1874"><a href="#L-1874"><span class="linenos">1874</span></a> +</span><span id="L-1875"><a href="#L-1875"><span class="linenos">1875</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-1876"><a href="#L-1876"><span class="linenos">1876</span></a> <span class="n">arg_types</span> <span class="o">=</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-1877"><a href="#L-1877"><span class="linenos">1877</span></a> +</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 class="k">class</span> <span class="nc">ToTableProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1880"><a href="#L-1880"><span class="linenos">1880</span></a> <span class="n">arg_types</span> <span class="o">=</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-1881"><a href="#L-1881"><span class="linenos">1881</span></a> +</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="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-1884"><a href="#L-1884"><span class="linenos">1884</span></a> <span class="n">arg_types</span> <span class="o">=</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-1885"><a href="#L-1885"><span class="linenos">1885</span></a> +</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 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-1888"><a href="#L-1888"><span class="linenos">1888</span></a> <span class="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-1889"><a href="#L-1889"><span class="linenos">1889</span></a> +</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 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-1892"><a href="#L-1892"><span class="linenos">1892</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-1893"><a href="#L-1893"><span class="linenos">1893</span></a> +</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 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-1896"><a href="#L-1896"><span class="linenos">1896</span></a> <span class="n">arg_types</span> <span class="o">=</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-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><span id="L-1899"><a href="#L-1899"><span class="linenos">1899</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-1900"><a href="#L-1900"><span class="linenos">1900</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-1903"><a href="#L-1903"><span class="linenos">1903</span></a><span class="k">class</span> <span class="nc">InputOutputFormat</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1904"><a href="#L-1904"><span class="linenos">1904</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"input_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"output_format"</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><span id="L-1906"><a href="#L-1906"><span class="linenos">1906</span></a> +</span><span id="L-1907"><a href="#L-1907"><span class="linenos">1907</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-1908"><a href="#L-1908"><span class="linenos">1908</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1909"><a href="#L-1909"><span class="linenos">1909</span></a> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1910"><a href="#L-1910"><span class="linenos">1910</span></a> <span class="s2">"concurrent"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1911"><a href="#L-1911"><span class="linenos">1911</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-1912"><a href="#L-1912"><span class="linenos">1912</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-1913"><a href="#L-1913"><span class="linenos">1913</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-1914"><a href="#L-1914"><span class="linenos">1914</span></a> <span class="p">}</span> +</span><span id="L-1915"><a href="#L-1915"><span class="linenos">1915</span></a> +</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="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-1918"><a href="#L-1918"><span class="linenos">1918</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1919"><a href="#L-1919"><span class="linenos">1919</span></a> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1920"><a href="#L-1920"><span class="linenos">1920</span></a> <span class="s2">"dual"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1921"><a href="#L-1921"><span class="linenos">1921</span></a> <span class="s2">"before"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1922"><a href="#L-1922"><span class="linenos">1922</span></a> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1923"><a href="#L-1923"><span class="linenos">1923</span></a> <span class="s2">"after"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1924"><a href="#L-1924"><span class="linenos">1924</span></a> <span class="p">}</span> +</span><span id="L-1925"><a href="#L-1925"><span class="linenos">1925</span></a> +</span><span id="L-1926"><a href="#L-1926"><span class="linenos">1926</span></a> +</span><span id="L-1927"><a href="#L-1927"><span class="linenos">1927</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-1928"><a href="#L-1928"><span class="linenos">1928</span></a> <span class="n">arg_types</span> <span class="o">=</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-1929"><a href="#L-1929"><span class="linenos">1929</span></a> +</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="c1"># spark ddl</span> +</span><span id="L-1932"><a href="#L-1932"><span class="linenos">1932</span></a><span class="k">class</span> <span class="nc">ClusteredByProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1933"><a href="#L-1933"><span class="linenos">1933</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">"sorted_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"buckets"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1934"><a href="#L-1934"><span class="linenos">1934</span></a> +</span><span id="L-1935"><a href="#L-1935"><span class="linenos">1935</span></a> +</span><span id="L-1936"><a href="#L-1936"><span class="linenos">1936</span></a><span class="k">class</span> <span class="nc">DictProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1937"><a href="#L-1937"><span class="linenos">1937</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">True</span><span class="p">,</span> <span class="s2">"settings"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1938"><a href="#L-1938"><span class="linenos">1938</span></a> +</span><span id="L-1939"><a href="#L-1939"><span class="linenos">1939</span></a> +</span><span id="L-1940"><a href="#L-1940"><span class="linenos">1940</span></a><span class="k">class</span> <span class="nc">DictSubProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1941"><a href="#L-1941"><span class="linenos">1941</span></a> <span class="k">pass</span> +</span><span id="L-1942"><a href="#L-1942"><span class="linenos">1942</span></a> +</span><span id="L-1943"><a href="#L-1943"><span class="linenos">1943</span></a> +</span><span id="L-1944"><a href="#L-1944"><span class="linenos">1944</span></a><span class="k">class</span> <span class="nc">DictRange</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1945"><a href="#L-1945"><span class="linenos">1945</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"min"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"max"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1946"><a href="#L-1946"><span class="linenos">1946</span></a> +</span><span id="L-1947"><a href="#L-1947"><span class="linenos">1947</span></a> +</span><span id="L-1948"><a href="#L-1948"><span class="linenos">1948</span></a><span class="c1"># Clickhouse CREATE ... ON CLUSTER modifier</span> +</span><span id="L-1949"><a href="#L-1949"><span class="linenos">1949</span></a><span class="c1"># https://clickhouse.com/docs/en/sql-reference/distributed-ddl</span> +</span><span id="L-1950"><a href="#L-1950"><span class="linenos">1950</span></a><span class="k">class</span> <span class="nc">OnCluster</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1951"><a href="#L-1951"><span class="linenos">1951</span></a> <span class="n">arg_types</span> <span class="o">=</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-1952"><a href="#L-1952"><span class="linenos">1952</span></a> +</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="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-1955"><a href="#L-1955"><span class="linenos">1955</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1956"><a href="#L-1956"><span class="linenos">1956</span></a> +</span><span id="L-1957"><a href="#L-1957"><span class="linenos">1957</span></a> +</span><span id="L-1958"><a href="#L-1958"><span class="linenos">1958</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-1959"><a href="#L-1959"><span class="linenos">1959</span></a> <span class="n">arg_types</span> <span class="o">=</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-1960"><a href="#L-1960"><span class="linenos">1960</span></a> +</span><span id="L-1961"><a href="#L-1961"><span class="linenos">1961</span></a> +</span><span id="L-1962"><a href="#L-1962"><span class="linenos">1962</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-1963"><a href="#L-1963"><span class="linenos">1963</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1964"><a href="#L-1964"><span class="linenos">1964</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1965"><a href="#L-1965"><span class="linenos">1965</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1966"><a href="#L-1966"><span class="linenos">1966</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-1967"><a href="#L-1967"><span class="linenos">1967</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-1968"><a href="#L-1968"><span class="linenos">1968</span></a> <span class="s2">"override"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1969"><a href="#L-1969"><span class="linenos">1969</span></a> <span class="p">}</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><span id="L-1972"><a href="#L-1972"><span class="linenos">1972</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-1973"><a href="#L-1973"><span class="linenos">1973</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-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><span id="L-1976"><a href="#L-1976"><span class="linenos">1976</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-1977"><a href="#L-1977"><span class="linenos">1977</span></a> <span class="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-1978"><a href="#L-1978"><span class="linenos">1978</span></a> +</span><span id="L-1979"><a href="#L-1979"><span class="linenos">1979</span></a> +</span><span id="L-1980"><a href="#L-1980"><span class="linenos">1980</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-1981"><a href="#L-1981"><span class="linenos">1981</span></a> <span class="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-1982"><a href="#L-1982"><span class="linenos">1982</span></a> +</span><span id="L-1983"><a href="#L-1983"><span class="linenos">1983</span></a> +</span><span id="L-1984"><a href="#L-1984"><span class="linenos">1984</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-1985"><a href="#L-1985"><span class="linenos">1985</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="L-1986"><a href="#L-1986"><span class="linenos">1986</span></a> +</span><span id="L-1987"><a href="#L-1987"><span class="linenos">1987</span></a> +</span><span id="L-1988"><a href="#L-1988"><span class="linenos">1988</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-1989"><a href="#L-1989"><span class="linenos">1989</span></a> <span class="n">arg_type</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1990"><a href="#L-1990"><span class="linenos">1990</span></a> +</span><span id="L-1991"><a href="#L-1991"><span class="linenos">1991</span></a> +</span><span id="L-1992"><a href="#L-1992"><span class="linenos">1992</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-1993"><a href="#L-1993"><span class="linenos">1993</span></a> <span class="n">arg_types</span> <span class="o">=</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-1994"><a href="#L-1994"><span class="linenos">1994</span></a> +</span><span id="L-1995"><a href="#L-1995"><span class="linenos">1995</span></a> +</span><span id="L-1996"><a href="#L-1996"><span class="linenos">1996</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-1997"><a href="#L-1997"><span class="linenos">1997</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1998"><a href="#L-1998"><span class="linenos">1998</span></a> +</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">class</span> <span class="nc">RowFormatProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-2001"><a href="#L-2001"><span class="linenos">2001</span></a> <span class="n">arg_types</span> <span class="o">=</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-2002"><a href="#L-2002"><span class="linenos">2002</span></a> +</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="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-2005"><a href="#L-2005"><span class="linenos">2005</span></a> <span class="c1"># https://cwiki.apache.org/confluence/display/hive/languagemanual+dml</span> +</span><span id="L-2006"><a href="#L-2006"><span class="linenos">2006</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2007"><a href="#L-2007"><span class="linenos">2007</span></a> <span class="s2">"fields"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2008"><a href="#L-2008"><span class="linenos">2008</span></a> <span class="s2">"escaped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2009"><a href="#L-2009"><span class="linenos">2009</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-2010"><a href="#L-2010"><span class="linenos">2010</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-2011"><a href="#L-2011"><span class="linenos">2011</span></a> <span class="s2">"lines"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2012"><a href="#L-2012"><span class="linenos">2012</span></a> <span class="s2">"null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2013"><a href="#L-2013"><span class="linenos">2013</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2014"><a href="#L-2014"><span class="linenos">2014</span></a> <span class="p">}</span> +</span><span id="L-2015"><a href="#L-2015"><span class="linenos">2015</span></a> +</span><span id="L-2016"><a href="#L-2016"><span class="linenos">2016</span></a> +</span><span id="L-2017"><a href="#L-2017"><span class="linenos">2017</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-2018"><a href="#L-2018"><span class="linenos">2018</span></a> <span class="n">arg_types</span> <span class="o">=</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-2019"><a href="#L-2019"><span class="linenos">2019</span></a> +</span><span id="L-2020"><a href="#L-2020"><span class="linenos">2020</span></a> +</span><span id="L-2021"><a href="#L-2021"><span class="linenos">2021</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-2022"><a href="#L-2022"><span class="linenos">2022</span></a> <span class="n">arg_types</span> <span class="o">=</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-2023"><a href="#L-2023"><span class="linenos">2023</span></a> +</span><span id="L-2024"><a href="#L-2024"><span class="linenos">2024</span></a> +</span><span id="L-2025"><a href="#L-2025"><span class="linenos">2025</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-2026"><a href="#L-2026"><span class="linenos">2026</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-2027"><a href="#L-2027"><span class="linenos">2027</span></a> +</span><span id="L-2028"><a href="#L-2028"><span class="linenos">2028</span></a> +</span><span id="L-2029"><a href="#L-2029"><span class="linenos">2029</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-2030"><a href="#L-2030"><span class="linenos">2030</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-2031"><a href="#L-2031"><span class="linenos">2031</span></a> +</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">class</span> <span class="nc">SettingsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-2034"><a href="#L-2034"><span class="linenos">2034</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-2035"><a href="#L-2035"><span class="linenos">2035</span></a> +</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="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-2038"><a href="#L-2038"><span class="linenos">2038</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-2039"><a href="#L-2039"><span class="linenos">2039</span></a> +</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="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-2042"><a href="#L-2042"><span class="linenos">2042</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-2043"><a href="#L-2043"><span class="linenos">2043</span></a> +</span><span id="L-2044"><a href="#L-2044"><span class="linenos">2044</span></a> +</span><span id="L-2045"><a href="#L-2045"><span class="linenos">2045</span></a><span class="k">class</span> <span class="nc">StabilityProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-2046"><a href="#L-2046"><span class="linenos">2046</span></a> <span class="n">arg_types</span> <span class="o">=</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-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><span id="L-2049"><a href="#L-2049"><span class="linenos">2049</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-2050"><a href="#L-2050"><span class="linenos">2050</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{}</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><span id="L-2053"><a href="#L-2053"><span class="linenos">2053</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-2054"><a href="#L-2054"><span class="linenos">2054</span></a> <span class="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-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><span id="L-2057"><a href="#L-2057"><span class="linenos">2057</span></a><span class="k">class</span> <span class="nc">VolatileProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-2058"><a href="#L-2058"><span class="linenos">2058</span></a> <span class="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-2059"><a href="#L-2059"><span class="linenos">2059</span></a> +</span><span id="L-2060"><a href="#L-2060"><span class="linenos">2060</span></a> +</span><span id="L-2061"><a href="#L-2061"><span class="linenos">2061</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-2062"><a href="#L-2062"><span class="linenos">2062</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-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><span id="L-2065"><a href="#L-2065"><span class="linenos">2065</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-2066"><a href="#L-2066"><span class="linenos">2066</span></a> <span class="n">arg_types</span> <span class="o">=</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-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><span id="L-2069"><a href="#L-2069"><span class="linenos">2069</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-2070"><a href="#L-2070"><span class="linenos">2070</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-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="n">NAME_TO_PROPERTY</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2073"><a href="#L-2073"><span class="linenos">2073</span></a> <span class="s2">"ALGORITHM"</span><span class="p">:</span> <span class="n">AlgorithmProperty</span><span class="p">,</span> +</span><span id="L-2074"><a href="#L-2074"><span class="linenos">2074</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-2075"><a href="#L-2075"><span class="linenos">2075</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-2076"><a href="#L-2076"><span class="linenos">2076</span></a> <span class="s2">"CLUSTERED_BY"</span><span class="p">:</span> <span class="n">ClusteredByProperty</span><span class="p">,</span> +</span><span id="L-2077"><a href="#L-2077"><span class="linenos">2077</span></a> <span class="s2">"COLLATE"</span><span class="p">:</span> <span class="n">CollateProperty</span><span class="p">,</span> +</span><span id="L-2078"><a href="#L-2078"><span class="linenos">2078</span></a> <span class="s2">"COMMENT"</span><span class="p">:</span> <span class="n">SchemaCommentProperty</span><span class="p">,</span> +</span><span id="L-2079"><a href="#L-2079"><span class="linenos">2079</span></a> <span class="s2">"DEFINER"</span><span class="p">:</span> <span class="n">DefinerProperty</span><span class="p">,</span> +</span><span id="L-2080"><a href="#L-2080"><span class="linenos">2080</span></a> <span class="s2">"DISTKEY"</span><span class="p">:</span> <span class="n">DistKeyProperty</span><span class="p">,</span> +</span><span id="L-2081"><a href="#L-2081"><span class="linenos">2081</span></a> <span class="s2">"DISTSTYLE"</span><span class="p">:</span> <span class="n">DistStyleProperty</span><span class="p">,</span> +</span><span id="L-2082"><a href="#L-2082"><span class="linenos">2082</span></a> <span class="s2">"ENGINE"</span><span class="p">:</span> <span class="n">EngineProperty</span><span class="p">,</span> +</span><span id="L-2083"><a href="#L-2083"><span class="linenos">2083</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-2084"><a href="#L-2084"><span class="linenos">2084</span></a> <span class="s2">"FORMAT"</span><span class="p">:</span> <span class="n">FileFormatProperty</span><span class="p">,</span> +</span><span id="L-2085"><a href="#L-2085"><span class="linenos">2085</span></a> <span class="s2">"LANGUAGE"</span><span class="p">:</span> <span class="n">LanguageProperty</span><span class="p">,</span> +</span><span id="L-2086"><a href="#L-2086"><span class="linenos">2086</span></a> <span class="s2">"LOCATION"</span><span class="p">:</span> <span class="n">LocationProperty</span><span class="p">,</span> +</span><span id="L-2087"><a href="#L-2087"><span class="linenos">2087</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-2088"><a href="#L-2088"><span class="linenos">2088</span></a> <span class="s2">"RETURNS"</span><span class="p">:</span> <span class="n">ReturnsProperty</span><span class="p">,</span> +</span><span id="L-2089"><a href="#L-2089"><span class="linenos">2089</span></a> <span class="s2">"ROW_FORMAT"</span><span class="p">:</span> <span class="n">RowFormatProperty</span><span class="p">,</span> +</span><span id="L-2090"><a href="#L-2090"><span class="linenos">2090</span></a> <span class="s2">"SORTKEY"</span><span class="p">:</span> <span class="n">SortKeyProperty</span><span class="p">,</span> +</span><span id="L-2091"><a href="#L-2091"><span class="linenos">2091</span></a> <span class="p">}</span> +</span><span id="L-2092"><a href="#L-2092"><span class="linenos">2092</span></a> +</span><span id="L-2093"><a href="#L-2093"><span class="linenos">2093</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-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="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-2096"><a href="#L-2096"><span class="linenos">2096</span></a> -</span><span id="L-2097"><a href="#L-2097"><span class="linenos">2097</span></a> <span class="c1"># CREATE property locations</span> -</span><span id="L-2098"><a href="#L-2098"><span class="linenos">2098</span></a> <span class="c1"># Form: schema specified</span> -</span><span id="L-2099"><a href="#L-2099"><span class="linenos">2099</span></a> <span class="c1"># create [POST_CREATE]</span> -</span><span id="L-2100"><a href="#L-2100"><span class="linenos">2100</span></a> <span class="c1"># table a [POST_NAME]</span> -</span><span id="L-2101"><a href="#L-2101"><span class="linenos">2101</span></a> <span class="c1"># (b int) [POST_SCHEMA]</span> -</span><span id="L-2102"><a href="#L-2102"><span class="linenos">2102</span></a> <span class="c1"># with ([POST_WITH])</span> -</span><span id="L-2103"><a href="#L-2103"><span class="linenos">2103</span></a> <span class="c1"># index (b) [POST_INDEX]</span> -</span><span id="L-2104"><a href="#L-2104"><span class="linenos">2104</span></a> <span class="c1">#</span> -</span><span id="L-2105"><a href="#L-2105"><span class="linenos">2105</span></a> <span class="c1"># Form: alias selection</span> -</span><span id="L-2106"><a href="#L-2106"><span class="linenos">2106</span></a> <span class="c1"># create [POST_CREATE]</span> -</span><span id="L-2107"><a href="#L-2107"><span class="linenos">2107</span></a> <span class="c1"># table a [POST_NAME]</span> -</span><span id="L-2108"><a href="#L-2108"><span class="linenos">2108</span></a> <span class="c1"># as [POST_ALIAS] (select * from b) [POST_EXPRESSION]</span> -</span><span id="L-2109"><a href="#L-2109"><span class="linenos">2109</span></a> <span class="c1"># index (c) [POST_INDEX]</span> -</span><span id="L-2110"><a href="#L-2110"><span class="linenos">2110</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-2111"><a href="#L-2111"><span class="linenos">2111</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-2112"><a href="#L-2112"><span class="linenos">2112</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-2113"><a href="#L-2113"><span class="linenos">2113</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-2114"><a href="#L-2114"><span class="linenos">2114</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-2115"><a href="#L-2115"><span class="linenos">2115</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-2116"><a href="#L-2116"><span class="linenos">2116</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-2117"><a href="#L-2117"><span class="linenos">2117</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-2118"><a href="#L-2118"><span class="linenos">2118</span></a> <span class="n">UNSUPPORTED</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</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="nd">@classmethod</span> -</span><span id="L-2121"><a href="#L-2121"><span class="linenos">2121</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="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">Properties</span><span class="p">:</span> -</span><span id="L-2122"><a href="#L-2122"><span class="linenos">2122</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="L-2123"><a href="#L-2123"><span class="linenos">2123</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-2124"><a href="#L-2124"><span class="linenos">2124</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-2125"><a href="#L-2125"><span class="linenos">2125</span></a> <span class="k">if</span> <span class="n">property_cls</span><span class="p">:</span> -</span><span id="L-2126"><a href="#L-2126"><span class="linenos">2126</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-2127"><a href="#L-2127"><span class="linenos">2127</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-2128"><a href="#L-2128"><span class="linenos">2128</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-2095"><a href="#L-2095"><span class="linenos">2095</span></a> <span class="c1"># CREATE property locations</span> +</span><span id="L-2096"><a href="#L-2096"><span class="linenos">2096</span></a> <span class="c1"># Form: schema specified</span> +</span><span id="L-2097"><a href="#L-2097"><span class="linenos">2097</span></a> <span class="c1"># create [POST_CREATE]</span> +</span><span id="L-2098"><a href="#L-2098"><span class="linenos">2098</span></a> <span class="c1"># table a [POST_NAME]</span> +</span><span id="L-2099"><a href="#L-2099"><span class="linenos">2099</span></a> <span class="c1"># (b int) [POST_SCHEMA]</span> +</span><span id="L-2100"><a href="#L-2100"><span class="linenos">2100</span></a> <span class="c1"># with ([POST_WITH])</span> +</span><span id="L-2101"><a href="#L-2101"><span class="linenos">2101</span></a> <span class="c1"># index (b) [POST_INDEX]</span> +</span><span id="L-2102"><a href="#L-2102"><span class="linenos">2102</span></a> <span class="c1">#</span> +</span><span id="L-2103"><a href="#L-2103"><span class="linenos">2103</span></a> <span class="c1"># Form: alias selection</span> +</span><span id="L-2104"><a href="#L-2104"><span class="linenos">2104</span></a> <span class="c1"># create [POST_CREATE]</span> +</span><span id="L-2105"><a href="#L-2105"><span class="linenos">2105</span></a> <span class="c1"># table a [POST_NAME]</span> +</span><span id="L-2106"><a href="#L-2106"><span class="linenos">2106</span></a> <span class="c1"># as [POST_ALIAS] (select * from b) [POST_EXPRESSION]</span> +</span><span id="L-2107"><a href="#L-2107"><span class="linenos">2107</span></a> <span class="c1"># index (c) [POST_INDEX]</span> +</span><span id="L-2108"><a href="#L-2108"><span class="linenos">2108</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-2109"><a href="#L-2109"><span class="linenos">2109</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-2110"><a href="#L-2110"><span class="linenos">2110</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-2111"><a href="#L-2111"><span class="linenos">2111</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-2112"><a href="#L-2112"><span class="linenos">2112</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-2113"><a href="#L-2113"><span class="linenos">2113</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-2114"><a href="#L-2114"><span class="linenos">2114</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-2115"><a href="#L-2115"><span class="linenos">2115</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-2116"><a href="#L-2116"><span class="linenos">2116</span></a> <span class="n">UNSUPPORTED</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2117"><a href="#L-2117"><span class="linenos">2117</span></a> +</span><span id="L-2118"><a href="#L-2118"><span class="linenos">2118</span></a> <span class="nd">@classmethod</span> +</span><span id="L-2119"><a href="#L-2119"><span class="linenos">2119</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="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">Properties</span><span class="p">:</span> +</span><span id="L-2120"><a href="#L-2120"><span class="linenos">2120</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="L-2121"><a href="#L-2121"><span class="linenos">2121</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-2122"><a href="#L-2122"><span class="linenos">2122</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-2123"><a href="#L-2123"><span class="linenos">2123</span></a> <span class="k">if</span> <span class="n">property_cls</span><span class="p">:</span> +</span><span id="L-2124"><a href="#L-2124"><span class="linenos">2124</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-2125"><a href="#L-2125"><span class="linenos">2125</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-2126"><a href="#L-2126"><span class="linenos">2126</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-2127"><a href="#L-2127"><span class="linenos">2127</span></a> +</span><span id="L-2128"><a href="#L-2128"><span class="linenos">2128</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-2129"><a href="#L-2129"><span class="linenos">2129</span></a> -</span><span id="L-2130"><a href="#L-2130"><span class="linenos">2130</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-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><span id="L-2133"><a href="#L-2133"><span class="linenos">2133</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-2134"><a href="#L-2134"><span class="linenos">2134</span></a> <span class="k">pass</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><span id="L-2137"><a href="#L-2137"><span class="linenos">2137</span></a><span class="c1"># https://www.ibm.com/docs/en/ias?topic=procedures-return-statement-in-sql</span> -</span><span id="L-2138"><a href="#L-2138"><span class="linenos">2138</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-2139"><a href="#L-2139"><span class="linenos">2139</span></a> <span class="k">pass</span> -</span><span id="L-2140"><a href="#L-2140"><span class="linenos">2140</span></a> -</span><span id="L-2141"><a href="#L-2141"><span class="linenos">2141</span></a> -</span><span id="L-2142"><a href="#L-2142"><span class="linenos">2142</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-2143"><a href="#L-2143"><span class="linenos">2143</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-2144"><a href="#L-2144"><span class="linenos">2144</span></a> -</span><span id="L-2145"><a href="#L-2145"><span class="linenos">2145</span></a> -</span><span id="L-2146"><a href="#L-2146"><span class="linenos">2146</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-2147"><a href="#L-2147"><span class="linenos">2147</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-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="k">def</span> <span class="nf">isin</span><span class="p">(</span> -</span><span id="L-2150"><a href="#L-2150"><span class="linenos">2150</span></a> <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">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="n">query</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">opts</span> -</span><span id="L-2151"><a href="#L-2151"><span class="linenos">2151</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">In</span><span class="p">:</span> -</span><span id="L-2152"><a href="#L-2152"><span class="linenos">2152</span></a> <span class="k">return</span> <span class="n">In</span><span class="p">(</span> -</span><span id="L-2153"><a href="#L-2153"><span class="linenos">2153</span></a> <span class="n">this</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-2154"><a href="#L-2154"><span class="linenos">2154</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">e</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">],</span> -</span><span id="L-2155"><a href="#L-2155"><span class="linenos">2155</span></a> <span class="n">query</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">if</span> <span class="n">query</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-2156"><a href="#L-2156"><span class="linenos">2156</span></a> <span class="p">)</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><span id="L-2159"><a href="#L-2159"><span class="linenos">2159</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-2160"><a href="#L-2160"><span class="linenos">2160</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="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">Subquery</span><span class="p">:</span> -</span><span id="L-2161"><a href="#L-2161"><span class="linenos">2161</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2162"><a href="#L-2162"><span class="linenos">2162</span></a><span class="sd"> Convert this expression to an aliased expression that can be used as a Subquery.</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="sd"> Example:</span> -</span><span id="L-2165"><a href="#L-2165"><span class="linenos">2165</span></a><span class="sd"> >>> subquery = Select().select("x").from_("tbl").subquery()</span> -</span><span id="L-2166"><a href="#L-2166"><span class="linenos">2166</span></a><span class="sd"> >>> Select().select("x").from_(subquery).sql()</span> -</span><span id="L-2167"><a href="#L-2167"><span class="linenos">2167</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl)'</span> -</span><span id="L-2168"><a href="#L-2168"><span class="linenos">2168</span></a> -</span><span id="L-2169"><a href="#L-2169"><span class="linenos">2169</span></a><span class="sd"> Args:</span> -</span><span id="L-2170"><a href="#L-2170"><span class="linenos">2170</span></a><span class="sd"> alias (str | Identifier): an optional alias for the subquery</span> -</span><span id="L-2171"><a href="#L-2171"><span class="linenos">2171</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-2172"><a href="#L-2172"><span class="linenos">2172</span></a> -</span><span id="L-2173"><a href="#L-2173"><span class="linenos">2173</span></a><span class="sd"> Returns:</span> -</span><span id="L-2174"><a href="#L-2174"><span class="linenos">2174</span></a><span class="sd"> Alias: the subquery</span> -</span><span id="L-2175"><a href="#L-2175"><span class="linenos">2175</span></a><span class="sd"> """</span> -</span><span id="L-2176"><a href="#L-2176"><span class="linenos">2176</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-2177"><a href="#L-2177"><span class="linenos">2177</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">alias</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2178"><a href="#L-2178"><span class="linenos">2178</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><span id="L-2130"><a href="#L-2130"><span class="linenos">2130</span></a> +</span><span id="L-2131"><a href="#L-2131"><span class="linenos">2131</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-2132"><a href="#L-2132"><span class="linenos">2132</span></a> <span class="k">pass</span> +</span><span id="L-2133"><a href="#L-2133"><span class="linenos">2133</span></a> +</span><span id="L-2134"><a href="#L-2134"><span class="linenos">2134</span></a> +</span><span id="L-2135"><a href="#L-2135"><span class="linenos">2135</span></a><span class="c1"># https://www.ibm.com/docs/en/ias?topic=procedures-return-statement-in-sql</span> +</span><span id="L-2136"><a href="#L-2136"><span class="linenos">2136</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-2137"><a href="#L-2137"><span class="linenos">2137</span></a> <span class="k">pass</span> +</span><span id="L-2138"><a href="#L-2138"><span class="linenos">2138</span></a> +</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="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-2141"><a href="#L-2141"><span class="linenos">2141</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-2144"><a href="#L-2144"><span class="linenos">2144</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-2145"><a href="#L-2145"><span class="linenos">2145</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-2146"><a href="#L-2146"><span class="linenos">2146</span></a> +</span><span id="L-2147"><a href="#L-2147"><span class="linenos">2147</span></a> <span class="k">def</span> <span class="nf">isin</span><span class="p">(</span> +</span><span id="L-2148"><a href="#L-2148"><span class="linenos">2148</span></a> <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">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="n">query</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">opts</span> +</span><span id="L-2149"><a href="#L-2149"><span class="linenos">2149</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">In</span><span class="p">:</span> +</span><span id="L-2150"><a href="#L-2150"><span class="linenos">2150</span></a> <span class="k">return</span> <span class="n">In</span><span class="p">(</span> +</span><span id="L-2151"><a href="#L-2151"><span class="linenos">2151</span></a> <span class="n">this</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-2152"><a href="#L-2152"><span class="linenos">2152</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">e</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">],</span> +</span><span id="L-2153"><a href="#L-2153"><span class="linenos">2153</span></a> <span class="n">query</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">if</span> <span class="n">query</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-2154"><a href="#L-2154"><span class="linenos">2154</span></a> <span class="p">)</span> +</span><span id="L-2155"><a href="#L-2155"><span class="linenos">2155</span></a> +</span><span id="L-2156"><a href="#L-2156"><span class="linenos">2156</span></a> +</span><span id="L-2157"><a href="#L-2157"><span class="linenos">2157</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-2158"><a href="#L-2158"><span class="linenos">2158</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="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">Subquery</span><span class="p">:</span> +</span><span id="L-2159"><a href="#L-2159"><span class="linenos">2159</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2160"><a href="#L-2160"><span class="linenos">2160</span></a><span class="sd"> Convert this expression to an aliased expression that can be used as a Subquery.</span> +</span><span id="L-2161"><a href="#L-2161"><span class="linenos">2161</span></a> +</span><span id="L-2162"><a href="#L-2162"><span class="linenos">2162</span></a><span class="sd"> Example:</span> +</span><span id="L-2163"><a href="#L-2163"><span class="linenos">2163</span></a><span class="sd"> >>> subquery = Select().select("x").from_("tbl").subquery()</span> +</span><span id="L-2164"><a href="#L-2164"><span class="linenos">2164</span></a><span class="sd"> >>> Select().select("x").from_(subquery).sql()</span> +</span><span id="L-2165"><a href="#L-2165"><span class="linenos">2165</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl)'</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"> Args:</span> +</span><span id="L-2168"><a href="#L-2168"><span class="linenos">2168</span></a><span class="sd"> alias (str | Identifier): an optional alias for the subquery</span> +</span><span id="L-2169"><a href="#L-2169"><span class="linenos">2169</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-2170"><a href="#L-2170"><span class="linenos">2170</span></a> +</span><span id="L-2171"><a href="#L-2171"><span class="linenos">2171</span></a><span class="sd"> Returns:</span> +</span><span id="L-2172"><a href="#L-2172"><span class="linenos">2172</span></a><span class="sd"> Alias: the subquery</span> +</span><span id="L-2173"><a href="#L-2173"><span class="linenos">2173</span></a><span class="sd"> """</span> +</span><span id="L-2174"><a href="#L-2174"><span class="linenos">2174</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-2175"><a href="#L-2175"><span class="linenos">2175</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">alias</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2176"><a href="#L-2176"><span class="linenos">2176</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><span id="L-2177"><a href="#L-2177"><span class="linenos">2177</span></a> +</span><span id="L-2178"><a href="#L-2178"><span class="linenos">2178</span></a> <span class="k">return</span> <span class="n">Subquery</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">instance</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-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">return</span> <span class="n">Subquery</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">instance</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-2181"><a href="#L-2181"><span class="linenos">2181</span></a> -</span><span id="L-2182"><a href="#L-2182"><span class="linenos">2182</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> -</span><span id="L-2183"><a href="#L-2183"><span class="linenos">2183</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> -</span><span id="L-2184"><a href="#L-2184"><span class="linenos">2184</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2185"><a href="#L-2185"><span class="linenos">2185</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span> -</span><span id="L-2186"><a href="#L-2186"><span class="linenos">2186</span></a> -</span><span id="L-2187"><a href="#L-2187"><span class="linenos">2187</span></a> <span class="nd">@property</span> -</span><span id="L-2188"><a href="#L-2188"><span class="linenos">2188</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-2189"><a href="#L-2189"><span class="linenos">2189</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-2190"><a href="#L-2190"><span class="linenos">2190</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-2191"><a href="#L-2191"><span class="linenos">2191</span></a> <span class="k">return</span> <span class="p">[]</span> -</span><span id="L-2192"><a href="#L-2192"><span class="linenos">2192</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-2193"><a href="#L-2193"><span class="linenos">2193</span></a> -</span><span id="L-2194"><a href="#L-2194"><span class="linenos">2194</span></a> <span class="nd">@property</span> -</span><span id="L-2195"><a href="#L-2195"><span class="linenos">2195</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-2196"><a href="#L-2196"><span class="linenos">2196</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-2197"><a href="#L-2197"><span class="linenos">2197</span></a> -</span><span id="L-2198"><a href="#L-2198"><span class="linenos">2198</span></a> <span class="nd">@property</span> -</span><span id="L-2199"><a href="#L-2199"><span class="linenos">2199</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-2200"><a href="#L-2200"><span class="linenos">2200</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-2201"><a href="#L-2201"><span class="linenos">2201</span></a> -</span><span id="L-2202"><a href="#L-2202"><span class="linenos">2202</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> -</span><span id="L-2203"><a href="#L-2203"><span class="linenos">2203</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2204"><a href="#L-2204"><span class="linenos">2204</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-2205"><a href="#L-2205"><span class="linenos">2205</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-2206"><a href="#L-2206"><span class="linenos">2206</span></a> <span class="n">recursive</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-2207"><a href="#L-2207"><span class="linenos">2207</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-2208"><a href="#L-2208"><span class="linenos">2208</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-2209"><a href="#L-2209"><span class="linenos">2209</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-2210"><a href="#L-2210"><span class="linenos">2210</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2211"><a href="#L-2211"><span class="linenos">2211</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Subqueryable</span><span class="p">:</span> -</span><span id="L-2212"><a href="#L-2212"><span class="linenos">2212</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2213"><a href="#L-2213"><span class="linenos">2213</span></a><span class="sd"> Append to or set the common table expressions.</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="sd"> Example:</span> -</span><span id="L-2216"><a href="#L-2216"><span class="linenos">2216</span></a><span class="sd"> >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()</span> -</span><span id="L-2217"><a href="#L-2217"><span class="linenos">2217</span></a><span class="sd"> 'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'</span> -</span><span id="L-2218"><a href="#L-2218"><span class="linenos">2218</span></a> -</span><span id="L-2219"><a href="#L-2219"><span class="linenos">2219</span></a><span class="sd"> Args:</span> -</span><span id="L-2220"><a href="#L-2220"><span class="linenos">2220</span></a><span class="sd"> alias: the SQL code string to parse as the table name.</span> -</span><span id="L-2221"><a href="#L-2221"><span class="linenos">2221</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> -</span><span id="L-2222"><a href="#L-2222"><span class="linenos">2222</span></a><span class="sd"> as_: the SQL code string to parse as the table expression.</span> -</span><span id="L-2223"><a href="#L-2223"><span class="linenos">2223</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2224"><a href="#L-2224"><span class="linenos">2224</span></a><span class="sd"> recursive: set the RECURSIVE part of the expression. Defaults to `False`.</span> -</span><span id="L-2225"><a href="#L-2225"><span class="linenos">2225</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="L-2226"><a href="#L-2226"><span class="linenos">2226</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="L-2227"><a href="#L-2227"><span class="linenos">2227</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-2228"><a href="#L-2228"><span class="linenos">2228</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2229"><a href="#L-2229"><span class="linenos">2229</span></a><span class="sd"> opts: other options to use to parse the input expressions.</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"> Returns:</span> -</span><span id="L-2232"><a href="#L-2232"><span class="linenos">2232</span></a><span class="sd"> The modified expression.</span> -</span><span id="L-2233"><a href="#L-2233"><span class="linenos">2233</span></a><span class="sd"> """</span> -</span><span id="L-2234"><a href="#L-2234"><span class="linenos">2234</span></a> <span class="k">return</span> <span class="n">_apply_cte_builder</span><span class="p">(</span> -</span><span id="L-2235"><a href="#L-2235"><span class="linenos">2235</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="p">,</span> <span class="n">as_</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="n">recursive</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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> -</span><span id="L-2236"><a href="#L-2236"><span class="linenos">2236</span></a> <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><span id="L-2239"><a href="#L-2239"><span class="linenos">2239</span></a><span class="n">QUERY_MODIFIERS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2240"><a href="#L-2240"><span class="linenos">2240</span></a> <span class="s2">"match"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2241"><a href="#L-2241"><span class="linenos">2241</span></a> <span class="s2">"laterals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2242"><a href="#L-2242"><span class="linenos">2242</span></a> <span class="s2">"joins"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2243"><a href="#L-2243"><span class="linenos">2243</span></a> <span class="s2">"pivots"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2244"><a href="#L-2244"><span class="linenos">2244</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2245"><a href="#L-2245"><span class="linenos">2245</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2246"><a href="#L-2246"><span class="linenos">2246</span></a> <span class="s2">"having"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2247"><a href="#L-2247"><span class="linenos">2247</span></a> <span class="s2">"qualify"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2248"><a href="#L-2248"><span class="linenos">2248</span></a> <span class="s2">"windows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2249"><a href="#L-2249"><span class="linenos">2249</span></a> <span class="s2">"distribute"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2250"><a href="#L-2250"><span class="linenos">2250</span></a> <span class="s2">"sort"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2251"><a href="#L-2251"><span class="linenos">2251</span></a> <span class="s2">"cluster"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2252"><a href="#L-2252"><span class="linenos">2252</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2253"><a href="#L-2253"><span class="linenos">2253</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2254"><a href="#L-2254"><span class="linenos">2254</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2255"><a href="#L-2255"><span class="linenos">2255</span></a> <span class="s2">"locks"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2256"><a href="#L-2256"><span class="linenos">2256</span></a> <span class="s2">"sample"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2257"><a href="#L-2257"><span class="linenos">2257</span></a> <span class="s2">"settings"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2258"><a href="#L-2258"><span class="linenos">2258</span></a> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2259"><a href="#L-2259"><span class="linenos">2259</span></a><span class="p">}</span> -</span><span id="L-2260"><a href="#L-2260"><span class="linenos">2260</span></a> -</span><span id="L-2261"><a href="#L-2261"><span class="linenos">2261</span></a> -</span><span id="L-2262"><a href="#L-2262"><span class="linenos">2262</span></a><span class="c1"># https://learn.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table?view=sql-server-ver16</span> -</span><span id="L-2263"><a href="#L-2263"><span class="linenos">2263</span></a><span class="k">class</span> <span class="nc">WithTableHint</span><span class="p">(</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 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-2265"><a href="#L-2265"><span class="linenos">2265</span></a> -</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="c1"># https://dev.mysql.com/doc/refman/8.0/en/index-hints.html</span> -</span><span id="L-2268"><a href="#L-2268"><span class="linenos">2268</span></a><span class="k">class</span> <span class="nc">IndexTableHint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2269"><a href="#L-2269"><span class="linenos">2269</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">"target"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-2270"><a href="#L-2270"><span class="linenos">2270</span></a> -</span><span id="L-2271"><a href="#L-2271"><span class="linenos">2271</span></a> -</span><span id="L-2272"><a href="#L-2272"><span class="linenos">2272</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-2273"><a href="#L-2273"><span class="linenos">2273</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2274"><a href="#L-2274"><span class="linenos">2274</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2275"><a href="#L-2275"><span class="linenos">2275</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2276"><a href="#L-2276"><span class="linenos">2276</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2277"><a href="#L-2277"><span class="linenos">2277</span></a> <span class="s2">"catalog"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2278"><a href="#L-2278"><span class="linenos">2278</span></a> <span class="s2">"laterals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2279"><a href="#L-2279"><span class="linenos">2279</span></a> <span class="s2">"joins"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2280"><a href="#L-2280"><span class="linenos">2280</span></a> <span class="s2">"pivots"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2281"><a href="#L-2281"><span class="linenos">2281</span></a> <span class="s2">"hints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2282"><a href="#L-2282"><span class="linenos">2282</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-2283"><a href="#L-2283"><span class="linenos">2283</span></a> <span class="p">}</span> -</span><span id="L-2284"><a href="#L-2284"><span class="linenos">2284</span></a> -</span><span id="L-2285"><a href="#L-2285"><span class="linenos">2285</span></a> <span class="nd">@property</span> -</span><span id="L-2286"><a href="#L-2286"><span class="linenos">2286</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-2287"><a href="#L-2287"><span class="linenos">2287</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">this</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> -</span><span id="L-2288"><a href="#L-2288"><span class="linenos">2288</span></a> <span class="k">return</span> <span class="s2">""</span> -</span><span id="L-2289"><a href="#L-2289"><span class="linenos">2289</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-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="nd">@property</span> -</span><span id="L-2292"><a href="#L-2292"><span class="linenos">2292</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-2293"><a href="#L-2293"><span class="linenos">2293</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-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="nd">@property</span> -</span><span id="L-2296"><a href="#L-2296"><span class="linenos">2296</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-2297"><a href="#L-2297"><span class="linenos">2297</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-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="nd">@property</span> -</span><span id="L-2300"><a href="#L-2300"><span class="linenos">2300</span></a> <span class="k">def</span> <span class="nf">parts</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">Identifier</span><span class="p">]:</span> -</span><span id="L-2301"><a href="#L-2301"><span class="linenos">2301</span></a><span class="w"> </span><span class="sd">"""Return the parts of a table in order catalog, db, table."""</span> -</span><span id="L-2302"><a href="#L-2302"><span class="linenos">2302</span></a> <span class="k">return</span> <span class="p">[</span> -</span><span id="L-2303"><a href="#L-2303"><span class="linenos">2303</span></a> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Identifier</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="n">part</span><span class="p">])</span> -</span><span id="L-2304"><a href="#L-2304"><span class="linenos">2304</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"catalog"</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="L-2305"><a href="#L-2305"><span class="linenos">2305</span></a> <span class="k">if</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">part</span><span class="p">)</span> -</span><span id="L-2306"><a href="#L-2306"><span class="linenos">2306</span></a> <span class="p">]</span> -</span><span id="L-2307"><a href="#L-2307"><span class="linenos">2307</span></a> -</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="c1"># See the TSQL "Querying data in a system-versioned temporal table" page</span> -</span><span id="L-2310"><a href="#L-2310"><span class="linenos">2310</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-2311"><a href="#L-2311"><span class="linenos">2311</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2312"><a href="#L-2312"><span class="linenos">2312</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2313"><a href="#L-2313"><span class="linenos">2313</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2314"><a href="#L-2314"><span class="linenos">2314</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2315"><a href="#L-2315"><span class="linenos">2315</span></a> <span class="p">}</span> -</span><span id="L-2316"><a href="#L-2316"><span class="linenos">2316</span></a> -</span><span id="L-2317"><a href="#L-2317"><span class="linenos">2317</span></a> -</span><span id="L-2318"><a href="#L-2318"><span class="linenos">2318</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-2319"><a href="#L-2319"><span class="linenos">2319</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2320"><a href="#L-2320"><span class="linenos">2320</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2321"><a href="#L-2321"><span class="linenos">2321</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2322"><a href="#L-2322"><span class="linenos">2322</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2323"><a href="#L-2323"><span class="linenos">2323</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2324"><a href="#L-2324"><span class="linenos">2324</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> -</span><span id="L-2325"><a href="#L-2325"><span class="linenos">2325</span></a> <span class="p">}</span> -</span><span id="L-2326"><a href="#L-2326"><span class="linenos">2326</span></a> -</span><span id="L-2327"><a href="#L-2327"><span class="linenos">2327</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> -</span><span id="L-2328"><a href="#L-2328"><span class="linenos">2328</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> -</span><span id="L-2329"><a href="#L-2329"><span class="linenos">2329</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2330"><a href="#L-2330"><span class="linenos">2330</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2331"><a href="#L-2331"><span class="linenos">2331</span></a><span class="sd"> Set the LIMIT expression.</span> -</span><span id="L-2332"><a href="#L-2332"><span class="linenos">2332</span></a> -</span><span id="L-2333"><a href="#L-2333"><span class="linenos">2333</span></a><span class="sd"> Example:</span> -</span><span id="L-2334"><a href="#L-2334"><span class="linenos">2334</span></a><span class="sd"> >>> select("1").union(select("1")).limit(1).sql()</span> -</span><span id="L-2335"><a href="#L-2335"><span class="linenos">2335</span></a><span class="sd"> 'SELECT * FROM (SELECT 1 UNION SELECT 1) AS _l_0 LIMIT 1'</span> -</span><span id="L-2336"><a href="#L-2336"><span class="linenos">2336</span></a> -</span><span id="L-2337"><a href="#L-2337"><span class="linenos">2337</span></a><span class="sd"> Args:</span> -</span><span id="L-2338"><a href="#L-2338"><span class="linenos">2338</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="L-2339"><a href="#L-2339"><span class="linenos">2339</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="L-2340"><a href="#L-2340"><span class="linenos">2340</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> -</span><span id="L-2341"><a href="#L-2341"><span class="linenos">2341</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> -</span><span id="L-2342"><a href="#L-2342"><span class="linenos">2342</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-2343"><a href="#L-2343"><span class="linenos">2343</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2344"><a href="#L-2344"><span class="linenos">2344</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-2345"><a href="#L-2345"><span class="linenos">2345</span></a> -</span><span id="L-2346"><a href="#L-2346"><span class="linenos">2346</span></a><span class="sd"> Returns:</span> -</span><span id="L-2347"><a href="#L-2347"><span class="linenos">2347</span></a><span class="sd"> The limited subqueryable.</span> -</span><span id="L-2348"><a href="#L-2348"><span class="linenos">2348</span></a><span class="sd"> """</span> -</span><span id="L-2349"><a href="#L-2349"><span class="linenos">2349</span></a> <span class="k">return</span> <span class="p">(</span> -</span><span id="L-2350"><a href="#L-2350"><span class="linenos">2350</span></a> <span class="n">select</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span> -</span><span id="L-2351"><a href="#L-2351"><span class="linenos">2351</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-2352"><a href="#L-2352"><span class="linenos">2352</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-2353"><a href="#L-2353"><span class="linenos">2353</span></a> <span class="p">)</span> -</span><span id="L-2354"><a href="#L-2354"><span class="linenos">2354</span></a> -</span><span id="L-2355"><a href="#L-2355"><span class="linenos">2355</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> -</span><span id="L-2356"><a href="#L-2356"><span class="linenos">2356</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2357"><a href="#L-2357"><span class="linenos">2357</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-2358"><a href="#L-2358"><span class="linenos">2358</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-2359"><a href="#L-2359"><span class="linenos">2359</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-2360"><a href="#L-2360"><span class="linenos">2360</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-2361"><a href="#L-2361"><span class="linenos">2361</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2362"><a href="#L-2362"><span class="linenos">2362</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> -</span><span id="L-2363"><a href="#L-2363"><span class="linenos">2363</span></a><span class="w"> </span><span class="sd">"""Append to or set the SELECT of the union recursively.</span> -</span><span id="L-2364"><a href="#L-2364"><span class="linenos">2364</span></a> -</span><span id="L-2365"><a href="#L-2365"><span class="linenos">2365</span></a><span class="sd"> Example:</span> -</span><span id="L-2366"><a href="#L-2366"><span class="linenos">2366</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="L-2367"><a href="#L-2367"><span class="linenos">2367</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-2368"><a href="#L-2368"><span class="linenos">2368</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-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"> Args:</span> -</span><span id="L-2371"><a href="#L-2371"><span class="linenos">2371</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-2372"><a href="#L-2372"><span class="linenos">2372</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2373"><a href="#L-2373"><span class="linenos">2373</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="L-2374"><a href="#L-2374"><span class="linenos">2374</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="L-2375"><a href="#L-2375"><span class="linenos">2375</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-2376"><a href="#L-2376"><span class="linenos">2376</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2377"><a href="#L-2377"><span class="linenos">2377</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-2378"><a href="#L-2378"><span class="linenos">2378</span></a> -</span><span id="L-2379"><a href="#L-2379"><span class="linenos">2379</span></a><span class="sd"> Returns:</span> -</span><span id="L-2380"><a href="#L-2380"><span class="linenos">2380</span></a><span class="sd"> Union: the modified expression.</span> -</span><span id="L-2381"><a href="#L-2381"><span class="linenos">2381</span></a><span class="sd"> """</span> -</span><span id="L-2382"><a href="#L-2382"><span class="linenos">2382</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-2383"><a href="#L-2383"><span class="linenos">2383</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-2384"><a href="#L-2384"><span class="linenos">2384</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-2385"><a href="#L-2385"><span class="linenos">2385</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-2386"><a href="#L-2386"><span class="linenos">2386</span></a> <span class="p">)</span> -</span><span id="L-2387"><a href="#L-2387"><span class="linenos">2387</span></a> <span class="k">return</span> <span class="n">this</span> -</span><span id="L-2388"><a href="#L-2388"><span class="linenos">2388</span></a> -</span><span id="L-2389"><a href="#L-2389"><span class="linenos">2389</span></a> <span class="nd">@property</span> -</span><span id="L-2390"><a href="#L-2390"><span class="linenos">2390</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-2391"><a href="#L-2391"><span class="linenos">2391</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-2392"><a href="#L-2392"><span class="linenos">2392</span></a> -</span><span id="L-2393"><a href="#L-2393"><span class="linenos">2393</span></a> <span class="nd">@property</span> -</span><span id="L-2394"><a href="#L-2394"><span class="linenos">2394</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-2395"><a href="#L-2395"><span class="linenos">2395</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-2396"><a href="#L-2396"><span class="linenos">2396</span></a> -</span><span id="L-2397"><a href="#L-2397"><span class="linenos">2397</span></a> <span class="nd">@property</span> -</span><span id="L-2398"><a href="#L-2398"><span class="linenos">2398</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-2399"><a href="#L-2399"><span class="linenos">2399</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-2400"><a href="#L-2400"><span class="linenos">2400</span></a> -</span><span id="L-2401"><a href="#L-2401"><span class="linenos">2401</span></a> <span class="nd">@property</span> -</span><span id="L-2402"><a href="#L-2402"><span class="linenos">2402</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-2403"><a href="#L-2403"><span class="linenos">2403</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-2404"><a href="#L-2404"><span class="linenos">2404</span></a> -</span><span id="L-2405"><a href="#L-2405"><span class="linenos">2405</span></a> <span class="nd">@property</span> -</span><span id="L-2406"><a href="#L-2406"><span class="linenos">2406</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-2407"><a href="#L-2407"><span class="linenos">2407</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-2408"><a href="#L-2408"><span class="linenos">2408</span></a> -</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="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-2411"><a href="#L-2411"><span class="linenos">2411</span></a> <span class="k">pass</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><span id="L-2414"><a href="#L-2414"><span class="linenos">2414</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-2415"><a href="#L-2415"><span class="linenos">2415</span></a> <span class="k">pass</span> -</span><span id="L-2416"><a href="#L-2416"><span class="linenos">2416</span></a> -</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="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-2419"><a href="#L-2419"><span class="linenos">2419</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2420"><a href="#L-2420"><span class="linenos">2420</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2421"><a href="#L-2421"><span class="linenos">2421</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2422"><a href="#L-2422"><span class="linenos">2422</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2423"><a href="#L-2423"><span class="linenos">2423</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2424"><a href="#L-2424"><span class="linenos">2424</span></a> <span class="p">}</span> -</span><span id="L-2425"><a href="#L-2425"><span class="linenos">2425</span></a> -</span><span id="L-2426"><a href="#L-2426"><span class="linenos">2426</span></a> -</span><span id="L-2427"><a href="#L-2427"><span class="linenos">2427</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-2428"><a href="#L-2428"><span class="linenos">2428</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2429"><a href="#L-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="L-2430"><a href="#L-2430"><span class="linenos">2430</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2431"><a href="#L-2431"><span class="linenos">2431</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2432"><a href="#L-2432"><span class="linenos">2432</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2433"><a href="#L-2433"><span class="linenos">2433</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2434"><a href="#L-2434"><span class="linenos">2434</span></a> <span class="s2">"returning"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2435"><a href="#L-2435"><span class="linenos">2435</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2436"><a href="#L-2436"><span class="linenos">2436</span></a> <span class="p">}</span> -</span><span id="L-2437"><a href="#L-2437"><span class="linenos">2437</span></a> -</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">class</span> <span class="nc">Values</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> -</span><span id="L-2440"><a href="#L-2440"><span class="linenos">2440</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2441"><a href="#L-2441"><span class="linenos">2441</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2442"><a href="#L-2442"><span class="linenos">2442</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2443"><a href="#L-2443"><span class="linenos">2443</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2444"><a href="#L-2444"><span class="linenos">2444</span></a> <span class="p">}</span> -</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><span id="L-2447"><a href="#L-2447"><span class="linenos">2447</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-2448"><a href="#L-2448"><span class="linenos">2448</span></a> <span class="k">pass</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><span id="L-2451"><a href="#L-2451"><span class="linenos">2451</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-2452"><a href="#L-2452"><span class="linenos">2452</span></a> <span class="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-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><span id="L-2455"><a href="#L-2455"><span class="linenos">2455</span></a><span class="c1"># https://dev.mysql.com/doc/refman/8.0/en/select.html</span> -</span><span id="L-2456"><a href="#L-2456"><span class="linenos">2456</span></a><span class="c1"># https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/SELECT.html</span> -</span><span id="L-2457"><a href="#L-2457"><span class="linenos">2457</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-2458"><a href="#L-2458"><span class="linenos">2458</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 class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"wait"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</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><span id="L-2461"><a href="#L-2461"><span class="linenos">2461</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-2462"><a href="#L-2462"><span class="linenos">2462</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2463"><a href="#L-2463"><span class="linenos">2463</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2464"><a href="#L-2464"><span class="linenos">2464</span></a> <span class="s2">"kind"</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">"expressions"</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">"hint"</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="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2468"><a href="#L-2468"><span class="linenos">2468</span></a> <span class="s2">"into"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2469"><a href="#L-2469"><span class="linenos">2469</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2470"><a href="#L-2470"><span class="linenos">2470</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> -</span><span id="L-2471"><a href="#L-2471"><span class="linenos">2471</span></a> <span class="p">}</span> -</span><span id="L-2472"><a href="#L-2472"><span class="linenos">2472</span></a> -</span><span id="L-2473"><a href="#L-2473"><span class="linenos">2473</span></a> <span class="k">def</span> <span class="nf">from_</span><span class="p">(</span> -</span><span id="L-2474"><a href="#L-2474"><span class="linenos">2474</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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="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">opts</span> -</span><span id="L-2475"><a href="#L-2475"><span class="linenos">2475</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2476"><a href="#L-2476"><span class="linenos">2476</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2477"><a href="#L-2477"><span class="linenos">2477</span></a><span class="sd"> Set the FROM expression.</span> -</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="sd"> Example:</span> -</span><span id="L-2480"><a href="#L-2480"><span class="linenos">2480</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sql()</span> -</span><span id="L-2481"><a href="#L-2481"><span class="linenos">2481</span></a><span class="sd"> 'SELECT x FROM tbl'</span> -</span><span id="L-2482"><a href="#L-2482"><span class="linenos">2482</span></a> -</span><span id="L-2483"><a href="#L-2483"><span class="linenos">2483</span></a><span class="sd"> Args:</span> -</span><span id="L-2484"><a href="#L-2484"><span class="linenos">2484</span></a><span class="sd"> expression : the SQL code strings to parse.</span> -</span><span id="L-2485"><a href="#L-2485"><span class="linenos">2485</span></a><span class="sd"> If a `From` instance is passed, this is used as-is.</span> -</span><span id="L-2486"><a href="#L-2486"><span class="linenos">2486</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `From`.</span> -</span><span id="L-2487"><a href="#L-2487"><span class="linenos">2487</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-2488"><a href="#L-2488"><span class="linenos">2488</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2489"><a href="#L-2489"><span class="linenos">2489</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-2490"><a href="#L-2490"><span class="linenos">2490</span></a> -</span><span id="L-2491"><a href="#L-2491"><span class="linenos">2491</span></a><span class="sd"> Returns:</span> -</span><span id="L-2492"><a href="#L-2492"><span class="linenos">2492</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="L-2493"><a href="#L-2493"><span class="linenos">2493</span></a><span class="sd"> """</span> -</span><span id="L-2494"><a href="#L-2494"><span class="linenos">2494</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="L-2495"><a href="#L-2495"><span class="linenos">2495</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="L-2496"><a href="#L-2496"><span class="linenos">2496</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2497"><a href="#L-2497"><span class="linenos">2497</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"from"</span><span class="p">,</span> -</span><span id="L-2498"><a href="#L-2498"><span class="linenos">2498</span></a> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> -</span><span id="L-2499"><a href="#L-2499"><span class="linenos">2499</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> -</span><span id="L-2500"><a href="#L-2500"><span class="linenos">2500</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2501"><a href="#L-2501"><span class="linenos">2501</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2502"><a href="#L-2502"><span class="linenos">2502</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2503"><a href="#L-2503"><span class="linenos">2503</span></a> <span class="p">)</span> -</span><span id="L-2504"><a href="#L-2504"><span class="linenos">2504</span></a> -</span><span id="L-2505"><a href="#L-2505"><span class="linenos">2505</span></a> <span class="k">def</span> <span class="nf">group_by</span><span class="p">(</span> -</span><span id="L-2506"><a href="#L-2506"><span class="linenos">2506</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2507"><a href="#L-2507"><span class="linenos">2507</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-2508"><a href="#L-2508"><span class="linenos">2508</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-2509"><a href="#L-2509"><span class="linenos">2509</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-2510"><a href="#L-2510"><span class="linenos">2510</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-2511"><a href="#L-2511"><span class="linenos">2511</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2512"><a href="#L-2512"><span class="linenos">2512</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2513"><a href="#L-2513"><span class="linenos">2513</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2514"><a href="#L-2514"><span class="linenos">2514</span></a><span class="sd"> Set the GROUP BY expression.</span> -</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="sd"> Example:</span> -</span><span id="L-2517"><a href="#L-2517"><span class="linenos">2517</span></a><span class="sd"> >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()</span> -</span><span id="L-2518"><a href="#L-2518"><span class="linenos">2518</span></a><span class="sd"> 'SELECT x, COUNT(1) FROM tbl GROUP BY x'</span> -</span><span id="L-2519"><a href="#L-2519"><span class="linenos">2519</span></a> -</span><span id="L-2520"><a href="#L-2520"><span class="linenos">2520</span></a><span class="sd"> Args:</span> -</span><span id="L-2521"><a href="#L-2521"><span class="linenos">2521</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-2522"><a href="#L-2522"><span class="linenos">2522</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="L-2523"><a href="#L-2523"><span class="linenos">2523</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Group`.</span> -</span><span id="L-2524"><a href="#L-2524"><span class="linenos">2524</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-2525"><a href="#L-2525"><span class="linenos">2525</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="L-2526"><a href="#L-2526"><span class="linenos">2526</span></a><span class="sd"> Otherwise, this flattens all the `Group` expression into a single expression.</span> -</span><span id="L-2527"><a href="#L-2527"><span class="linenos">2527</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-2528"><a href="#L-2528"><span class="linenos">2528</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2529"><a href="#L-2529"><span class="linenos">2529</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-2530"><a href="#L-2530"><span class="linenos">2530</span></a> -</span><span id="L-2531"><a href="#L-2531"><span class="linenos">2531</span></a><span class="sd"> Returns:</span> -</span><span id="L-2532"><a href="#L-2532"><span class="linenos">2532</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="L-2533"><a href="#L-2533"><span class="linenos">2533</span></a><span class="sd"> """</span> -</span><span id="L-2534"><a href="#L-2534"><span class="linenos">2534</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-2535"><a href="#L-2535"><span class="linenos">2535</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-2536"><a href="#L-2536"><span class="linenos">2536</span></a> -</span><span id="L-2537"><a href="#L-2537"><span class="linenos">2537</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-2538"><a href="#L-2538"><span class="linenos">2538</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2539"><a href="#L-2539"><span class="linenos">2539</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2540"><a href="#L-2540"><span class="linenos">2540</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"group"</span><span class="p">,</span> -</span><span id="L-2541"><a href="#L-2541"><span class="linenos">2541</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2542"><a href="#L-2542"><span class="linenos">2542</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2543"><a href="#L-2543"><span class="linenos">2543</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-2544"><a href="#L-2544"><span class="linenos">2544</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Group</span><span class="p">,</span> -</span><span id="L-2545"><a href="#L-2545"><span class="linenos">2545</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2546"><a href="#L-2546"><span class="linenos">2546</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2547"><a href="#L-2547"><span class="linenos">2547</span></a> <span class="p">)</span> -</span><span id="L-2548"><a href="#L-2548"><span class="linenos">2548</span></a> -</span><span id="L-2549"><a href="#L-2549"><span class="linenos">2549</span></a> <span class="k">def</span> <span class="nf">order_by</span><span class="p">(</span> -</span><span id="L-2550"><a href="#L-2550"><span class="linenos">2550</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2551"><a href="#L-2551"><span class="linenos">2551</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-2552"><a href="#L-2552"><span class="linenos">2552</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-2553"><a href="#L-2553"><span class="linenos">2553</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-2554"><a href="#L-2554"><span class="linenos">2554</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-2555"><a href="#L-2555"><span class="linenos">2555</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2556"><a href="#L-2556"><span class="linenos">2556</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2557"><a href="#L-2557"><span class="linenos">2557</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2558"><a href="#L-2558"><span class="linenos">2558</span></a><span class="sd"> Set the ORDER BY expression.</span> -</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="sd"> Example:</span> -</span><span id="L-2561"><a href="#L-2561"><span class="linenos">2561</span></a><span class="sd"> >>> Select().from_("tbl").select("x").order_by("x DESC").sql()</span> -</span><span id="L-2562"><a href="#L-2562"><span class="linenos">2562</span></a><span class="sd"> 'SELECT x FROM tbl ORDER BY x DESC'</span> -</span><span id="L-2563"><a href="#L-2563"><span class="linenos">2563</span></a> -</span><span id="L-2564"><a href="#L-2564"><span class="linenos">2564</span></a><span class="sd"> Args:</span> -</span><span id="L-2565"><a href="#L-2565"><span class="linenos">2565</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-2566"><a href="#L-2566"><span class="linenos">2566</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="L-2567"><a href="#L-2567"><span class="linenos">2567</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Order`.</span> -</span><span id="L-2568"><a href="#L-2568"><span class="linenos">2568</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="L-2569"><a href="#L-2569"><span class="linenos">2569</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="L-2570"><a href="#L-2570"><span class="linenos">2570</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-2571"><a href="#L-2571"><span class="linenos">2571</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2572"><a href="#L-2572"><span class="linenos">2572</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-2573"><a href="#L-2573"><span class="linenos">2573</span></a> -</span><span id="L-2574"><a href="#L-2574"><span class="linenos">2574</span></a><span class="sd"> Returns:</span> -</span><span id="L-2575"><a href="#L-2575"><span class="linenos">2575</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="L-2576"><a href="#L-2576"><span class="linenos">2576</span></a><span class="sd"> """</span> -</span><span id="L-2577"><a href="#L-2577"><span class="linenos">2577</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-2578"><a href="#L-2578"><span class="linenos">2578</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2579"><a href="#L-2579"><span class="linenos">2579</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2580"><a href="#L-2580"><span class="linenos">2580</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"order"</span><span class="p">,</span> -</span><span id="L-2581"><a href="#L-2581"><span class="linenos">2581</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2582"><a href="#L-2582"><span class="linenos">2582</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2583"><a href="#L-2583"><span class="linenos">2583</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-2584"><a href="#L-2584"><span class="linenos">2584</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Order</span><span class="p">,</span> -</span><span id="L-2585"><a href="#L-2585"><span class="linenos">2585</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2586"><a href="#L-2586"><span class="linenos">2586</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2587"><a href="#L-2587"><span class="linenos">2587</span></a> <span class="p">)</span> -</span><span id="L-2588"><a href="#L-2588"><span class="linenos">2588</span></a> -</span><span id="L-2589"><a href="#L-2589"><span class="linenos">2589</span></a> <span class="k">def</span> <span class="nf">sort_by</span><span class="p">(</span> -</span><span id="L-2590"><a href="#L-2590"><span class="linenos">2590</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2591"><a href="#L-2591"><span class="linenos">2591</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-2592"><a href="#L-2592"><span class="linenos">2592</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-2593"><a href="#L-2593"><span class="linenos">2593</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-2594"><a href="#L-2594"><span class="linenos">2594</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-2595"><a href="#L-2595"><span class="linenos">2595</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2596"><a href="#L-2596"><span class="linenos">2596</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2597"><a href="#L-2597"><span class="linenos">2597</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2598"><a href="#L-2598"><span class="linenos">2598</span></a><span class="sd"> Set the SORT BY expression.</span> -</span><span id="L-2599"><a href="#L-2599"><span class="linenos">2599</span></a> -</span><span id="L-2600"><a href="#L-2600"><span class="linenos">2600</span></a><span class="sd"> Example:</span> -</span><span id="L-2601"><a href="#L-2601"><span class="linenos">2601</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sort_by("x DESC").sql(dialect="hive")</span> -</span><span id="L-2602"><a href="#L-2602"><span class="linenos">2602</span></a><span class="sd"> 'SELECT x FROM tbl SORT BY x DESC'</span> -</span><span id="L-2603"><a href="#L-2603"><span class="linenos">2603</span></a> -</span><span id="L-2604"><a href="#L-2604"><span class="linenos">2604</span></a><span class="sd"> Args:</span> -</span><span id="L-2605"><a href="#L-2605"><span class="linenos">2605</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-2606"><a href="#L-2606"><span class="linenos">2606</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="L-2607"><a href="#L-2607"><span class="linenos">2607</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `SORT`.</span> -</span><span id="L-2608"><a href="#L-2608"><span class="linenos">2608</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="L-2609"><a href="#L-2609"><span class="linenos">2609</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="L-2610"><a href="#L-2610"><span class="linenos">2610</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-2611"><a href="#L-2611"><span class="linenos">2611</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2612"><a href="#L-2612"><span class="linenos">2612</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-2613"><a href="#L-2613"><span class="linenos">2613</span></a> -</span><span id="L-2614"><a href="#L-2614"><span class="linenos">2614</span></a><span class="sd"> Returns:</span> -</span><span id="L-2615"><a href="#L-2615"><span class="linenos">2615</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="L-2616"><a href="#L-2616"><span class="linenos">2616</span></a><span class="sd"> """</span> -</span><span id="L-2617"><a href="#L-2617"><span class="linenos">2617</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-2618"><a href="#L-2618"><span class="linenos">2618</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2619"><a href="#L-2619"><span class="linenos">2619</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2620"><a href="#L-2620"><span class="linenos">2620</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"sort"</span><span class="p">,</span> -</span><span id="L-2621"><a href="#L-2621"><span class="linenos">2621</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2622"><a href="#L-2622"><span class="linenos">2622</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2623"><a href="#L-2623"><span class="linenos">2623</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-2624"><a href="#L-2624"><span class="linenos">2624</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Sort</span><span class="p">,</span> -</span><span id="L-2625"><a href="#L-2625"><span class="linenos">2625</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2626"><a href="#L-2626"><span class="linenos">2626</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2627"><a href="#L-2627"><span class="linenos">2627</span></a> <span class="p">)</span> -</span><span id="L-2628"><a href="#L-2628"><span class="linenos">2628</span></a> -</span><span id="L-2629"><a href="#L-2629"><span class="linenos">2629</span></a> <span class="k">def</span> <span class="nf">cluster_by</span><span class="p">(</span> -</span><span id="L-2630"><a href="#L-2630"><span class="linenos">2630</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2631"><a href="#L-2631"><span class="linenos">2631</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-2632"><a href="#L-2632"><span class="linenos">2632</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-2633"><a href="#L-2633"><span class="linenos">2633</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-2634"><a href="#L-2634"><span class="linenos">2634</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-2635"><a href="#L-2635"><span class="linenos">2635</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2636"><a href="#L-2636"><span class="linenos">2636</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2637"><a href="#L-2637"><span class="linenos">2637</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2638"><a href="#L-2638"><span class="linenos">2638</span></a><span class="sd"> Set the CLUSTER BY expression.</span> -</span><span id="L-2639"><a href="#L-2639"><span class="linenos">2639</span></a> -</span><span id="L-2640"><a href="#L-2640"><span class="linenos">2640</span></a><span class="sd"> Example:</span> -</span><span id="L-2641"><a href="#L-2641"><span class="linenos">2641</span></a><span class="sd"> >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql(dialect="hive")</span> -</span><span id="L-2642"><a href="#L-2642"><span class="linenos">2642</span></a><span class="sd"> 'SELECT x FROM tbl CLUSTER BY x DESC'</span> -</span><span id="L-2643"><a href="#L-2643"><span class="linenos">2643</span></a> -</span><span id="L-2644"><a href="#L-2644"><span class="linenos">2644</span></a><span class="sd"> Args:</span> -</span><span id="L-2645"><a href="#L-2645"><span class="linenos">2645</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-2646"><a href="#L-2646"><span class="linenos">2646</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="L-2647"><a href="#L-2647"><span class="linenos">2647</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Cluster`.</span> -</span><span id="L-2648"><a href="#L-2648"><span class="linenos">2648</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="L-2649"><a href="#L-2649"><span class="linenos">2649</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="L-2650"><a href="#L-2650"><span class="linenos">2650</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-2651"><a href="#L-2651"><span class="linenos">2651</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2652"><a href="#L-2652"><span class="linenos">2652</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-2653"><a href="#L-2653"><span class="linenos">2653</span></a> -</span><span id="L-2654"><a href="#L-2654"><span class="linenos">2654</span></a><span class="sd"> Returns:</span> -</span><span id="L-2655"><a href="#L-2655"><span class="linenos">2655</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="L-2656"><a href="#L-2656"><span class="linenos">2656</span></a><span class="sd"> """</span> -</span><span id="L-2657"><a href="#L-2657"><span class="linenos">2657</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-2658"><a href="#L-2658"><span class="linenos">2658</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2659"><a href="#L-2659"><span class="linenos">2659</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2660"><a href="#L-2660"><span class="linenos">2660</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"cluster"</span><span class="p">,</span> -</span><span id="L-2661"><a href="#L-2661"><span class="linenos">2661</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2662"><a href="#L-2662"><span class="linenos">2662</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2663"><a href="#L-2663"><span class="linenos">2663</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-2664"><a href="#L-2664"><span class="linenos">2664</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Cluster</span><span class="p">,</span> -</span><span id="L-2665"><a href="#L-2665"><span class="linenos">2665</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2666"><a href="#L-2666"><span class="linenos">2666</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2667"><a href="#L-2667"><span class="linenos">2667</span></a> <span class="p">)</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 class="k">def</span> <span class="nf">limit</span><span class="p">(</span> -</span><span id="L-2670"><a href="#L-2670"><span class="linenos">2670</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> -</span><span id="L-2671"><a href="#L-2671"><span class="linenos">2671</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2672"><a href="#L-2672"><span class="linenos">2672</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2673"><a href="#L-2673"><span class="linenos">2673</span></a><span class="sd"> Set the LIMIT expression.</span> -</span><span id="L-2674"><a href="#L-2674"><span class="linenos">2674</span></a> -</span><span id="L-2675"><a href="#L-2675"><span class="linenos">2675</span></a><span class="sd"> Example:</span> -</span><span id="L-2676"><a href="#L-2676"><span class="linenos">2676</span></a><span class="sd"> >>> Select().from_("tbl").select("x").limit(10).sql()</span> -</span><span id="L-2677"><a href="#L-2677"><span class="linenos">2677</span></a><span class="sd"> 'SELECT x FROM tbl LIMIT 10'</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="sd"> Args:</span> -</span><span id="L-2680"><a href="#L-2680"><span class="linenos">2680</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="L-2681"><a href="#L-2681"><span class="linenos">2681</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="L-2682"><a href="#L-2682"><span class="linenos">2682</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> -</span><span id="L-2683"><a href="#L-2683"><span class="linenos">2683</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> -</span><span id="L-2684"><a href="#L-2684"><span class="linenos">2684</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-2685"><a href="#L-2685"><span class="linenos">2685</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2686"><a href="#L-2686"><span class="linenos">2686</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</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="sd"> Returns:</span> -</span><span id="L-2689"><a href="#L-2689"><span class="linenos">2689</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-2690"><a href="#L-2690"><span class="linenos">2690</span></a><span class="sd"> """</span> -</span><span id="L-2691"><a href="#L-2691"><span class="linenos">2691</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="L-2692"><a href="#L-2692"><span class="linenos">2692</span></a> <span class="n">expression</span><span class="o">=</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">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2694"><a href="#L-2694"><span class="linenos">2694</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"limit"</span><span class="p">,</span> -</span><span id="L-2695"><a href="#L-2695"><span class="linenos">2695</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Limit</span><span class="p">,</span> -</span><span id="L-2696"><a href="#L-2696"><span class="linenos">2696</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LIMIT"</span><span class="p">,</span> -</span><span id="L-2697"><a href="#L-2697"><span class="linenos">2697</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2698"><a href="#L-2698"><span class="linenos">2698</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2699"><a href="#L-2699"><span class="linenos">2699</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2700"><a href="#L-2700"><span class="linenos">2700</span></a> <span class="p">)</span> -</span><span id="L-2701"><a href="#L-2701"><span class="linenos">2701</span></a> -</span><span id="L-2702"><a href="#L-2702"><span class="linenos">2702</span></a> <span class="k">def</span> <span class="nf">offset</span><span class="p">(</span> -</span><span id="L-2703"><a href="#L-2703"><span class="linenos">2703</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> -</span><span id="L-2704"><a href="#L-2704"><span class="linenos">2704</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2705"><a href="#L-2705"><span class="linenos">2705</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2706"><a href="#L-2706"><span class="linenos">2706</span></a><span class="sd"> Set the OFFSET expression.</span> -</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="sd"> Example:</span> -</span><span id="L-2709"><a href="#L-2709"><span class="linenos">2709</span></a><span class="sd"> >>> Select().from_("tbl").select("x").offset(10).sql()</span> -</span><span id="L-2710"><a href="#L-2710"><span class="linenos">2710</span></a><span class="sd"> 'SELECT x FROM tbl OFFSET 10'</span> -</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="sd"> Args:</span> -</span><span id="L-2713"><a href="#L-2713"><span class="linenos">2713</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="L-2714"><a href="#L-2714"><span class="linenos">2714</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="L-2715"><a href="#L-2715"><span class="linenos">2715</span></a><span class="sd"> If a `Offset` instance is passed, this is used as-is.</span> -</span><span id="L-2716"><a href="#L-2716"><span class="linenos">2716</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Offset`.</span> -</span><span id="L-2717"><a href="#L-2717"><span class="linenos">2717</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-2718"><a href="#L-2718"><span class="linenos">2718</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2719"><a href="#L-2719"><span class="linenos">2719</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-2720"><a href="#L-2720"><span class="linenos">2720</span></a> -</span><span id="L-2721"><a href="#L-2721"><span class="linenos">2721</span></a><span class="sd"> Returns:</span> -</span><span id="L-2722"><a href="#L-2722"><span class="linenos">2722</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="L-2723"><a href="#L-2723"><span class="linenos">2723</span></a><span class="sd"> """</span> -</span><span id="L-2724"><a href="#L-2724"><span class="linenos">2724</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="L-2725"><a href="#L-2725"><span class="linenos">2725</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="L-2726"><a href="#L-2726"><span class="linenos">2726</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2727"><a href="#L-2727"><span class="linenos">2727</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"offset"</span><span class="p">,</span> -</span><span id="L-2728"><a href="#L-2728"><span class="linenos">2728</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Offset</span><span class="p">,</span> -</span><span id="L-2729"><a href="#L-2729"><span class="linenos">2729</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"OFFSET"</span><span class="p">,</span> -</span><span id="L-2730"><a href="#L-2730"><span class="linenos">2730</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2731"><a href="#L-2731"><span class="linenos">2731</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2732"><a href="#L-2732"><span class="linenos">2732</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2733"><a href="#L-2733"><span class="linenos">2733</span></a> <span class="p">)</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 class="k">def</span> <span class="nf">select</span><span class="p">(</span> -</span><span id="L-2736"><a href="#L-2736"><span class="linenos">2736</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2737"><a href="#L-2737"><span class="linenos">2737</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-2738"><a href="#L-2738"><span class="linenos">2738</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-2739"><a href="#L-2739"><span class="linenos">2739</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-2740"><a href="#L-2740"><span class="linenos">2740</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-2741"><a href="#L-2741"><span class="linenos">2741</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2742"><a href="#L-2742"><span class="linenos">2742</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2743"><a href="#L-2743"><span class="linenos">2743</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2744"><a href="#L-2744"><span class="linenos">2744</span></a><span class="sd"> Append to or set the SELECT expressions.</span> -</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="sd"> Example:</span> -</span><span id="L-2747"><a href="#L-2747"><span class="linenos">2747</span></a><span class="sd"> >>> Select().select("x", "y").sql()</span> -</span><span id="L-2748"><a href="#L-2748"><span class="linenos">2748</span></a><span class="sd"> 'SELECT x, y'</span> -</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="sd"> Args:</span> -</span><span id="L-2751"><a href="#L-2751"><span class="linenos">2751</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-2752"><a href="#L-2752"><span class="linenos">2752</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2753"><a href="#L-2753"><span class="linenos">2753</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="L-2754"><a href="#L-2754"><span class="linenos">2754</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="L-2755"><a href="#L-2755"><span class="linenos">2755</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-2756"><a href="#L-2756"><span class="linenos">2756</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2757"><a href="#L-2757"><span class="linenos">2757</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-2758"><a href="#L-2758"><span class="linenos">2758</span></a> -</span><span id="L-2759"><a href="#L-2759"><span class="linenos">2759</span></a><span class="sd"> Returns:</span> -</span><span id="L-2760"><a href="#L-2760"><span class="linenos">2760</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="L-2761"><a href="#L-2761"><span class="linenos">2761</span></a><span class="sd"> """</span> -</span><span id="L-2762"><a href="#L-2762"><span class="linenos">2762</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-2763"><a href="#L-2763"><span class="linenos">2763</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2764"><a href="#L-2764"><span class="linenos">2764</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2765"><a href="#L-2765"><span class="linenos">2765</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="L-2766"><a href="#L-2766"><span class="linenos">2766</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2767"><a href="#L-2767"><span class="linenos">2767</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2768"><a href="#L-2768"><span class="linenos">2768</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2769"><a href="#L-2769"><span class="linenos">2769</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2770"><a href="#L-2770"><span class="linenos">2770</span></a> <span class="p">)</span> -</span><span id="L-2771"><a href="#L-2771"><span class="linenos">2771</span></a> -</span><span id="L-2772"><a href="#L-2772"><span class="linenos">2772</span></a> <span class="k">def</span> <span class="nf">lateral</span><span class="p">(</span> -</span><span id="L-2773"><a href="#L-2773"><span class="linenos">2773</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2774"><a href="#L-2774"><span class="linenos">2774</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-2775"><a href="#L-2775"><span class="linenos">2775</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-2776"><a href="#L-2776"><span class="linenos">2776</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-2777"><a href="#L-2777"><span class="linenos">2777</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-2778"><a href="#L-2778"><span class="linenos">2778</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2779"><a href="#L-2779"><span class="linenos">2779</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2780"><a href="#L-2780"><span class="linenos">2780</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2781"><a href="#L-2781"><span class="linenos">2781</span></a><span class="sd"> Append to or set the LATERAL expressions.</span> -</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="sd"> Example:</span> -</span><span id="L-2784"><a href="#L-2784"><span class="linenos">2784</span></a><span class="sd"> >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()</span> -</span><span id="L-2785"><a href="#L-2785"><span class="linenos">2785</span></a><span class="sd"> 'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'</span> -</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="sd"> Args:</span> -</span><span id="L-2788"><a href="#L-2788"><span class="linenos">2788</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-2789"><a href="#L-2789"><span class="linenos">2789</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2790"><a href="#L-2790"><span class="linenos">2790</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="L-2791"><a href="#L-2791"><span class="linenos">2791</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="L-2792"><a href="#L-2792"><span class="linenos">2792</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-2793"><a href="#L-2793"><span class="linenos">2793</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2794"><a href="#L-2794"><span class="linenos">2794</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-2795"><a href="#L-2795"><span class="linenos">2795</span></a> -</span><span id="L-2796"><a href="#L-2796"><span class="linenos">2796</span></a><span class="sd"> Returns:</span> -</span><span id="L-2797"><a href="#L-2797"><span class="linenos">2797</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="L-2798"><a href="#L-2798"><span class="linenos">2798</span></a><span class="sd"> """</span> -</span><span id="L-2799"><a href="#L-2799"><span class="linenos">2799</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-2800"><a href="#L-2800"><span class="linenos">2800</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2801"><a href="#L-2801"><span class="linenos">2801</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2802"><a href="#L-2802"><span class="linenos">2802</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"laterals"</span><span class="p">,</span> -</span><span id="L-2803"><a href="#L-2803"><span class="linenos">2803</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2804"><a href="#L-2804"><span class="linenos">2804</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Lateral</span><span class="p">,</span> -</span><span id="L-2805"><a href="#L-2805"><span class="linenos">2805</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-2806"><a href="#L-2806"><span class="linenos">2806</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2807"><a href="#L-2807"><span class="linenos">2807</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2808"><a href="#L-2808"><span class="linenos">2808</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2809"><a href="#L-2809"><span class="linenos">2809</span></a> <span class="p">)</span> -</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">def</span> <span class="nf">join</span><span class="p">(</span> -</span><span id="L-2812"><a href="#L-2812"><span class="linenos">2812</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2813"><a href="#L-2813"><span class="linenos">2813</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-2814"><a href="#L-2814"><span class="linenos">2814</span></a> <span class="n">on</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-2815"><a href="#L-2815"><span class="linenos">2815</span></a> <span class="n">using</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">ExpOrStr</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">ExpOrStr</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-2816"><a href="#L-2816"><span class="linenos">2816</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-2817"><a href="#L-2817"><span class="linenos">2817</span></a> <span class="n">join_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="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-2818"><a href="#L-2818"><span class="linenos">2818</span></a> <span class="n">join_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="n">Identifier</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-2819"><a href="#L-2819"><span class="linenos">2819</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-2820"><a href="#L-2820"><span class="linenos">2820</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-2821"><a href="#L-2821"><span class="linenos">2821</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2822"><a href="#L-2822"><span class="linenos">2822</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2823"><a href="#L-2823"><span class="linenos">2823</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2824"><a href="#L-2824"><span class="linenos">2824</span></a><span class="sd"> Append to or set the JOIN expressions.</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 class="sd"> Example:</span> -</span><span id="L-2827"><a href="#L-2827"><span class="linenos">2827</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()</span> -</span><span id="L-2828"><a href="#L-2828"><span class="linenos">2828</span></a><span class="sd"> 'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'</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 class="sd"> >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()</span> -</span><span id="L-2831"><a href="#L-2831"><span class="linenos">2831</span></a><span class="sd"> 'SELECT 1 FROM a JOIN b USING (x, y, z)'</span> +</span><span id="L-2180"><a href="#L-2180"><span class="linenos">2180</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> +</span><span id="L-2181"><a href="#L-2181"><span class="linenos">2181</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> +</span><span id="L-2182"><a href="#L-2182"><span class="linenos">2182</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2183"><a href="#L-2183"><span class="linenos">2183</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span> +</span><span id="L-2184"><a href="#L-2184"><span class="linenos">2184</span></a> +</span><span id="L-2185"><a href="#L-2185"><span class="linenos">2185</span></a> <span class="nd">@property</span> +</span><span id="L-2186"><a href="#L-2186"><span class="linenos">2186</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-2187"><a href="#L-2187"><span class="linenos">2187</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-2188"><a href="#L-2188"><span class="linenos">2188</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-2189"><a href="#L-2189"><span class="linenos">2189</span></a> <span class="k">return</span> <span class="p">[]</span> +</span><span id="L-2190"><a href="#L-2190"><span class="linenos">2190</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-2191"><a href="#L-2191"><span class="linenos">2191</span></a> +</span><span id="L-2192"><a href="#L-2192"><span class="linenos">2192</span></a> <span class="nd">@property</span> +</span><span id="L-2193"><a href="#L-2193"><span class="linenos">2193</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-2194"><a href="#L-2194"><span class="linenos">2194</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-2195"><a href="#L-2195"><span class="linenos">2195</span></a> +</span><span id="L-2196"><a href="#L-2196"><span class="linenos">2196</span></a> <span class="nd">@property</span> +</span><span id="L-2197"><a href="#L-2197"><span class="linenos">2197</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-2198"><a href="#L-2198"><span class="linenos">2198</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-2199"><a href="#L-2199"><span class="linenos">2199</span></a> +</span><span id="L-2200"><a href="#L-2200"><span class="linenos">2200</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> +</span><span id="L-2201"><a href="#L-2201"><span class="linenos">2201</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2202"><a href="#L-2202"><span class="linenos">2202</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-2203"><a href="#L-2203"><span class="linenos">2203</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-2204"><a href="#L-2204"><span class="linenos">2204</span></a> <span class="n">recursive</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-2205"><a href="#L-2205"><span class="linenos">2205</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-2206"><a href="#L-2206"><span class="linenos">2206</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-2207"><a href="#L-2207"><span class="linenos">2207</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-2208"><a href="#L-2208"><span class="linenos">2208</span></a> <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 class="p">)</span> <span class="o">-></span> <span class="n">Subqueryable</span><span class="p">:</span> +</span><span id="L-2210"><a href="#L-2210"><span class="linenos">2210</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2211"><a href="#L-2211"><span class="linenos">2211</span></a><span class="sd"> Append to or set the common table expressions.</span> +</span><span id="L-2212"><a href="#L-2212"><span class="linenos">2212</span></a> +</span><span id="L-2213"><a href="#L-2213"><span class="linenos">2213</span></a><span class="sd"> Example:</span> +</span><span id="L-2214"><a href="#L-2214"><span class="linenos">2214</span></a><span class="sd"> >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()</span> +</span><span id="L-2215"><a href="#L-2215"><span class="linenos">2215</span></a><span class="sd"> 'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'</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="sd"> Args:</span> +</span><span id="L-2218"><a href="#L-2218"><span class="linenos">2218</span></a><span class="sd"> alias: the SQL code string to parse as the table name.</span> +</span><span id="L-2219"><a href="#L-2219"><span class="linenos">2219</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> +</span><span id="L-2220"><a href="#L-2220"><span class="linenos">2220</span></a><span class="sd"> as_: the SQL code string to parse as the table expression.</span> +</span><span id="L-2221"><a href="#L-2221"><span class="linenos">2221</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2222"><a href="#L-2222"><span class="linenos">2222</span></a><span class="sd"> recursive: set the RECURSIVE part of the expression. Defaults to `False`.</span> +</span><span id="L-2223"><a href="#L-2223"><span class="linenos">2223</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="L-2224"><a href="#L-2224"><span class="linenos">2224</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="L-2225"><a href="#L-2225"><span class="linenos">2225</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-2226"><a href="#L-2226"><span class="linenos">2226</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2227"><a href="#L-2227"><span class="linenos">2227</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-2228"><a href="#L-2228"><span class="linenos">2228</span></a> +</span><span id="L-2229"><a href="#L-2229"><span class="linenos">2229</span></a><span class="sd"> Returns:</span> +</span><span id="L-2230"><a href="#L-2230"><span class="linenos">2230</span></a><span class="sd"> The modified expression.</span> +</span><span id="L-2231"><a href="#L-2231"><span class="linenos">2231</span></a><span class="sd"> """</span> +</span><span id="L-2232"><a href="#L-2232"><span class="linenos">2232</span></a> <span class="k">return</span> <span class="n">_apply_cte_builder</span><span class="p">(</span> +</span><span id="L-2233"><a href="#L-2233"><span class="linenos">2233</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="p">,</span> <span class="n">as_</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="n">recursive</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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> +</span><span id="L-2234"><a href="#L-2234"><span class="linenos">2234</span></a> <span class="p">)</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><span id="L-2237"><a href="#L-2237"><span class="linenos">2237</span></a><span class="n">QUERY_MODIFIERS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2238"><a href="#L-2238"><span class="linenos">2238</span></a> <span class="s2">"match"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2239"><a href="#L-2239"><span class="linenos">2239</span></a> <span class="s2">"laterals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2240"><a href="#L-2240"><span class="linenos">2240</span></a> <span class="s2">"joins"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2241"><a href="#L-2241"><span class="linenos">2241</span></a> <span class="s2">"pivots"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2242"><a href="#L-2242"><span class="linenos">2242</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2243"><a href="#L-2243"><span class="linenos">2243</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2244"><a href="#L-2244"><span class="linenos">2244</span></a> <span class="s2">"having"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2245"><a href="#L-2245"><span class="linenos">2245</span></a> <span class="s2">"qualify"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2246"><a href="#L-2246"><span class="linenos">2246</span></a> <span class="s2">"windows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2247"><a href="#L-2247"><span class="linenos">2247</span></a> <span class="s2">"distribute"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2248"><a href="#L-2248"><span class="linenos">2248</span></a> <span class="s2">"sort"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2249"><a href="#L-2249"><span class="linenos">2249</span></a> <span class="s2">"cluster"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2250"><a href="#L-2250"><span class="linenos">2250</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2251"><a href="#L-2251"><span class="linenos">2251</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2252"><a href="#L-2252"><span class="linenos">2252</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2253"><a href="#L-2253"><span class="linenos">2253</span></a> <span class="s2">"locks"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2254"><a href="#L-2254"><span class="linenos">2254</span></a> <span class="s2">"sample"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2255"><a href="#L-2255"><span class="linenos">2255</span></a> <span class="s2">"settings"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2256"><a href="#L-2256"><span class="linenos">2256</span></a> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</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><span id="L-2260"><a href="#L-2260"><span class="linenos">2260</span></a><span class="c1"># https://learn.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table?view=sql-server-ver16</span> +</span><span id="L-2261"><a href="#L-2261"><span class="linenos">2261</span></a><span class="k">class</span> <span class="nc">WithTableHint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2262"><a href="#L-2262"><span class="linenos">2262</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-2263"><a href="#L-2263"><span class="linenos">2263</span></a> +</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="c1"># https://dev.mysql.com/doc/refman/8.0/en/index-hints.html</span> +</span><span id="L-2266"><a href="#L-2266"><span class="linenos">2266</span></a><span class="k">class</span> <span class="nc">IndexTableHint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2267"><a href="#L-2267"><span class="linenos">2267</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">"target"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2268"><a href="#L-2268"><span class="linenos">2268</span></a> +</span><span id="L-2269"><a href="#L-2269"><span class="linenos">2269</span></a> +</span><span id="L-2270"><a href="#L-2270"><span class="linenos">2270</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-2271"><a href="#L-2271"><span class="linenos">2271</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2272"><a href="#L-2272"><span class="linenos">2272</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2273"><a href="#L-2273"><span class="linenos">2273</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2274"><a href="#L-2274"><span class="linenos">2274</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2275"><a href="#L-2275"><span class="linenos">2275</span></a> <span class="s2">"catalog"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2276"><a href="#L-2276"><span class="linenos">2276</span></a> <span class="s2">"laterals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2277"><a href="#L-2277"><span class="linenos">2277</span></a> <span class="s2">"joins"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2278"><a href="#L-2278"><span class="linenos">2278</span></a> <span class="s2">"pivots"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2279"><a href="#L-2279"><span class="linenos">2279</span></a> <span class="s2">"hints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2280"><a href="#L-2280"><span class="linenos">2280</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-2281"><a href="#L-2281"><span class="linenos">2281</span></a> <span class="p">}</span> +</span><span id="L-2282"><a href="#L-2282"><span class="linenos">2282</span></a> +</span><span id="L-2283"><a href="#L-2283"><span class="linenos">2283</span></a> <span class="nd">@property</span> +</span><span id="L-2284"><a href="#L-2284"><span class="linenos">2284</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-2285"><a href="#L-2285"><span class="linenos">2285</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">this</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> +</span><span id="L-2286"><a href="#L-2286"><span class="linenos">2286</span></a> <span class="k">return</span> <span class="s2">""</span> +</span><span id="L-2287"><a href="#L-2287"><span class="linenos">2287</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-2288"><a href="#L-2288"><span class="linenos">2288</span></a> +</span><span id="L-2289"><a href="#L-2289"><span class="linenos">2289</span></a> <span class="nd">@property</span> +</span><span id="L-2290"><a href="#L-2290"><span class="linenos">2290</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-2291"><a href="#L-2291"><span class="linenos">2291</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-2292"><a href="#L-2292"><span class="linenos">2292</span></a> +</span><span id="L-2293"><a href="#L-2293"><span class="linenos">2293</span></a> <span class="nd">@property</span> +</span><span id="L-2294"><a href="#L-2294"><span class="linenos">2294</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-2295"><a href="#L-2295"><span class="linenos">2295</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-2296"><a href="#L-2296"><span class="linenos">2296</span></a> +</span><span id="L-2297"><a href="#L-2297"><span class="linenos">2297</span></a> <span class="nd">@property</span> +</span><span id="L-2298"><a href="#L-2298"><span class="linenos">2298</span></a> <span class="k">def</span> <span class="nf">parts</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">Identifier</span><span class="p">]:</span> +</span><span id="L-2299"><a href="#L-2299"><span class="linenos">2299</span></a><span class="w"> </span><span class="sd">"""Return the parts of a table in order catalog, db, table."""</span> +</span><span id="L-2300"><a href="#L-2300"><span class="linenos">2300</span></a> <span class="k">return</span> <span class="p">[</span> +</span><span id="L-2301"><a href="#L-2301"><span class="linenos">2301</span></a> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Identifier</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="n">part</span><span class="p">])</span> +</span><span id="L-2302"><a href="#L-2302"><span class="linenos">2302</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"catalog"</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="L-2303"><a href="#L-2303"><span class="linenos">2303</span></a> <span class="k">if</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">part</span><span class="p">)</span> +</span><span id="L-2304"><a href="#L-2304"><span class="linenos">2304</span></a> <span class="p">]</span> +</span><span id="L-2305"><a href="#L-2305"><span class="linenos">2305</span></a> +</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="c1"># See the TSQL "Querying data in a system-versioned temporal table" page</span> +</span><span id="L-2308"><a href="#L-2308"><span class="linenos">2308</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-2309"><a href="#L-2309"><span class="linenos">2309</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2310"><a href="#L-2310"><span class="linenos">2310</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2311"><a href="#L-2311"><span class="linenos">2311</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2312"><a href="#L-2312"><span class="linenos">2312</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2313"><a href="#L-2313"><span class="linenos">2313</span></a> <span class="p">}</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><span id="L-2316"><a href="#L-2316"><span class="linenos">2316</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-2317"><a href="#L-2317"><span class="linenos">2317</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2318"><a href="#L-2318"><span class="linenos">2318</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2319"><a href="#L-2319"><span class="linenos">2319</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2320"><a href="#L-2320"><span class="linenos">2320</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2321"><a href="#L-2321"><span class="linenos">2321</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2322"><a href="#L-2322"><span class="linenos">2322</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> +</span><span id="L-2323"><a href="#L-2323"><span class="linenos">2323</span></a> <span class="p">}</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="k">def</span> <span class="nf">limit</span><span class="p">(</span> +</span><span id="L-2326"><a href="#L-2326"><span class="linenos">2326</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> +</span><span id="L-2327"><a href="#L-2327"><span class="linenos">2327</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2328"><a href="#L-2328"><span class="linenos">2328</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2329"><a href="#L-2329"><span class="linenos">2329</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="L-2330"><a href="#L-2330"><span class="linenos">2330</span></a> +</span><span id="L-2331"><a href="#L-2331"><span class="linenos">2331</span></a><span class="sd"> Example:</span> +</span><span id="L-2332"><a href="#L-2332"><span class="linenos">2332</span></a><span class="sd"> >>> select("1").union(select("1")).limit(1).sql()</span> +</span><span id="L-2333"><a href="#L-2333"><span class="linenos">2333</span></a><span class="sd"> 'SELECT * FROM (SELECT 1 UNION SELECT 1) AS _l_0 LIMIT 1'</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="sd"> Args:</span> +</span><span id="L-2336"><a href="#L-2336"><span class="linenos">2336</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="L-2337"><a href="#L-2337"><span class="linenos">2337</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="L-2338"><a href="#L-2338"><span class="linenos">2338</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> +</span><span id="L-2339"><a href="#L-2339"><span class="linenos">2339</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> +</span><span id="L-2340"><a href="#L-2340"><span class="linenos">2340</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-2341"><a href="#L-2341"><span class="linenos">2341</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2342"><a href="#L-2342"><span class="linenos">2342</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-2343"><a href="#L-2343"><span class="linenos">2343</span></a> +</span><span id="L-2344"><a href="#L-2344"><span class="linenos">2344</span></a><span class="sd"> Returns:</span> +</span><span id="L-2345"><a href="#L-2345"><span class="linenos">2345</span></a><span class="sd"> The limited subqueryable.</span> +</span><span id="L-2346"><a href="#L-2346"><span class="linenos">2346</span></a><span class="sd"> """</span> +</span><span id="L-2347"><a href="#L-2347"><span class="linenos">2347</span></a> <span class="k">return</span> <span class="p">(</span> +</span><span id="L-2348"><a href="#L-2348"><span class="linenos">2348</span></a> <span class="n">select</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span> +</span><span id="L-2349"><a href="#L-2349"><span class="linenos">2349</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-2350"><a href="#L-2350"><span class="linenos">2350</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-2351"><a href="#L-2351"><span class="linenos">2351</span></a> <span class="p">)</span> +</span><span id="L-2352"><a href="#L-2352"><span class="linenos">2352</span></a> +</span><span id="L-2353"><a href="#L-2353"><span class="linenos">2353</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> +</span><span id="L-2354"><a href="#L-2354"><span class="linenos">2354</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2355"><a href="#L-2355"><span class="linenos">2355</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-2356"><a href="#L-2356"><span class="linenos">2356</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-2357"><a href="#L-2357"><span class="linenos">2357</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-2358"><a href="#L-2358"><span class="linenos">2358</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-2359"><a href="#L-2359"><span class="linenos">2359</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2360"><a href="#L-2360"><span class="linenos">2360</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> +</span><span id="L-2361"><a href="#L-2361"><span class="linenos">2361</span></a><span class="w"> </span><span class="sd">"""Append to or set the SELECT of the union recursively.</span> +</span><span id="L-2362"><a href="#L-2362"><span class="linenos">2362</span></a> +</span><span id="L-2363"><a href="#L-2363"><span class="linenos">2363</span></a><span class="sd"> Example:</span> +</span><span id="L-2364"><a href="#L-2364"><span class="linenos">2364</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="L-2365"><a href="#L-2365"><span class="linenos">2365</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-2366"><a href="#L-2366"><span class="linenos">2366</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-2367"><a href="#L-2367"><span class="linenos">2367</span></a> +</span><span id="L-2368"><a href="#L-2368"><span class="linenos">2368</span></a><span class="sd"> Args:</span> +</span><span id="L-2369"><a href="#L-2369"><span class="linenos">2369</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-2370"><a href="#L-2370"><span class="linenos">2370</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2371"><a href="#L-2371"><span class="linenos">2371</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="L-2372"><a href="#L-2372"><span class="linenos">2372</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="L-2373"><a href="#L-2373"><span class="linenos">2373</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-2374"><a href="#L-2374"><span class="linenos">2374</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2375"><a href="#L-2375"><span class="linenos">2375</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-2376"><a href="#L-2376"><span class="linenos">2376</span></a> +</span><span id="L-2377"><a href="#L-2377"><span class="linenos">2377</span></a><span class="sd"> Returns:</span> +</span><span id="L-2378"><a href="#L-2378"><span class="linenos">2378</span></a><span class="sd"> Union: the modified expression.</span> +</span><span id="L-2379"><a href="#L-2379"><span class="linenos">2379</span></a><span class="sd"> """</span> +</span><span id="L-2380"><a href="#L-2380"><span class="linenos">2380</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-2381"><a href="#L-2381"><span class="linenos">2381</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-2382"><a href="#L-2382"><span class="linenos">2382</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-2383"><a href="#L-2383"><span class="linenos">2383</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-2384"><a href="#L-2384"><span class="linenos">2384</span></a> <span class="p">)</span> +</span><span id="L-2385"><a href="#L-2385"><span class="linenos">2385</span></a> <span class="k">return</span> <span class="n">this</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="nd">@property</span> +</span><span id="L-2388"><a href="#L-2388"><span class="linenos">2388</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-2389"><a href="#L-2389"><span class="linenos">2389</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-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="nd">@property</span> +</span><span id="L-2392"><a href="#L-2392"><span class="linenos">2392</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-2393"><a href="#L-2393"><span class="linenos">2393</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-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="nd">@property</span> +</span><span id="L-2396"><a href="#L-2396"><span class="linenos">2396</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-2397"><a href="#L-2397"><span class="linenos">2397</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-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="nd">@property</span> +</span><span id="L-2400"><a href="#L-2400"><span class="linenos">2400</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-2401"><a href="#L-2401"><span class="linenos">2401</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-2402"><a href="#L-2402"><span class="linenos">2402</span></a> +</span><span id="L-2403"><a href="#L-2403"><span class="linenos">2403</span></a> <span class="nd">@property</span> +</span><span id="L-2404"><a href="#L-2404"><span class="linenos">2404</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-2405"><a href="#L-2405"><span class="linenos">2405</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-2406"><a href="#L-2406"><span class="linenos">2406</span></a> +</span><span id="L-2407"><a href="#L-2407"><span class="linenos">2407</span></a> +</span><span id="L-2408"><a href="#L-2408"><span class="linenos">2408</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-2409"><a href="#L-2409"><span class="linenos">2409</span></a> <span class="k">pass</span> +</span><span id="L-2410"><a href="#L-2410"><span class="linenos">2410</span></a> +</span><span id="L-2411"><a href="#L-2411"><span class="linenos">2411</span></a> +</span><span id="L-2412"><a href="#L-2412"><span class="linenos">2412</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-2413"><a href="#L-2413"><span class="linenos">2413</span></a> <span class="k">pass</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><span id="L-2416"><a href="#L-2416"><span class="linenos">2416</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-2417"><a href="#L-2417"><span class="linenos">2417</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2418"><a href="#L-2418"><span class="linenos">2418</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2419"><a href="#L-2419"><span class="linenos">2419</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2420"><a href="#L-2420"><span class="linenos">2420</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2421"><a href="#L-2421"><span class="linenos">2421</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2422"><a href="#L-2422"><span class="linenos">2422</span></a> <span class="p">}</span> +</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><span id="L-2425"><a href="#L-2425"><span class="linenos">2425</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-2426"><a href="#L-2426"><span class="linenos">2426</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2427"><a href="#L-2427"><span class="linenos">2427</span></a> <span class="s2">"with"</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">"this"</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="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2430"><a href="#L-2430"><span class="linenos">2430</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2431"><a href="#L-2431"><span class="linenos">2431</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2432"><a href="#L-2432"><span class="linenos">2432</span></a> <span class="s2">"returning"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2433"><a href="#L-2433"><span class="linenos">2433</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2434"><a href="#L-2434"><span class="linenos">2434</span></a> <span class="p">}</span> +</span><span id="L-2435"><a href="#L-2435"><span class="linenos">2435</span></a> +</span><span id="L-2436"><a href="#L-2436"><span class="linenos">2436</span></a> +</span><span id="L-2437"><a href="#L-2437"><span class="linenos">2437</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-2438"><a href="#L-2438"><span class="linenos">2438</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2439"><a href="#L-2439"><span class="linenos">2439</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2440"><a href="#L-2440"><span class="linenos">2440</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2441"><a href="#L-2441"><span class="linenos">2441</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2442"><a href="#L-2442"><span class="linenos">2442</span></a> <span class="p">}</span> +</span><span id="L-2443"><a href="#L-2443"><span class="linenos">2443</span></a> +</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 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-2446"><a href="#L-2446"><span class="linenos">2446</span></a> <span class="k">pass</span> +</span><span id="L-2447"><a href="#L-2447"><span class="linenos">2447</span></a> +</span><span id="L-2448"><a href="#L-2448"><span class="linenos">2448</span></a> +</span><span id="L-2449"><a href="#L-2449"><span class="linenos">2449</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-2450"><a href="#L-2450"><span class="linenos">2450</span></a> <span class="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-2451"><a href="#L-2451"><span class="linenos">2451</span></a> +</span><span id="L-2452"><a href="#L-2452"><span class="linenos">2452</span></a> +</span><span id="L-2453"><a href="#L-2453"><span class="linenos">2453</span></a><span class="c1"># https://dev.mysql.com/doc/refman/8.0/en/select.html</span> +</span><span id="L-2454"><a href="#L-2454"><span class="linenos">2454</span></a><span class="c1"># https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/SELECT.html</span> +</span><span id="L-2455"><a href="#L-2455"><span class="linenos">2455</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-2456"><a href="#L-2456"><span class="linenos">2456</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 class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"wait"</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><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 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-2460"><a href="#L-2460"><span class="linenos">2460</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2461"><a href="#L-2461"><span class="linenos">2461</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2462"><a href="#L-2462"><span class="linenos">2462</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2463"><a href="#L-2463"><span class="linenos">2463</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2464"><a href="#L-2464"><span class="linenos">2464</span></a> <span class="s2">"hint"</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">"distinct"</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">"into"</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="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2468"><a href="#L-2468"><span class="linenos">2468</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> +</span><span id="L-2469"><a href="#L-2469"><span class="linenos">2469</span></a> <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="k">def</span> <span class="nf">from_</span><span class="p">(</span> +</span><span id="L-2472"><a href="#L-2472"><span class="linenos">2472</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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="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">opts</span> +</span><span id="L-2473"><a href="#L-2473"><span class="linenos">2473</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2474"><a href="#L-2474"><span class="linenos">2474</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2475"><a href="#L-2475"><span class="linenos">2475</span></a><span class="sd"> Set the FROM expression.</span> +</span><span id="L-2476"><a href="#L-2476"><span class="linenos">2476</span></a> +</span><span id="L-2477"><a href="#L-2477"><span class="linenos">2477</span></a><span class="sd"> Example:</span> +</span><span id="L-2478"><a href="#L-2478"><span class="linenos">2478</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sql()</span> +</span><span id="L-2479"><a href="#L-2479"><span class="linenos">2479</span></a><span class="sd"> 'SELECT x FROM tbl'</span> +</span><span id="L-2480"><a href="#L-2480"><span class="linenos">2480</span></a> +</span><span id="L-2481"><a href="#L-2481"><span class="linenos">2481</span></a><span class="sd"> Args:</span> +</span><span id="L-2482"><a href="#L-2482"><span class="linenos">2482</span></a><span class="sd"> expression : the SQL code strings to parse.</span> +</span><span id="L-2483"><a href="#L-2483"><span class="linenos">2483</span></a><span class="sd"> If a `From` instance is passed, this is used as-is.</span> +</span><span id="L-2484"><a href="#L-2484"><span class="linenos">2484</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `From`.</span> +</span><span id="L-2485"><a href="#L-2485"><span class="linenos">2485</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-2486"><a href="#L-2486"><span class="linenos">2486</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2487"><a href="#L-2487"><span class="linenos">2487</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</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="sd"> Returns:</span> +</span><span id="L-2490"><a href="#L-2490"><span class="linenos">2490</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="L-2491"><a href="#L-2491"><span class="linenos">2491</span></a><span class="sd"> """</span> +</span><span id="L-2492"><a href="#L-2492"><span class="linenos">2492</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="L-2493"><a href="#L-2493"><span class="linenos">2493</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="L-2494"><a href="#L-2494"><span class="linenos">2494</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2495"><a href="#L-2495"><span class="linenos">2495</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"from"</span><span class="p">,</span> +</span><span id="L-2496"><a href="#L-2496"><span class="linenos">2496</span></a> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> +</span><span id="L-2497"><a href="#L-2497"><span class="linenos">2497</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> +</span><span id="L-2498"><a href="#L-2498"><span class="linenos">2498</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2499"><a href="#L-2499"><span class="linenos">2499</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2500"><a href="#L-2500"><span class="linenos">2500</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2501"><a href="#L-2501"><span class="linenos">2501</span></a> <span class="p">)</span> +</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">def</span> <span class="nf">group_by</span><span class="p">(</span> +</span><span id="L-2504"><a href="#L-2504"><span class="linenos">2504</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2505"><a href="#L-2505"><span class="linenos">2505</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-2506"><a href="#L-2506"><span class="linenos">2506</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-2507"><a href="#L-2507"><span class="linenos">2507</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-2508"><a href="#L-2508"><span class="linenos">2508</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-2509"><a href="#L-2509"><span class="linenos">2509</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2510"><a href="#L-2510"><span class="linenos">2510</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2511"><a href="#L-2511"><span class="linenos">2511</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2512"><a href="#L-2512"><span class="linenos">2512</span></a><span class="sd"> Set the GROUP BY expression.</span> +</span><span id="L-2513"><a href="#L-2513"><span class="linenos">2513</span></a> +</span><span id="L-2514"><a href="#L-2514"><span class="linenos">2514</span></a><span class="sd"> Example:</span> +</span><span id="L-2515"><a href="#L-2515"><span class="linenos">2515</span></a><span class="sd"> >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()</span> +</span><span id="L-2516"><a href="#L-2516"><span class="linenos">2516</span></a><span class="sd"> 'SELECT x, COUNT(1) FROM tbl GROUP BY x'</span> +</span><span id="L-2517"><a href="#L-2517"><span class="linenos">2517</span></a> +</span><span id="L-2518"><a href="#L-2518"><span class="linenos">2518</span></a><span class="sd"> Args:</span> +</span><span id="L-2519"><a href="#L-2519"><span class="linenos">2519</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-2520"><a href="#L-2520"><span class="linenos">2520</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="L-2521"><a href="#L-2521"><span class="linenos">2521</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Group`.</span> +</span><span id="L-2522"><a href="#L-2522"><span class="linenos">2522</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-2523"><a href="#L-2523"><span class="linenos">2523</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="L-2524"><a href="#L-2524"><span class="linenos">2524</span></a><span class="sd"> Otherwise, this flattens all the `Group` expression into a single expression.</span> +</span><span id="L-2525"><a href="#L-2525"><span class="linenos">2525</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-2526"><a href="#L-2526"><span class="linenos">2526</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2527"><a href="#L-2527"><span class="linenos">2527</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-2528"><a href="#L-2528"><span class="linenos">2528</span></a> +</span><span id="L-2529"><a href="#L-2529"><span class="linenos">2529</span></a><span class="sd"> Returns:</span> +</span><span id="L-2530"><a href="#L-2530"><span class="linenos">2530</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="L-2531"><a href="#L-2531"><span class="linenos">2531</span></a><span class="sd"> """</span> +</span><span id="L-2532"><a href="#L-2532"><span class="linenos">2532</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-2533"><a href="#L-2533"><span class="linenos">2533</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-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">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-2536"><a href="#L-2536"><span class="linenos">2536</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2537"><a href="#L-2537"><span class="linenos">2537</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2538"><a href="#L-2538"><span class="linenos">2538</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"group"</span><span class="p">,</span> +</span><span id="L-2539"><a href="#L-2539"><span class="linenos">2539</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2540"><a href="#L-2540"><span class="linenos">2540</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2541"><a href="#L-2541"><span class="linenos">2541</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-2542"><a href="#L-2542"><span class="linenos">2542</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Group</span><span class="p">,</span> +</span><span id="L-2543"><a href="#L-2543"><span class="linenos">2543</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2544"><a href="#L-2544"><span class="linenos">2544</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2545"><a href="#L-2545"><span class="linenos">2545</span></a> <span class="p">)</span> +</span><span id="L-2546"><a href="#L-2546"><span class="linenos">2546</span></a> +</span><span id="L-2547"><a href="#L-2547"><span class="linenos">2547</span></a> <span class="k">def</span> <span class="nf">order_by</span><span class="p">(</span> +</span><span id="L-2548"><a href="#L-2548"><span class="linenos">2548</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2549"><a href="#L-2549"><span class="linenos">2549</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-2550"><a href="#L-2550"><span class="linenos">2550</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-2551"><a href="#L-2551"><span class="linenos">2551</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-2552"><a href="#L-2552"><span class="linenos">2552</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-2553"><a href="#L-2553"><span class="linenos">2553</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2554"><a href="#L-2554"><span class="linenos">2554</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2555"><a href="#L-2555"><span class="linenos">2555</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2556"><a href="#L-2556"><span class="linenos">2556</span></a><span class="sd"> Set the ORDER BY expression.</span> +</span><span id="L-2557"><a href="#L-2557"><span class="linenos">2557</span></a> +</span><span id="L-2558"><a href="#L-2558"><span class="linenos">2558</span></a><span class="sd"> Example:</span> +</span><span id="L-2559"><a href="#L-2559"><span class="linenos">2559</span></a><span class="sd"> >>> Select().from_("tbl").select("x").order_by("x DESC").sql()</span> +</span><span id="L-2560"><a href="#L-2560"><span class="linenos">2560</span></a><span class="sd"> 'SELECT x FROM tbl ORDER BY x DESC'</span> +</span><span id="L-2561"><a href="#L-2561"><span class="linenos">2561</span></a> +</span><span id="L-2562"><a href="#L-2562"><span class="linenos">2562</span></a><span class="sd"> Args:</span> +</span><span id="L-2563"><a href="#L-2563"><span class="linenos">2563</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-2564"><a href="#L-2564"><span class="linenos">2564</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="L-2565"><a href="#L-2565"><span class="linenos">2565</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Order`.</span> +</span><span id="L-2566"><a href="#L-2566"><span class="linenos">2566</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="L-2567"><a href="#L-2567"><span class="linenos">2567</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="L-2568"><a href="#L-2568"><span class="linenos">2568</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-2569"><a href="#L-2569"><span class="linenos">2569</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2570"><a href="#L-2570"><span class="linenos">2570</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</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="sd"> Returns:</span> +</span><span id="L-2573"><a href="#L-2573"><span class="linenos">2573</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="L-2574"><a href="#L-2574"><span class="linenos">2574</span></a><span class="sd"> """</span> +</span><span id="L-2575"><a href="#L-2575"><span class="linenos">2575</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-2576"><a href="#L-2576"><span class="linenos">2576</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2577"><a href="#L-2577"><span class="linenos">2577</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2578"><a href="#L-2578"><span class="linenos">2578</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"order"</span><span class="p">,</span> +</span><span id="L-2579"><a href="#L-2579"><span class="linenos">2579</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2580"><a href="#L-2580"><span class="linenos">2580</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2581"><a href="#L-2581"><span class="linenos">2581</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-2582"><a href="#L-2582"><span class="linenos">2582</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Order</span><span class="p">,</span> +</span><span id="L-2583"><a href="#L-2583"><span class="linenos">2583</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2584"><a href="#L-2584"><span class="linenos">2584</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2585"><a href="#L-2585"><span class="linenos">2585</span></a> <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="k">def</span> <span class="nf">sort_by</span><span class="p">(</span> +</span><span id="L-2588"><a href="#L-2588"><span class="linenos">2588</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2589"><a href="#L-2589"><span class="linenos">2589</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-2590"><a href="#L-2590"><span class="linenos">2590</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-2591"><a href="#L-2591"><span class="linenos">2591</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-2592"><a href="#L-2592"><span class="linenos">2592</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-2593"><a href="#L-2593"><span class="linenos">2593</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2594"><a href="#L-2594"><span class="linenos">2594</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2595"><a href="#L-2595"><span class="linenos">2595</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2596"><a href="#L-2596"><span class="linenos">2596</span></a><span class="sd"> Set the SORT BY expression.</span> +</span><span id="L-2597"><a href="#L-2597"><span class="linenos">2597</span></a> +</span><span id="L-2598"><a href="#L-2598"><span class="linenos">2598</span></a><span class="sd"> Example:</span> +</span><span id="L-2599"><a href="#L-2599"><span class="linenos">2599</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sort_by("x DESC").sql(dialect="hive")</span> +</span><span id="L-2600"><a href="#L-2600"><span class="linenos">2600</span></a><span class="sd"> 'SELECT x FROM tbl SORT BY x DESC'</span> +</span><span id="L-2601"><a href="#L-2601"><span class="linenos">2601</span></a> +</span><span id="L-2602"><a href="#L-2602"><span class="linenos">2602</span></a><span class="sd"> Args:</span> +</span><span id="L-2603"><a href="#L-2603"><span class="linenos">2603</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-2604"><a href="#L-2604"><span class="linenos">2604</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="L-2605"><a href="#L-2605"><span class="linenos">2605</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `SORT`.</span> +</span><span id="L-2606"><a href="#L-2606"><span class="linenos">2606</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="L-2607"><a href="#L-2607"><span class="linenos">2607</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="L-2608"><a href="#L-2608"><span class="linenos">2608</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-2609"><a href="#L-2609"><span class="linenos">2609</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2610"><a href="#L-2610"><span class="linenos">2610</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-2611"><a href="#L-2611"><span class="linenos">2611</span></a> +</span><span id="L-2612"><a href="#L-2612"><span class="linenos">2612</span></a><span class="sd"> Returns:</span> +</span><span id="L-2613"><a href="#L-2613"><span class="linenos">2613</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="L-2614"><a href="#L-2614"><span class="linenos">2614</span></a><span class="sd"> """</span> +</span><span id="L-2615"><a href="#L-2615"><span class="linenos">2615</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-2616"><a href="#L-2616"><span class="linenos">2616</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2617"><a href="#L-2617"><span class="linenos">2617</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2618"><a href="#L-2618"><span class="linenos">2618</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"sort"</span><span class="p">,</span> +</span><span id="L-2619"><a href="#L-2619"><span class="linenos">2619</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2620"><a href="#L-2620"><span class="linenos">2620</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2621"><a href="#L-2621"><span class="linenos">2621</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-2622"><a href="#L-2622"><span class="linenos">2622</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Sort</span><span class="p">,</span> +</span><span id="L-2623"><a href="#L-2623"><span class="linenos">2623</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2624"><a href="#L-2624"><span class="linenos">2624</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2625"><a href="#L-2625"><span class="linenos">2625</span></a> <span class="p">)</span> +</span><span id="L-2626"><a href="#L-2626"><span class="linenos">2626</span></a> +</span><span id="L-2627"><a href="#L-2627"><span class="linenos">2627</span></a> <span class="k">def</span> <span class="nf">cluster_by</span><span class="p">(</span> +</span><span id="L-2628"><a href="#L-2628"><span class="linenos">2628</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2629"><a href="#L-2629"><span class="linenos">2629</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-2630"><a href="#L-2630"><span class="linenos">2630</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-2631"><a href="#L-2631"><span class="linenos">2631</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-2632"><a href="#L-2632"><span class="linenos">2632</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-2633"><a href="#L-2633"><span class="linenos">2633</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</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">Select</span><span class="p">:</span> +</span><span id="L-2635"><a href="#L-2635"><span class="linenos">2635</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2636"><a href="#L-2636"><span class="linenos">2636</span></a><span class="sd"> Set the CLUSTER BY expression.</span> +</span><span id="L-2637"><a href="#L-2637"><span class="linenos">2637</span></a> +</span><span id="L-2638"><a href="#L-2638"><span class="linenos">2638</span></a><span class="sd"> Example:</span> +</span><span id="L-2639"><a href="#L-2639"><span class="linenos">2639</span></a><span class="sd"> >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql(dialect="hive")</span> +</span><span id="L-2640"><a href="#L-2640"><span class="linenos">2640</span></a><span class="sd"> 'SELECT x FROM tbl CLUSTER BY x DESC'</span> +</span><span id="L-2641"><a href="#L-2641"><span class="linenos">2641</span></a> +</span><span id="L-2642"><a href="#L-2642"><span class="linenos">2642</span></a><span class="sd"> Args:</span> +</span><span id="L-2643"><a href="#L-2643"><span class="linenos">2643</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-2644"><a href="#L-2644"><span class="linenos">2644</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="L-2645"><a href="#L-2645"><span class="linenos">2645</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Cluster`.</span> +</span><span id="L-2646"><a href="#L-2646"><span class="linenos">2646</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="L-2647"><a href="#L-2647"><span class="linenos">2647</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="L-2648"><a href="#L-2648"><span class="linenos">2648</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-2649"><a href="#L-2649"><span class="linenos">2649</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2650"><a href="#L-2650"><span class="linenos">2650</span></a><span class="sd"> opts: other options to use to parse the input expressions.</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="sd"> Returns:</span> +</span><span id="L-2653"><a href="#L-2653"><span class="linenos">2653</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="L-2654"><a href="#L-2654"><span class="linenos">2654</span></a><span class="sd"> """</span> +</span><span id="L-2655"><a href="#L-2655"><span class="linenos">2655</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-2656"><a href="#L-2656"><span class="linenos">2656</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2657"><a href="#L-2657"><span class="linenos">2657</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2658"><a href="#L-2658"><span class="linenos">2658</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"cluster"</span><span class="p">,</span> +</span><span id="L-2659"><a href="#L-2659"><span class="linenos">2659</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2660"><a href="#L-2660"><span class="linenos">2660</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2661"><a href="#L-2661"><span class="linenos">2661</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-2662"><a href="#L-2662"><span class="linenos">2662</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Cluster</span><span class="p">,</span> +</span><span id="L-2663"><a href="#L-2663"><span class="linenos">2663</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2664"><a href="#L-2664"><span class="linenos">2664</span></a> <span class="o">**</span><span class="n">opts</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="k">def</span> <span class="nf">limit</span><span class="p">(</span> +</span><span id="L-2668"><a href="#L-2668"><span class="linenos">2668</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> +</span><span id="L-2669"><a href="#L-2669"><span class="linenos">2669</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2670"><a href="#L-2670"><span class="linenos">2670</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2671"><a href="#L-2671"><span class="linenos">2671</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="L-2672"><a href="#L-2672"><span class="linenos">2672</span></a> +</span><span id="L-2673"><a href="#L-2673"><span class="linenos">2673</span></a><span class="sd"> Example:</span> +</span><span id="L-2674"><a href="#L-2674"><span class="linenos">2674</span></a><span class="sd"> >>> Select().from_("tbl").select("x").limit(10).sql()</span> +</span><span id="L-2675"><a href="#L-2675"><span class="linenos">2675</span></a><span class="sd"> 'SELECT x FROM tbl LIMIT 10'</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 class="sd"> Args:</span> +</span><span id="L-2678"><a href="#L-2678"><span class="linenos">2678</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="L-2679"><a href="#L-2679"><span class="linenos">2679</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="L-2680"><a href="#L-2680"><span class="linenos">2680</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> +</span><span id="L-2681"><a href="#L-2681"><span class="linenos">2681</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> +</span><span id="L-2682"><a href="#L-2682"><span class="linenos">2682</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-2683"><a href="#L-2683"><span class="linenos">2683</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2684"><a href="#L-2684"><span class="linenos">2684</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-2685"><a href="#L-2685"><span class="linenos">2685</span></a> +</span><span id="L-2686"><a href="#L-2686"><span class="linenos">2686</span></a><span class="sd"> Returns:</span> +</span><span id="L-2687"><a href="#L-2687"><span class="linenos">2687</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2688"><a href="#L-2688"><span class="linenos">2688</span></a><span class="sd"> """</span> +</span><span id="L-2689"><a href="#L-2689"><span class="linenos">2689</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="L-2690"><a href="#L-2690"><span class="linenos">2690</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="L-2691"><a href="#L-2691"><span class="linenos">2691</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2692"><a href="#L-2692"><span class="linenos">2692</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"limit"</span><span class="p">,</span> +</span><span id="L-2693"><a href="#L-2693"><span class="linenos">2693</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Limit</span><span class="p">,</span> +</span><span id="L-2694"><a href="#L-2694"><span class="linenos">2694</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LIMIT"</span><span class="p">,</span> +</span><span id="L-2695"><a href="#L-2695"><span class="linenos">2695</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2696"><a href="#L-2696"><span class="linenos">2696</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2697"><a href="#L-2697"><span class="linenos">2697</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2698"><a href="#L-2698"><span class="linenos">2698</span></a> <span class="p">)</span> +</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">def</span> <span class="nf">offset</span><span class="p">(</span> +</span><span id="L-2701"><a href="#L-2701"><span class="linenos">2701</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> +</span><span id="L-2702"><a href="#L-2702"><span class="linenos">2702</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2703"><a href="#L-2703"><span class="linenos">2703</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2704"><a href="#L-2704"><span class="linenos">2704</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="L-2705"><a href="#L-2705"><span class="linenos">2705</span></a> +</span><span id="L-2706"><a href="#L-2706"><span class="linenos">2706</span></a><span class="sd"> Example:</span> +</span><span id="L-2707"><a href="#L-2707"><span class="linenos">2707</span></a><span class="sd"> >>> Select().from_("tbl").select("x").offset(10).sql()</span> +</span><span id="L-2708"><a href="#L-2708"><span class="linenos">2708</span></a><span class="sd"> 'SELECT x FROM tbl OFFSET 10'</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="sd"> Args:</span> +</span><span id="L-2711"><a href="#L-2711"><span class="linenos">2711</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="L-2712"><a href="#L-2712"><span class="linenos">2712</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="L-2713"><a href="#L-2713"><span class="linenos">2713</span></a><span class="sd"> If a `Offset` instance is passed, this is used as-is.</span> +</span><span id="L-2714"><a href="#L-2714"><span class="linenos">2714</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Offset`.</span> +</span><span id="L-2715"><a href="#L-2715"><span class="linenos">2715</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-2716"><a href="#L-2716"><span class="linenos">2716</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2717"><a href="#L-2717"><span class="linenos">2717</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</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="sd"> Returns:</span> +</span><span id="L-2720"><a href="#L-2720"><span class="linenos">2720</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="L-2721"><a href="#L-2721"><span class="linenos">2721</span></a><span class="sd"> """</span> +</span><span id="L-2722"><a href="#L-2722"><span class="linenos">2722</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="L-2723"><a href="#L-2723"><span class="linenos">2723</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="L-2724"><a href="#L-2724"><span class="linenos">2724</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2725"><a href="#L-2725"><span class="linenos">2725</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"offset"</span><span class="p">,</span> +</span><span id="L-2726"><a href="#L-2726"><span class="linenos">2726</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Offset</span><span class="p">,</span> +</span><span id="L-2727"><a href="#L-2727"><span class="linenos">2727</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"OFFSET"</span><span class="p">,</span> +</span><span id="L-2728"><a href="#L-2728"><span class="linenos">2728</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2729"><a href="#L-2729"><span class="linenos">2729</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2730"><a href="#L-2730"><span class="linenos">2730</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2731"><a href="#L-2731"><span class="linenos">2731</span></a> <span class="p">)</span> +</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">def</span> <span class="nf">select</span><span class="p">(</span> +</span><span id="L-2734"><a href="#L-2734"><span class="linenos">2734</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2735"><a href="#L-2735"><span class="linenos">2735</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-2736"><a href="#L-2736"><span class="linenos">2736</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-2737"><a href="#L-2737"><span class="linenos">2737</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-2738"><a href="#L-2738"><span class="linenos">2738</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-2739"><a href="#L-2739"><span class="linenos">2739</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2740"><a href="#L-2740"><span class="linenos">2740</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2741"><a href="#L-2741"><span class="linenos">2741</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2742"><a href="#L-2742"><span class="linenos">2742</span></a><span class="sd"> Append to or set the SELECT expressions.</span> +</span><span id="L-2743"><a href="#L-2743"><span class="linenos">2743</span></a> +</span><span id="L-2744"><a href="#L-2744"><span class="linenos">2744</span></a><span class="sd"> Example:</span> +</span><span id="L-2745"><a href="#L-2745"><span class="linenos">2745</span></a><span class="sd"> >>> Select().select("x", "y").sql()</span> +</span><span id="L-2746"><a href="#L-2746"><span class="linenos">2746</span></a><span class="sd"> 'SELECT x, y'</span> +</span><span id="L-2747"><a href="#L-2747"><span class="linenos">2747</span></a> +</span><span id="L-2748"><a href="#L-2748"><span class="linenos">2748</span></a><span class="sd"> Args:</span> +</span><span id="L-2749"><a href="#L-2749"><span class="linenos">2749</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-2750"><a href="#L-2750"><span class="linenos">2750</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2751"><a href="#L-2751"><span class="linenos">2751</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="L-2752"><a href="#L-2752"><span class="linenos">2752</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="L-2753"><a href="#L-2753"><span class="linenos">2753</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-2754"><a href="#L-2754"><span class="linenos">2754</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2755"><a href="#L-2755"><span class="linenos">2755</span></a><span class="sd"> opts: other options to use to parse the input expressions.</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="sd"> Returns:</span> +</span><span id="L-2758"><a href="#L-2758"><span class="linenos">2758</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="L-2759"><a href="#L-2759"><span class="linenos">2759</span></a><span class="sd"> """</span> +</span><span id="L-2760"><a href="#L-2760"><span class="linenos">2760</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-2761"><a href="#L-2761"><span class="linenos">2761</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2762"><a href="#L-2762"><span class="linenos">2762</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2763"><a href="#L-2763"><span class="linenos">2763</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="L-2764"><a href="#L-2764"><span class="linenos">2764</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2765"><a href="#L-2765"><span class="linenos">2765</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2766"><a href="#L-2766"><span class="linenos">2766</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2767"><a href="#L-2767"><span class="linenos">2767</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2768"><a href="#L-2768"><span class="linenos">2768</span></a> <span class="p">)</span> +</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 class="k">def</span> <span class="nf">lateral</span><span class="p">(</span> +</span><span id="L-2771"><a href="#L-2771"><span class="linenos">2771</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2772"><a href="#L-2772"><span class="linenos">2772</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-2773"><a href="#L-2773"><span class="linenos">2773</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-2774"><a href="#L-2774"><span class="linenos">2774</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-2775"><a href="#L-2775"><span class="linenos">2775</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-2776"><a href="#L-2776"><span class="linenos">2776</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2777"><a href="#L-2777"><span class="linenos">2777</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2778"><a href="#L-2778"><span class="linenos">2778</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2779"><a href="#L-2779"><span class="linenos">2779</span></a><span class="sd"> Append to or set the LATERAL expressions.</span> +</span><span id="L-2780"><a href="#L-2780"><span class="linenos">2780</span></a> +</span><span id="L-2781"><a href="#L-2781"><span class="linenos">2781</span></a><span class="sd"> Example:</span> +</span><span id="L-2782"><a href="#L-2782"><span class="linenos">2782</span></a><span class="sd"> >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()</span> +</span><span id="L-2783"><a href="#L-2783"><span class="linenos">2783</span></a><span class="sd"> 'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'</span> +</span><span id="L-2784"><a href="#L-2784"><span class="linenos">2784</span></a> +</span><span id="L-2785"><a href="#L-2785"><span class="linenos">2785</span></a><span class="sd"> Args:</span> +</span><span id="L-2786"><a href="#L-2786"><span class="linenos">2786</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-2787"><a href="#L-2787"><span class="linenos">2787</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2788"><a href="#L-2788"><span class="linenos">2788</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="L-2789"><a href="#L-2789"><span class="linenos">2789</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="L-2790"><a href="#L-2790"><span class="linenos">2790</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-2791"><a href="#L-2791"><span class="linenos">2791</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2792"><a href="#L-2792"><span class="linenos">2792</span></a><span class="sd"> opts: other options to use to parse the input expressions.</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 class="sd"> Returns:</span> +</span><span id="L-2795"><a href="#L-2795"><span class="linenos">2795</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="L-2796"><a href="#L-2796"><span class="linenos">2796</span></a><span class="sd"> """</span> +</span><span id="L-2797"><a href="#L-2797"><span class="linenos">2797</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-2798"><a href="#L-2798"><span class="linenos">2798</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2799"><a href="#L-2799"><span class="linenos">2799</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2800"><a href="#L-2800"><span class="linenos">2800</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"laterals"</span><span class="p">,</span> +</span><span id="L-2801"><a href="#L-2801"><span class="linenos">2801</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2802"><a href="#L-2802"><span class="linenos">2802</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Lateral</span><span class="p">,</span> +</span><span id="L-2803"><a href="#L-2803"><span class="linenos">2803</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-2804"><a href="#L-2804"><span class="linenos">2804</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2805"><a href="#L-2805"><span class="linenos">2805</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2806"><a href="#L-2806"><span class="linenos">2806</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2807"><a href="#L-2807"><span class="linenos">2807</span></a> <span class="p">)</span> +</span><span id="L-2808"><a href="#L-2808"><span class="linenos">2808</span></a> +</span><span id="L-2809"><a href="#L-2809"><span class="linenos">2809</span></a> <span class="k">def</span> <span class="nf">join</span><span class="p">(</span> +</span><span id="L-2810"><a href="#L-2810"><span class="linenos">2810</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2811"><a href="#L-2811"><span class="linenos">2811</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-2812"><a href="#L-2812"><span class="linenos">2812</span></a> <span class="n">on</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-2813"><a href="#L-2813"><span class="linenos">2813</span></a> <span class="n">using</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">ExpOrStr</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">ExpOrStr</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-2814"><a href="#L-2814"><span class="linenos">2814</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-2815"><a href="#L-2815"><span class="linenos">2815</span></a> <span class="n">join_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="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-2816"><a href="#L-2816"><span class="linenos">2816</span></a> <span class="n">join_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="n">Identifier</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-2817"><a href="#L-2817"><span class="linenos">2817</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-2818"><a href="#L-2818"><span class="linenos">2818</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-2819"><a href="#L-2819"><span class="linenos">2819</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2820"><a href="#L-2820"><span class="linenos">2820</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2821"><a href="#L-2821"><span class="linenos">2821</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2822"><a href="#L-2822"><span class="linenos">2822</span></a><span class="sd"> Append to or set the JOIN expressions.</span> +</span><span id="L-2823"><a href="#L-2823"><span class="linenos">2823</span></a> +</span><span id="L-2824"><a href="#L-2824"><span class="linenos">2824</span></a><span class="sd"> Example:</span> +</span><span id="L-2825"><a href="#L-2825"><span class="linenos">2825</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()</span> +</span><span id="L-2826"><a href="#L-2826"><span class="linenos">2826</span></a><span class="sd"> 'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'</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 class="sd"> >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()</span> +</span><span id="L-2829"><a href="#L-2829"><span class="linenos">2829</span></a><span class="sd"> 'SELECT 1 FROM a JOIN b USING (x, y, z)'</span> +</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="sd"> Use `join_type` to change the type of join:</span> </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="sd"> Use `join_type` to change the type of join:</span> -</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="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y", join_type="left outer").sql()</span> -</span><span id="L-2836"><a href="#L-2836"><span class="linenos">2836</span></a><span class="sd"> 'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'</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 class="sd"> Args:</span> -</span><span id="L-2839"><a href="#L-2839"><span class="linenos">2839</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="L-2833"><a href="#L-2833"><span class="linenos">2833</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-2834"><a href="#L-2834"><span class="linenos">2834</span></a><span class="sd"> 'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'</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 class="sd"> Args:</span> +</span><span id="L-2837"><a href="#L-2837"><span class="linenos">2837</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="L-2838"><a href="#L-2838"><span class="linenos">2838</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2839"><a href="#L-2839"><span class="linenos">2839</span></a><span class="sd"> on: optionally specify the join "on" criteria as a SQL string.</span> </span><span id="L-2840"><a href="#L-2840"><span class="linenos">2840</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2841"><a href="#L-2841"><span class="linenos">2841</span></a><span class="sd"> on: optionally specify the join "on" criteria as a SQL string.</span> +</span><span id="L-2841"><a href="#L-2841"><span class="linenos">2841</span></a><span class="sd"> using: optionally specify the join "using" criteria as a SQL string.</span> </span><span id="L-2842"><a href="#L-2842"><span class="linenos">2842</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2843"><a href="#L-2843"><span class="linenos">2843</span></a><span class="sd"> using: optionally specify the join "using" criteria as a SQL string.</span> -</span><span id="L-2844"><a href="#L-2844"><span class="linenos">2844</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2845"><a href="#L-2845"><span class="linenos">2845</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="L-2846"><a href="#L-2846"><span class="linenos">2846</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="L-2847"><a href="#L-2847"><span class="linenos">2847</span></a><span class="sd"> join_type: if set, alter the parsed join type.</span> -</span><span id="L-2848"><a href="#L-2848"><span class="linenos">2848</span></a><span class="sd"> join_alias: an optional alias for the joined source.</span> -</span><span id="L-2849"><a href="#L-2849"><span class="linenos">2849</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-2850"><a href="#L-2850"><span class="linenos">2850</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2851"><a href="#L-2851"><span class="linenos">2851</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</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="sd"> Returns:</span> -</span><span id="L-2854"><a href="#L-2854"><span class="linenos">2854</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-2855"><a href="#L-2855"><span class="linenos">2855</span></a><span class="sd"> """</span> -</span><span id="L-2856"><a href="#L-2856"><span class="linenos">2856</span></a> <span class="n">parse_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 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-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 class="k">try</span><span class="p">:</span> -</span><span id="L-2859"><a href="#L-2859"><span class="linenos">2859</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-2860"><a href="#L-2860"><span class="linenos">2860</span></a> <span class="k">except</span> <span class="n">ParseError</span><span class="p">:</span> -</span><span id="L-2861"><a href="#L-2861"><span class="linenos">2861</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-2843"><a href="#L-2843"><span class="linenos">2843</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="L-2844"><a href="#L-2844"><span class="linenos">2844</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="L-2845"><a href="#L-2845"><span class="linenos">2845</span></a><span class="sd"> join_type: if set, alter the parsed join type.</span> +</span><span id="L-2846"><a href="#L-2846"><span class="linenos">2846</span></a><span class="sd"> join_alias: an optional alias for the joined source.</span> +</span><span id="L-2847"><a href="#L-2847"><span class="linenos">2847</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-2848"><a href="#L-2848"><span class="linenos">2848</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2849"><a href="#L-2849"><span class="linenos">2849</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</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="sd"> Returns:</span> +</span><span id="L-2852"><a href="#L-2852"><span class="linenos">2852</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2853"><a href="#L-2853"><span class="linenos">2853</span></a><span class="sd"> """</span> +</span><span id="L-2854"><a href="#L-2854"><span class="linenos">2854</span></a> <span class="n">parse_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 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-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 class="k">try</span><span class="p">:</span> +</span><span id="L-2857"><a href="#L-2857"><span class="linenos">2857</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-2858"><a href="#L-2858"><span class="linenos">2858</span></a> <span class="k">except</span> <span class="n">ParseError</span><span class="p">:</span> +</span><span id="L-2859"><a href="#L-2859"><span class="linenos">2859</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-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="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-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="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-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">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-2866"><a href="#L-2866"><span class="linenos">2866</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-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 class="k">if</span> <span class="n">join_type</span><span class="p">:</span> -</span><span id="L-2869"><a href="#L-2869"><span class="linenos">2869</span></a> <span class="n">method</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-2870"><a href="#L-2870"><span class="linenos">2870</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-2871"><a href="#L-2871"><span class="linenos">2871</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-2863"><a href="#L-2863"><span class="linenos">2863</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-2864"><a href="#L-2864"><span class="linenos">2864</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-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 class="k">if</span> <span class="n">join_type</span><span class="p">:</span> +</span><span id="L-2867"><a href="#L-2867"><span class="linenos">2867</span></a> <span class="n">method</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-2868"><a href="#L-2868"><span class="linenos">2868</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-2869"><a href="#L-2869"><span class="linenos">2869</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-2870"><a href="#L-2870"><span class="linenos">2870</span></a> +</span><span id="L-2871"><a href="#L-2871"><span class="linenos">2871</span></a> <span class="n">method</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-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="n">method</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-2874"><a href="#L-2874"><span class="linenos">2874</span></a> -</span><span id="L-2875"><a href="#L-2875"><span class="linenos">2875</span></a> <span class="k">if</span> <span class="n">method</span><span class="p">:</span> -</span><span id="L-2876"><a href="#L-2876"><span class="linenos">2876</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"method"</span><span class="p">,</span> <span class="n">method</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> -</span><span id="L-2877"><a href="#L-2877"><span class="linenos">2877</span></a> <span class="k">if</span> <span class="n">side</span><span class="p">:</span> -</span><span id="L-2878"><a href="#L-2878"><span class="linenos">2878</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-2879"><a href="#L-2879"><span class="linenos">2879</span></a> <span class="k">if</span> <span class="n">kind</span><span class="p">:</span> -</span><span id="L-2880"><a href="#L-2880"><span class="linenos">2880</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-2881"><a href="#L-2881"><span class="linenos">2881</span></a> -</span><span id="L-2882"><a href="#L-2882"><span class="linenos">2882</span></a> <span class="k">if</span> <span class="n">on</span><span class="p">:</span> -</span><span id="L-2883"><a href="#L-2883"><span class="linenos">2883</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_list</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-2884"><a href="#L-2884"><span class="linenos">2884</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-2885"><a href="#L-2885"><span class="linenos">2885</span></a> -</span><span id="L-2886"><a href="#L-2886"><span class="linenos">2886</span></a> <span class="k">if</span> <span class="n">using</span><span class="p">:</span> -</span><span id="L-2887"><a href="#L-2887"><span class="linenos">2887</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-2888"><a href="#L-2888"><span class="linenos">2888</span></a> <span class="o">*</span><span class="n">ensure_list</span><span class="p">(</span><span class="n">using</span><span class="p">),</span> -</span><span id="L-2889"><a href="#L-2889"><span class="linenos">2889</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">join</span><span class="p">,</span> -</span><span id="L-2890"><a href="#L-2890"><span class="linenos">2890</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> -</span><span id="L-2891"><a href="#L-2891"><span class="linenos">2891</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2892"><a href="#L-2892"><span class="linenos">2892</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2893"><a href="#L-2893"><span class="linenos">2893</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2894"><a href="#L-2894"><span class="linenos">2894</span></a> <span class="p">)</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 class="k">if</span> <span class="n">join_alias</span><span class="p">:</span> -</span><span id="L-2897"><a href="#L-2897"><span class="linenos">2897</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-2898"><a href="#L-2898"><span class="linenos">2898</span></a> -</span><span id="L-2899"><a href="#L-2899"><span class="linenos">2899</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-2900"><a href="#L-2900"><span class="linenos">2900</span></a> <span class="n">join</span><span class="p">,</span> -</span><span id="L-2901"><a href="#L-2901"><span class="linenos">2901</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2902"><a href="#L-2902"><span class="linenos">2902</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"joins"</span><span class="p">,</span> -</span><span id="L-2903"><a href="#L-2903"><span class="linenos">2903</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2904"><a href="#L-2904"><span class="linenos">2904</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2905"><a href="#L-2905"><span class="linenos">2905</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2906"><a href="#L-2906"><span class="linenos">2906</span></a> <span class="p">)</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 class="k">def</span> <span class="nf">where</span><span class="p">(</span> -</span><span id="L-2909"><a href="#L-2909"><span class="linenos">2909</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2910"><a href="#L-2910"><span class="linenos">2910</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-2911"><a href="#L-2911"><span class="linenos">2911</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-2912"><a href="#L-2912"><span class="linenos">2912</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-2913"><a href="#L-2913"><span class="linenos">2913</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-2914"><a href="#L-2914"><span class="linenos">2914</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2915"><a href="#L-2915"><span class="linenos">2915</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2916"><a href="#L-2916"><span class="linenos">2916</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2917"><a href="#L-2917"><span class="linenos">2917</span></a><span class="sd"> Append to or set the WHERE expressions.</span> -</span><span id="L-2918"><a href="#L-2918"><span class="linenos">2918</span></a> -</span><span id="L-2919"><a href="#L-2919"><span class="linenos">2919</span></a><span class="sd"> Example:</span> -</span><span id="L-2920"><a href="#L-2920"><span class="linenos">2920</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()</span> -</span><span id="L-2921"><a href="#L-2921"><span class="linenos">2921</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"</span> -</span><span id="L-2922"><a href="#L-2922"><span class="linenos">2922</span></a> -</span><span id="L-2923"><a href="#L-2923"><span class="linenos">2923</span></a><span class="sd"> Args:</span> -</span><span id="L-2924"><a href="#L-2924"><span class="linenos">2924</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-2925"><a href="#L-2925"><span class="linenos">2925</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2926"><a href="#L-2926"><span class="linenos">2926</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="L-2927"><a href="#L-2927"><span class="linenos">2927</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> -</span><span id="L-2928"><a href="#L-2928"><span class="linenos">2928</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="L-2929"><a href="#L-2929"><span class="linenos">2929</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-2930"><a href="#L-2930"><span class="linenos">2930</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2931"><a href="#L-2931"><span class="linenos">2931</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</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="sd"> Returns:</span> -</span><span id="L-2934"><a href="#L-2934"><span class="linenos">2934</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-2935"><a href="#L-2935"><span class="linenos">2935</span></a><span class="sd"> """</span> -</span><span id="L-2936"><a href="#L-2936"><span class="linenos">2936</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="L-2937"><a href="#L-2937"><span class="linenos">2937</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2938"><a href="#L-2938"><span class="linenos">2938</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2939"><a href="#L-2939"><span class="linenos">2939</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> -</span><span id="L-2940"><a href="#L-2940"><span class="linenos">2940</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2941"><a href="#L-2941"><span class="linenos">2941</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> -</span><span id="L-2942"><a href="#L-2942"><span class="linenos">2942</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2943"><a href="#L-2943"><span class="linenos">2943</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2944"><a href="#L-2944"><span class="linenos">2944</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2945"><a href="#L-2945"><span class="linenos">2945</span></a> <span class="p">)</span> -</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">def</span> <span class="nf">having</span><span class="p">(</span> -</span><span id="L-2948"><a href="#L-2948"><span class="linenos">2948</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2949"><a href="#L-2949"><span class="linenos">2949</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-2950"><a href="#L-2950"><span class="linenos">2950</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-2951"><a href="#L-2951"><span class="linenos">2951</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-2952"><a href="#L-2952"><span class="linenos">2952</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-2953"><a href="#L-2953"><span class="linenos">2953</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2954"><a href="#L-2954"><span class="linenos">2954</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2955"><a href="#L-2955"><span class="linenos">2955</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2956"><a href="#L-2956"><span class="linenos">2956</span></a><span class="sd"> Append to or set the HAVING expressions.</span> -</span><span id="L-2957"><a href="#L-2957"><span class="linenos">2957</span></a> -</span><span id="L-2958"><a href="#L-2958"><span class="linenos">2958</span></a><span class="sd"> Example:</span> -</span><span id="L-2959"><a href="#L-2959"><span class="linenos">2959</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-2960"><a href="#L-2960"><span class="linenos">2960</span></a><span class="sd"> 'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'</span> -</span><span id="L-2961"><a href="#L-2961"><span class="linenos">2961</span></a> -</span><span id="L-2962"><a href="#L-2962"><span class="linenos">2962</span></a><span class="sd"> Args:</span> -</span><span id="L-2963"><a href="#L-2963"><span class="linenos">2963</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-2964"><a href="#L-2964"><span class="linenos">2964</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2965"><a href="#L-2965"><span class="linenos">2965</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="L-2966"><a href="#L-2966"><span class="linenos">2966</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> -</span><span id="L-2967"><a href="#L-2967"><span class="linenos">2967</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="L-2968"><a href="#L-2968"><span class="linenos">2968</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-2969"><a href="#L-2969"><span class="linenos">2969</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2970"><a href="#L-2970"><span class="linenos">2970</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</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="sd"> Returns:</span> -</span><span id="L-2973"><a href="#L-2973"><span class="linenos">2973</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="L-2974"><a href="#L-2974"><span class="linenos">2974</span></a><span class="sd"> """</span> -</span><span id="L-2975"><a href="#L-2975"><span class="linenos">2975</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="L-2976"><a href="#L-2976"><span class="linenos">2976</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2977"><a href="#L-2977"><span class="linenos">2977</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2978"><a href="#L-2978"><span class="linenos">2978</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"having"</span><span class="p">,</span> -</span><span id="L-2979"><a href="#L-2979"><span class="linenos">2979</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2980"><a href="#L-2980"><span class="linenos">2980</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Having</span><span class="p">,</span> -</span><span id="L-2981"><a href="#L-2981"><span class="linenos">2981</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2982"><a href="#L-2982"><span class="linenos">2982</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2983"><a href="#L-2983"><span class="linenos">2983</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2984"><a href="#L-2984"><span class="linenos">2984</span></a> <span class="p">)</span> -</span><span id="L-2985"><a href="#L-2985"><span class="linenos">2985</span></a> -</span><span id="L-2986"><a href="#L-2986"><span class="linenos">2986</span></a> <span class="k">def</span> <span class="nf">window</span><span class="p">(</span> -</span><span id="L-2987"><a href="#L-2987"><span class="linenos">2987</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2988"><a href="#L-2988"><span class="linenos">2988</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-2989"><a href="#L-2989"><span class="linenos">2989</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-2990"><a href="#L-2990"><span class="linenos">2990</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-2991"><a href="#L-2991"><span class="linenos">2991</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-2992"><a href="#L-2992"><span class="linenos">2992</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2993"><a href="#L-2993"><span class="linenos">2993</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2994"><a href="#L-2994"><span class="linenos">2994</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-2995"><a href="#L-2995"><span class="linenos">2995</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2996"><a href="#L-2996"><span class="linenos">2996</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2997"><a href="#L-2997"><span class="linenos">2997</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"windows"</span><span class="p">,</span> -</span><span id="L-2998"><a href="#L-2998"><span class="linenos">2998</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2999"><a href="#L-2999"><span class="linenos">2999</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Window</span><span class="p">,</span> -</span><span id="L-3000"><a href="#L-3000"><span class="linenos">3000</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-3001"><a href="#L-3001"><span class="linenos">3001</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-3002"><a href="#L-3002"><span class="linenos">3002</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3003"><a href="#L-3003"><span class="linenos">3003</span></a> <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">def</span> <span class="nf">qualify</span><span class="p">(</span> -</span><span id="L-3006"><a href="#L-3006"><span class="linenos">3006</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-3007"><a href="#L-3007"><span class="linenos">3007</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="L-3008"><a href="#L-3008"><span class="linenos">3008</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-3009"><a href="#L-3009"><span class="linenos">3009</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-3010"><a href="#L-3010"><span class="linenos">3010</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-3011"><a href="#L-3011"><span class="linenos">3011</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3012"><a href="#L-3012"><span class="linenos">3012</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-3013"><a href="#L-3013"><span class="linenos">3013</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="L-3014"><a href="#L-3014"><span class="linenos">3014</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-3015"><a href="#L-3015"><span class="linenos">3015</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-3016"><a href="#L-3016"><span class="linenos">3016</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"qualify"</span><span class="p">,</span> -</span><span id="L-3017"><a href="#L-3017"><span class="linenos">3017</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-3018"><a href="#L-3018"><span class="linenos">3018</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Qualify</span><span class="p">,</span> -</span><span id="L-3019"><a href="#L-3019"><span class="linenos">3019</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-3020"><a href="#L-3020"><span class="linenos">3020</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-3021"><a href="#L-3021"><span class="linenos">3021</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3022"><a href="#L-3022"><span class="linenos">3022</span></a> <span class="p">)</span> -</span><span id="L-3023"><a href="#L-3023"><span class="linenos">3023</span></a> -</span><span id="L-3024"><a href="#L-3024"><span class="linenos">3024</span></a> <span class="k">def</span> <span class="nf">distinct</span><span class="p">(</span> -</span><span id="L-3025"><a href="#L-3025"><span class="linenos">3025</span></a> <span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">ons</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">ExpOrStr</span><span class="p">],</span> <span class="n">distinct</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><span id="L-3026"><a href="#L-3026"><span class="linenos">3026</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-3027"><a href="#L-3027"><span class="linenos">3027</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-3028"><a href="#L-3028"><span class="linenos">3028</span></a><span class="sd"> Set the OFFSET expression.</span> -</span><span id="L-3029"><a href="#L-3029"><span class="linenos">3029</span></a> -</span><span id="L-3030"><a href="#L-3030"><span class="linenos">3030</span></a><span class="sd"> Example:</span> -</span><span id="L-3031"><a href="#L-3031"><span class="linenos">3031</span></a><span class="sd"> >>> Select().from_("tbl").select("x").distinct().sql()</span> -</span><span id="L-3032"><a href="#L-3032"><span class="linenos">3032</span></a><span class="sd"> 'SELECT DISTINCT x FROM tbl'</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 class="sd"> Args:</span> -</span><span id="L-3035"><a href="#L-3035"><span class="linenos">3035</span></a><span class="sd"> ons: the expressions to distinct on</span> -</span><span id="L-3036"><a href="#L-3036"><span class="linenos">3036</span></a><span class="sd"> distinct: whether the Select should be distinct</span> -</span><span id="L-3037"><a href="#L-3037"><span class="linenos">3037</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</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="sd"> Returns:</span> -</span><span id="L-3040"><a href="#L-3040"><span class="linenos">3040</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-3041"><a href="#L-3041"><span class="linenos">3041</span></a><span class="sd"> """</span> -</span><span id="L-3042"><a href="#L-3042"><span class="linenos">3042</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-3043"><a href="#L-3043"><span class="linenos">3043</span></a> <span class="n">on</span> <span class="o">=</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">maybe_parse</span><span class="p">(</span><span class="n">on</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">on</span> <span class="ow">in</span> <span class="n">ons</span> <span class="k">if</span> <span class="n">on</span><span class="p">])</span> <span class="k">if</span> <span class="n">ons</span> <span class="k">else</span> <span class="kc">None</span> -</span><span id="L-3044"><a href="#L-3044"><span class="linenos">3044</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="n">on</span><span class="o">=</span><span class="n">on</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-3045"><a href="#L-3045"><span class="linenos">3045</span></a> <span class="k">return</span> <span class="n">instance</span> -</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">def</span> <span class="nf">ctas</span><span class="p">(</span> -</span><span id="L-3048"><a href="#L-3048"><span class="linenos">3048</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-3049"><a href="#L-3049"><span class="linenos">3049</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-3050"><a href="#L-3050"><span class="linenos">3050</span></a> <span class="n">properties</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="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-3051"><a href="#L-3051"><span class="linenos">3051</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-3052"><a href="#L-3052"><span class="linenos">3052</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-3053"><a href="#L-3053"><span class="linenos">3053</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3054"><a href="#L-3054"><span class="linenos">3054</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Create</span><span class="p">:</span> -</span><span id="L-3055"><a href="#L-3055"><span class="linenos">3055</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-3056"><a href="#L-3056"><span class="linenos">3056</span></a><span class="sd"> Convert this expression to a CREATE TABLE AS statement.</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="sd"> Example:</span> -</span><span id="L-3059"><a href="#L-3059"><span class="linenos">3059</span></a><span class="sd"> >>> Select().select("*").from_("tbl").ctas("x").sql()</span> -</span><span id="L-3060"><a href="#L-3060"><span class="linenos">3060</span></a><span class="sd"> 'CREATE TABLE x AS SELECT * FROM tbl'</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="sd"> Args:</span> -</span><span id="L-3063"><a href="#L-3063"><span class="linenos">3063</span></a><span class="sd"> table: the SQL code string to parse as the table name.</span> -</span><span id="L-3064"><a href="#L-3064"><span class="linenos">3064</span></a><span class="sd"> If another `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-3065"><a href="#L-3065"><span class="linenos">3065</span></a><span class="sd"> properties: an optional mapping of table properties</span> -</span><span id="L-3066"><a href="#L-3066"><span class="linenos">3066</span></a><span class="sd"> dialect: the dialect used to parse the input table.</span> -</span><span id="L-3067"><a href="#L-3067"><span class="linenos">3067</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-3068"><a href="#L-3068"><span class="linenos">3068</span></a><span class="sd"> opts: other options to use to parse the input table.</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 class="sd"> Returns:</span> -</span><span id="L-3071"><a href="#L-3071"><span class="linenos">3071</span></a><span class="sd"> The new Create expression.</span> -</span><span id="L-3072"><a href="#L-3072"><span class="linenos">3072</span></a><span class="sd"> """</span> -</span><span id="L-3073"><a href="#L-3073"><span class="linenos">3073</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-3074"><a href="#L-3074"><span class="linenos">3074</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-3075"><a href="#L-3075"><span class="linenos">3075</span></a> <span class="n">table</span><span class="p">,</span> -</span><span id="L-3076"><a href="#L-3076"><span class="linenos">3076</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> -</span><span id="L-3077"><a href="#L-3077"><span class="linenos">3077</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-3078"><a href="#L-3078"><span class="linenos">3078</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3079"><a href="#L-3079"><span class="linenos">3079</span></a> <span class="p">)</span> -</span><span id="L-3080"><a href="#L-3080"><span class="linenos">3080</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="L-3081"><a href="#L-3081"><span class="linenos">3081</span></a> <span class="k">if</span> <span class="n">properties</span><span class="p">:</span> -</span><span id="L-3082"><a href="#L-3082"><span class="linenos">3082</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-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 class="k">return</span> <span class="n">Create</span><span class="p">(</span> -</span><span id="L-3085"><a href="#L-3085"><span class="linenos">3085</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-3086"><a href="#L-3086"><span class="linenos">3086</span></a> <span class="n">kind</span><span class="o">=</span><span class="s2">"table"</span><span class="p">,</span> -</span><span id="L-3087"><a href="#L-3087"><span class="linenos">3087</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> -</span><span id="L-3088"><a href="#L-3088"><span class="linenos">3088</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-3089"><a href="#L-3089"><span class="linenos">3089</span></a> <span class="p">)</span> -</span><span id="L-3090"><a href="#L-3090"><span class="linenos">3090</span></a> -</span><span id="L-3091"><a href="#L-3091"><span class="linenos">3091</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-3092"><a href="#L-3092"><span class="linenos">3092</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-3093"><a href="#L-3093"><span class="linenos">3093</span></a><span class="sd"> Set the locking read mode for this expression.</span> -</span><span id="L-3094"><a href="#L-3094"><span class="linenos">3094</span></a> -</span><span id="L-3095"><a href="#L-3095"><span class="linenos">3095</span></a><span class="sd"> Examples:</span> -</span><span id="L-3096"><a href="#L-3096"><span class="linenos">3096</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")</span> -</span><span id="L-3097"><a href="#L-3097"><span class="linenos">3097</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"</span> -</span><span id="L-3098"><a href="#L-3098"><span class="linenos">3098</span></a> -</span><span id="L-3099"><a href="#L-3099"><span class="linenos">3099</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")</span> -</span><span id="L-3100"><a href="#L-3100"><span class="linenos">3100</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"</span> -</span><span id="L-3101"><a href="#L-3101"><span class="linenos">3101</span></a> -</span><span id="L-3102"><a href="#L-3102"><span class="linenos">3102</span></a><span class="sd"> Args:</span> -</span><span id="L-3103"><a href="#L-3103"><span class="linenos">3103</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-3104"><a href="#L-3104"><span class="linenos">3104</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-3105"><a href="#L-3105"><span class="linenos">3105</span></a> -</span><span id="L-3106"><a href="#L-3106"><span class="linenos">3106</span></a><span class="sd"> Returns:</span> -</span><span id="L-3107"><a href="#L-3107"><span class="linenos">3107</span></a><span class="sd"> The modified expression.</span> -</span><span id="L-3108"><a href="#L-3108"><span class="linenos">3108</span></a><span class="sd"> """</span> -</span><span id="L-3109"><a href="#L-3109"><span class="linenos">3109</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-3110"><a href="#L-3110"><span class="linenos">3110</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"locks"</span><span class="p">,</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-2873"><a href="#L-2873"><span class="linenos">2873</span></a> <span class="k">if</span> <span class="n">method</span><span class="p">:</span> +</span><span id="L-2874"><a href="#L-2874"><span class="linenos">2874</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"method"</span><span class="p">,</span> <span class="n">method</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> +</span><span id="L-2875"><a href="#L-2875"><span class="linenos">2875</span></a> <span class="k">if</span> <span class="n">side</span><span class="p">:</span> +</span><span id="L-2876"><a href="#L-2876"><span class="linenos">2876</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-2877"><a href="#L-2877"><span class="linenos">2877</span></a> <span class="k">if</span> <span class="n">kind</span><span class="p">:</span> +</span><span id="L-2878"><a href="#L-2878"><span class="linenos">2878</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-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 class="k">if</span> <span class="n">on</span><span class="p">:</span> +</span><span id="L-2881"><a href="#L-2881"><span class="linenos">2881</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_list</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-2882"><a href="#L-2882"><span class="linenos">2882</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-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 class="k">if</span> <span class="n">using</span><span class="p">:</span> +</span><span id="L-2885"><a href="#L-2885"><span class="linenos">2885</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-2886"><a href="#L-2886"><span class="linenos">2886</span></a> <span class="o">*</span><span class="n">ensure_list</span><span class="p">(</span><span class="n">using</span><span class="p">),</span> +</span><span id="L-2887"><a href="#L-2887"><span class="linenos">2887</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">join</span><span class="p">,</span> +</span><span id="L-2888"><a href="#L-2888"><span class="linenos">2888</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> +</span><span id="L-2889"><a href="#L-2889"><span class="linenos">2889</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2890"><a href="#L-2890"><span class="linenos">2890</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2891"><a href="#L-2891"><span class="linenos">2891</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2892"><a href="#L-2892"><span class="linenos">2892</span></a> <span class="p">)</span> +</span><span id="L-2893"><a href="#L-2893"><span class="linenos">2893</span></a> +</span><span id="L-2894"><a href="#L-2894"><span class="linenos">2894</span></a> <span class="k">if</span> <span class="n">join_alias</span><span class="p">:</span> +</span><span id="L-2895"><a href="#L-2895"><span class="linenos">2895</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-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 class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-2898"><a href="#L-2898"><span class="linenos">2898</span></a> <span class="n">join</span><span class="p">,</span> +</span><span id="L-2899"><a href="#L-2899"><span class="linenos">2899</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2900"><a href="#L-2900"><span class="linenos">2900</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"joins"</span><span class="p">,</span> +</span><span id="L-2901"><a href="#L-2901"><span class="linenos">2901</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2902"><a href="#L-2902"><span class="linenos">2902</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2903"><a href="#L-2903"><span class="linenos">2903</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2904"><a href="#L-2904"><span class="linenos">2904</span></a> <span class="p">)</span> +</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">def</span> <span class="nf">where</span><span class="p">(</span> +</span><span id="L-2907"><a href="#L-2907"><span class="linenos">2907</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2908"><a href="#L-2908"><span class="linenos">2908</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-2909"><a href="#L-2909"><span class="linenos">2909</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-2910"><a href="#L-2910"><span class="linenos">2910</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-2911"><a href="#L-2911"><span class="linenos">2911</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-2912"><a href="#L-2912"><span class="linenos">2912</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2913"><a href="#L-2913"><span class="linenos">2913</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2914"><a href="#L-2914"><span class="linenos">2914</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2915"><a href="#L-2915"><span class="linenos">2915</span></a><span class="sd"> Append to or set the WHERE expressions.</span> +</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 class="sd"> Example:</span> +</span><span id="L-2918"><a href="#L-2918"><span class="linenos">2918</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()</span> +</span><span id="L-2919"><a href="#L-2919"><span class="linenos">2919</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"</span> +</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 class="sd"> Args:</span> +</span><span id="L-2922"><a href="#L-2922"><span class="linenos">2922</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-2923"><a href="#L-2923"><span class="linenos">2923</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2924"><a href="#L-2924"><span class="linenos">2924</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="L-2925"><a href="#L-2925"><span class="linenos">2925</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> +</span><span id="L-2926"><a href="#L-2926"><span class="linenos">2926</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="L-2927"><a href="#L-2927"><span class="linenos">2927</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-2928"><a href="#L-2928"><span class="linenos">2928</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2929"><a href="#L-2929"><span class="linenos">2929</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</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="sd"> Returns:</span> +</span><span id="L-2932"><a href="#L-2932"><span class="linenos">2932</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2933"><a href="#L-2933"><span class="linenos">2933</span></a><span class="sd"> """</span> +</span><span id="L-2934"><a href="#L-2934"><span class="linenos">2934</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="L-2935"><a href="#L-2935"><span class="linenos">2935</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2936"><a href="#L-2936"><span class="linenos">2936</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2937"><a href="#L-2937"><span class="linenos">2937</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> +</span><span id="L-2938"><a href="#L-2938"><span class="linenos">2938</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2939"><a href="#L-2939"><span class="linenos">2939</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> +</span><span id="L-2940"><a href="#L-2940"><span class="linenos">2940</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2941"><a href="#L-2941"><span class="linenos">2941</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2942"><a href="#L-2942"><span class="linenos">2942</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2943"><a href="#L-2943"><span class="linenos">2943</span></a> <span class="p">)</span> +</span><span id="L-2944"><a href="#L-2944"><span class="linenos">2944</span></a> +</span><span id="L-2945"><a href="#L-2945"><span class="linenos">2945</span></a> <span class="k">def</span> <span class="nf">having</span><span class="p">(</span> +</span><span id="L-2946"><a href="#L-2946"><span class="linenos">2946</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2947"><a href="#L-2947"><span class="linenos">2947</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-2948"><a href="#L-2948"><span class="linenos">2948</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-2949"><a href="#L-2949"><span class="linenos">2949</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-2950"><a href="#L-2950"><span class="linenos">2950</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-2951"><a href="#L-2951"><span class="linenos">2951</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2952"><a href="#L-2952"><span class="linenos">2952</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2953"><a href="#L-2953"><span class="linenos">2953</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2954"><a href="#L-2954"><span class="linenos">2954</span></a><span class="sd"> Append to or set the HAVING expressions.</span> +</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="sd"> Example:</span> +</span><span id="L-2957"><a href="#L-2957"><span class="linenos">2957</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-2958"><a href="#L-2958"><span class="linenos">2958</span></a><span class="sd"> 'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'</span> +</span><span id="L-2959"><a href="#L-2959"><span class="linenos">2959</span></a> +</span><span id="L-2960"><a href="#L-2960"><span class="linenos">2960</span></a><span class="sd"> Args:</span> +</span><span id="L-2961"><a href="#L-2961"><span class="linenos">2961</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-2962"><a href="#L-2962"><span class="linenos">2962</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2963"><a href="#L-2963"><span class="linenos">2963</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="L-2964"><a href="#L-2964"><span class="linenos">2964</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> +</span><span id="L-2965"><a href="#L-2965"><span class="linenos">2965</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="L-2966"><a href="#L-2966"><span class="linenos">2966</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-2967"><a href="#L-2967"><span class="linenos">2967</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2968"><a href="#L-2968"><span class="linenos">2968</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-2969"><a href="#L-2969"><span class="linenos">2969</span></a> +</span><span id="L-2970"><a href="#L-2970"><span class="linenos">2970</span></a><span class="sd"> Returns:</span> +</span><span id="L-2971"><a href="#L-2971"><span class="linenos">2971</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="L-2972"><a href="#L-2972"><span class="linenos">2972</span></a><span class="sd"> """</span> +</span><span id="L-2973"><a href="#L-2973"><span class="linenos">2973</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="L-2974"><a href="#L-2974"><span class="linenos">2974</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2975"><a href="#L-2975"><span class="linenos">2975</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2976"><a href="#L-2976"><span class="linenos">2976</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"having"</span><span class="p">,</span> +</span><span id="L-2977"><a href="#L-2977"><span class="linenos">2977</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2978"><a href="#L-2978"><span class="linenos">2978</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Having</span><span class="p">,</span> +</span><span id="L-2979"><a href="#L-2979"><span class="linenos">2979</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2980"><a href="#L-2980"><span class="linenos">2980</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2981"><a href="#L-2981"><span class="linenos">2981</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2982"><a href="#L-2982"><span class="linenos">2982</span></a> <span class="p">)</span> +</span><span id="L-2983"><a href="#L-2983"><span class="linenos">2983</span></a> +</span><span id="L-2984"><a href="#L-2984"><span class="linenos">2984</span></a> <span class="k">def</span> <span class="nf">window</span><span class="p">(</span> +</span><span id="L-2985"><a href="#L-2985"><span class="linenos">2985</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2986"><a href="#L-2986"><span class="linenos">2986</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-2987"><a href="#L-2987"><span class="linenos">2987</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-2988"><a href="#L-2988"><span class="linenos">2988</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-2989"><a href="#L-2989"><span class="linenos">2989</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-2990"><a href="#L-2990"><span class="linenos">2990</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2991"><a href="#L-2991"><span class="linenos">2991</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2992"><a href="#L-2992"><span class="linenos">2992</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-2993"><a href="#L-2993"><span class="linenos">2993</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2994"><a href="#L-2994"><span class="linenos">2994</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2995"><a href="#L-2995"><span class="linenos">2995</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"windows"</span><span class="p">,</span> +</span><span id="L-2996"><a href="#L-2996"><span class="linenos">2996</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2997"><a href="#L-2997"><span class="linenos">2997</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Window</span><span class="p">,</span> +</span><span id="L-2998"><a href="#L-2998"><span class="linenos">2998</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2999"><a href="#L-2999"><span class="linenos">2999</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-3000"><a href="#L-3000"><span class="linenos">3000</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3001"><a href="#L-3001"><span class="linenos">3001</span></a> <span class="p">)</span> +</span><span id="L-3002"><a href="#L-3002"><span class="linenos">3002</span></a> +</span><span id="L-3003"><a href="#L-3003"><span class="linenos">3003</span></a> <span class="k">def</span> <span class="nf">qualify</span><span class="p">(</span> +</span><span id="L-3004"><a href="#L-3004"><span class="linenos">3004</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-3005"><a href="#L-3005"><span class="linenos">3005</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="L-3006"><a href="#L-3006"><span class="linenos">3006</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-3007"><a href="#L-3007"><span class="linenos">3007</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-3008"><a href="#L-3008"><span class="linenos">3008</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-3009"><a href="#L-3009"><span class="linenos">3009</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3010"><a href="#L-3010"><span class="linenos">3010</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-3011"><a href="#L-3011"><span class="linenos">3011</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="L-3012"><a href="#L-3012"><span class="linenos">3012</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-3013"><a href="#L-3013"><span class="linenos">3013</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-3014"><a href="#L-3014"><span class="linenos">3014</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"qualify"</span><span class="p">,</span> +</span><span id="L-3015"><a href="#L-3015"><span class="linenos">3015</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-3016"><a href="#L-3016"><span class="linenos">3016</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Qualify</span><span class="p">,</span> +</span><span id="L-3017"><a href="#L-3017"><span class="linenos">3017</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-3018"><a href="#L-3018"><span class="linenos">3018</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-3019"><a href="#L-3019"><span class="linenos">3019</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3020"><a href="#L-3020"><span class="linenos">3020</span></a> <span class="p">)</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">def</span> <span class="nf">distinct</span><span class="p">(</span> +</span><span id="L-3023"><a href="#L-3023"><span class="linenos">3023</span></a> <span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">ons</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">ExpOrStr</span><span class="p">],</span> <span class="n">distinct</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><span id="L-3024"><a href="#L-3024"><span class="linenos">3024</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-3025"><a href="#L-3025"><span class="linenos">3025</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-3026"><a href="#L-3026"><span class="linenos">3026</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="L-3027"><a href="#L-3027"><span class="linenos">3027</span></a> +</span><span id="L-3028"><a href="#L-3028"><span class="linenos">3028</span></a><span class="sd"> Example:</span> +</span><span id="L-3029"><a href="#L-3029"><span class="linenos">3029</span></a><span class="sd"> >>> Select().from_("tbl").select("x").distinct().sql()</span> +</span><span id="L-3030"><a href="#L-3030"><span class="linenos">3030</span></a><span class="sd"> 'SELECT DISTINCT x FROM tbl'</span> +</span><span id="L-3031"><a href="#L-3031"><span class="linenos">3031</span></a> +</span><span id="L-3032"><a href="#L-3032"><span class="linenos">3032</span></a><span class="sd"> Args:</span> +</span><span id="L-3033"><a href="#L-3033"><span class="linenos">3033</span></a><span class="sd"> ons: the expressions to distinct on</span> +</span><span id="L-3034"><a href="#L-3034"><span class="linenos">3034</span></a><span class="sd"> distinct: whether the Select should be distinct</span> +</span><span id="L-3035"><a href="#L-3035"><span class="linenos">3035</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-3036"><a href="#L-3036"><span class="linenos">3036</span></a> +</span><span id="L-3037"><a href="#L-3037"><span class="linenos">3037</span></a><span class="sd"> Returns:</span> +</span><span id="L-3038"><a href="#L-3038"><span class="linenos">3038</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-3039"><a href="#L-3039"><span class="linenos">3039</span></a><span class="sd"> """</span> +</span><span id="L-3040"><a href="#L-3040"><span class="linenos">3040</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-3041"><a href="#L-3041"><span class="linenos">3041</span></a> <span class="n">on</span> <span class="o">=</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">maybe_parse</span><span class="p">(</span><span class="n">on</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">on</span> <span class="ow">in</span> <span class="n">ons</span> <span class="k">if</span> <span class="n">on</span><span class="p">])</span> <span class="k">if</span> <span class="n">ons</span> <span class="k">else</span> <span class="kc">None</span> +</span><span id="L-3042"><a href="#L-3042"><span class="linenos">3042</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="n">on</span><span class="o">=</span><span class="n">on</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-3043"><a href="#L-3043"><span class="linenos">3043</span></a> <span class="k">return</span> <span class="n">instance</span> +</span><span id="L-3044"><a href="#L-3044"><span class="linenos">3044</span></a> +</span><span id="L-3045"><a href="#L-3045"><span class="linenos">3045</span></a> <span class="k">def</span> <span class="nf">ctas</span><span class="p">(</span> +</span><span id="L-3046"><a href="#L-3046"><span class="linenos">3046</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-3047"><a href="#L-3047"><span class="linenos">3047</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-3048"><a href="#L-3048"><span class="linenos">3048</span></a> <span class="n">properties</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="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-3049"><a href="#L-3049"><span class="linenos">3049</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-3050"><a href="#L-3050"><span class="linenos">3050</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-3051"><a href="#L-3051"><span class="linenos">3051</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3052"><a href="#L-3052"><span class="linenos">3052</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Create</span><span class="p">:</span> +</span><span id="L-3053"><a href="#L-3053"><span class="linenos">3053</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-3054"><a href="#L-3054"><span class="linenos">3054</span></a><span class="sd"> Convert this expression to a CREATE TABLE AS statement.</span> +</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="sd"> Example:</span> +</span><span id="L-3057"><a href="#L-3057"><span class="linenos">3057</span></a><span class="sd"> >>> Select().select("*").from_("tbl").ctas("x").sql()</span> +</span><span id="L-3058"><a href="#L-3058"><span class="linenos">3058</span></a><span class="sd"> 'CREATE TABLE x AS SELECT * FROM tbl'</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 class="sd"> Args:</span> +</span><span id="L-3061"><a href="#L-3061"><span class="linenos">3061</span></a><span class="sd"> table: the SQL code string to parse as the table name.</span> +</span><span id="L-3062"><a href="#L-3062"><span class="linenos">3062</span></a><span class="sd"> If another `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-3063"><a href="#L-3063"><span class="linenos">3063</span></a><span class="sd"> properties: an optional mapping of table properties</span> +</span><span id="L-3064"><a href="#L-3064"><span class="linenos">3064</span></a><span class="sd"> dialect: the dialect used to parse the input table.</span> +</span><span id="L-3065"><a href="#L-3065"><span class="linenos">3065</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-3066"><a href="#L-3066"><span class="linenos">3066</span></a><span class="sd"> opts: other options to use to parse the input table.</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 class="sd"> Returns:</span> +</span><span id="L-3069"><a href="#L-3069"><span class="linenos">3069</span></a><span class="sd"> The new Create expression.</span> +</span><span id="L-3070"><a href="#L-3070"><span class="linenos">3070</span></a><span class="sd"> """</span> +</span><span id="L-3071"><a href="#L-3071"><span class="linenos">3071</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-3072"><a href="#L-3072"><span class="linenos">3072</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-3073"><a href="#L-3073"><span class="linenos">3073</span></a> <span class="n">table</span><span class="p">,</span> +</span><span id="L-3074"><a href="#L-3074"><span class="linenos">3074</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> +</span><span id="L-3075"><a href="#L-3075"><span class="linenos">3075</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-3076"><a href="#L-3076"><span class="linenos">3076</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3077"><a href="#L-3077"><span class="linenos">3077</span></a> <span class="p">)</span> +</span><span id="L-3078"><a href="#L-3078"><span class="linenos">3078</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="L-3079"><a href="#L-3079"><span class="linenos">3079</span></a> <span class="k">if</span> <span class="n">properties</span><span class="p">:</span> +</span><span id="L-3080"><a href="#L-3080"><span class="linenos">3080</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-3081"><a href="#L-3081"><span class="linenos">3081</span></a> +</span><span id="L-3082"><a href="#L-3082"><span class="linenos">3082</span></a> <span class="k">return</span> <span class="n">Create</span><span class="p">(</span> +</span><span id="L-3083"><a href="#L-3083"><span class="linenos">3083</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-3084"><a href="#L-3084"><span class="linenos">3084</span></a> <span class="n">kind</span><span class="o">=</span><span class="s2">"table"</span><span class="p">,</span> +</span><span id="L-3085"><a href="#L-3085"><span class="linenos">3085</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> +</span><span id="L-3086"><a href="#L-3086"><span class="linenos">3086</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-3087"><a href="#L-3087"><span class="linenos">3087</span></a> <span class="p">)</span> +</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">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-3090"><a href="#L-3090"><span class="linenos">3090</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-3091"><a href="#L-3091"><span class="linenos">3091</span></a><span class="sd"> Set the locking read mode for this expression.</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="sd"> Examples:</span> +</span><span id="L-3094"><a href="#L-3094"><span class="linenos">3094</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")</span> +</span><span id="L-3095"><a href="#L-3095"><span class="linenos">3095</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"</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="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")</span> +</span><span id="L-3098"><a href="#L-3098"><span class="linenos">3098</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"</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="sd"> Args:</span> +</span><span id="L-3101"><a href="#L-3101"><span class="linenos">3101</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-3102"><a href="#L-3102"><span class="linenos">3102</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</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="sd"> Returns:</span> +</span><span id="L-3105"><a href="#L-3105"><span class="linenos">3105</span></a><span class="sd"> The modified expression.</span> +</span><span id="L-3106"><a href="#L-3106"><span class="linenos">3106</span></a><span class="sd"> """</span> +</span><span id="L-3107"><a href="#L-3107"><span class="linenos">3107</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-3108"><a href="#L-3108"><span class="linenos">3108</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"locks"</span><span class="p">,</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-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">return</span> <span class="n">inst</span> </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">return</span> <span class="n">inst</span> -</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">def</span> <span class="nf">hint</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">hints</span><span class="p">:</span> <span class="n">ExpOrStr</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="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-3115"><a href="#L-3115"><span class="linenos">3115</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-3116"><a href="#L-3116"><span class="linenos">3116</span></a><span class="sd"> Set hints for this expression.</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 class="sd"> Examples:</span> -</span><span id="L-3119"><a href="#L-3119"><span class="linenos">3119</span></a><span class="sd"> >>> Select().select("x").from_("tbl").hint("BROADCAST(y)").sql(dialect="spark")</span> -</span><span id="L-3120"><a href="#L-3120"><span class="linenos">3120</span></a><span class="sd"> 'SELECT /*+ BROADCAST(y) */ x FROM tbl'</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 class="sd"> Args:</span> -</span><span id="L-3123"><a href="#L-3123"><span class="linenos">3123</span></a><span class="sd"> hints: The SQL code strings to parse as the hints.</span> -</span><span id="L-3124"><a href="#L-3124"><span class="linenos">3124</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-3125"><a href="#L-3125"><span class="linenos">3125</span></a><span class="sd"> dialect: The dialect used to parse the hints.</span> -</span><span id="L-3126"><a href="#L-3126"><span class="linenos">3126</span></a><span class="sd"> copy: If `False`, modify this expression instance in-place.</span> -</span><span id="L-3127"><a href="#L-3127"><span class="linenos">3127</span></a> -</span><span id="L-3128"><a href="#L-3128"><span class="linenos">3128</span></a><span class="sd"> Returns:</span> -</span><span id="L-3129"><a href="#L-3129"><span class="linenos">3129</span></a><span class="sd"> The modified expression.</span> -</span><span id="L-3130"><a href="#L-3130"><span class="linenos">3130</span></a><span class="sd"> """</span> -</span><span id="L-3131"><a href="#L-3131"><span class="linenos">3131</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-3132"><a href="#L-3132"><span class="linenos">3132</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="L-3133"><a href="#L-3133"><span class="linenos">3133</span></a> <span class="s2">"hint"</span><span class="p">,</span> <span class="n">Hint</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">h</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</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="k">for</span> <span class="n">h</span> <span class="ow">in</span> <span class="n">hints</span><span class="p">])</span> -</span><span id="L-3134"><a href="#L-3134"><span class="linenos">3134</span></a> <span class="p">)</span> +</span><span id="L-3112"><a href="#L-3112"><span class="linenos">3112</span></a> <span class="k">def</span> <span class="nf">hint</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">hints</span><span class="p">:</span> <span class="n">ExpOrStr</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="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-3113"><a href="#L-3113"><span class="linenos">3113</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-3114"><a href="#L-3114"><span class="linenos">3114</span></a><span class="sd"> Set hints for this expression.</span> +</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="sd"> Examples:</span> +</span><span id="L-3117"><a href="#L-3117"><span class="linenos">3117</span></a><span class="sd"> >>> Select().select("x").from_("tbl").hint("BROADCAST(y)").sql(dialect="spark")</span> +</span><span id="L-3118"><a href="#L-3118"><span class="linenos">3118</span></a><span class="sd"> 'SELECT /*+ BROADCAST(y) */ x FROM tbl'</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 class="sd"> Args:</span> +</span><span id="L-3121"><a href="#L-3121"><span class="linenos">3121</span></a><span class="sd"> hints: The SQL code strings to parse as the hints.</span> +</span><span id="L-3122"><a href="#L-3122"><span class="linenos">3122</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-3123"><a href="#L-3123"><span class="linenos">3123</span></a><span class="sd"> dialect: The dialect used to parse the hints.</span> +</span><span id="L-3124"><a href="#L-3124"><span class="linenos">3124</span></a><span class="sd"> copy: If `False`, modify this expression instance in-place.</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="sd"> Returns:</span> +</span><span id="L-3127"><a href="#L-3127"><span class="linenos">3127</span></a><span class="sd"> The modified expression.</span> +</span><span id="L-3128"><a href="#L-3128"><span class="linenos">3128</span></a><span class="sd"> """</span> +</span><span id="L-3129"><a href="#L-3129"><span class="linenos">3129</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-3130"><a href="#L-3130"><span class="linenos">3130</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="L-3131"><a href="#L-3131"><span class="linenos">3131</span></a> <span class="s2">"hint"</span><span class="p">,</span> <span class="n">Hint</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">h</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</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="k">for</span> <span class="n">h</span> <span class="ow">in</span> <span class="n">hints</span><span class="p">])</span> +</span><span id="L-3132"><a href="#L-3132"><span class="linenos">3132</span></a> <span class="p">)</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 class="k">return</span> <span class="n">inst</span> </span><span id="L-3135"><a href="#L-3135"><span class="linenos">3135</span></a> -</span><span id="L-3136"><a href="#L-3136"><span class="linenos">3136</span></a> <span class="k">return</span> <span class="n">inst</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 class="nd">@property</span> -</span><span id="L-3139"><a href="#L-3139"><span class="linenos">3139</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-3140"><a href="#L-3140"><span class="linenos">3140</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-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 class="nd">@property</span> -</span><span id="L-3143"><a href="#L-3143"><span class="linenos">3143</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-3144"><a href="#L-3144"><span class="linenos">3144</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-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 class="nd">@property</span> -</span><span id="L-3147"><a href="#L-3147"><span class="linenos">3147</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-3148"><a href="#L-3148"><span class="linenos">3148</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-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">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-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><span id="L-3153"><a href="#L-3153"><span class="linenos">3153</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-3154"><a href="#L-3154"><span class="linenos">3154</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3155"><a href="#L-3155"><span class="linenos">3155</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3156"><a href="#L-3156"><span class="linenos">3156</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> -</span><span id="L-3157"><a href="#L-3157"><span class="linenos">3157</span></a> <span class="p">}</span> -</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">def</span> <span class="nf">unnest</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="w"> </span><span class="sd">"""</span> -</span><span id="L-3161"><a href="#L-3161"><span class="linenos">3161</span></a><span class="sd"> Returns the first non subquery.</span> -</span><span id="L-3162"><a href="#L-3162"><span class="linenos">3162</span></a><span class="sd"> """</span> -</span><span id="L-3163"><a href="#L-3163"><span class="linenos">3163</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="L-3164"><a href="#L-3164"><span class="linenos">3164</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-3165"><a href="#L-3165"><span class="linenos">3165</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-3166"><a href="#L-3166"><span class="linenos">3166</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="L-3167"><a href="#L-3167"><span class="linenos">3167</span></a> -</span><span id="L-3168"><a href="#L-3168"><span class="linenos">3168</span></a> <span class="nd">@property</span> -</span><span id="L-3169"><a href="#L-3169"><span class="linenos">3169</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-3170"><a href="#L-3170"><span class="linenos">3170</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-3171"><a href="#L-3171"><span class="linenos">3171</span></a> -</span><span id="L-3172"><a href="#L-3172"><span class="linenos">3172</span></a> <span class="nd">@property</span> -</span><span id="L-3173"><a href="#L-3173"><span class="linenos">3173</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-3174"><a href="#L-3174"><span class="linenos">3174</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-3175"><a href="#L-3175"><span class="linenos">3175</span></a> -</span><span id="L-3176"><a href="#L-3176"><span class="linenos">3176</span></a> -</span><span id="L-3177"><a href="#L-3177"><span class="linenos">3177</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-3178"><a href="#L-3178"><span class="linenos">3178</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3179"><a href="#L-3179"><span class="linenos">3179</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3180"><a href="#L-3180"><span class="linenos">3180</span></a> <span class="s2">"method"</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="s2">"bucket_numerator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3182"><a href="#L-3182"><span class="linenos">3182</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-3183"><a href="#L-3183"><span class="linenos">3183</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-3184"><a href="#L-3184"><span class="linenos">3184</span></a> <span class="s2">"percent"</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 class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3186"><a href="#L-3186"><span class="linenos">3186</span></a> <span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3187"><a href="#L-3187"><span class="linenos">3187</span></a> <span class="s2">"seed"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3188"><a href="#L-3188"><span class="linenos">3188</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3189"><a href="#L-3189"><span class="linenos">3189</span></a> <span class="p">}</span> -</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><span id="L-3192"><a href="#L-3192"><span class="linenos">3192</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-3193"><a href="#L-3193"><span class="linenos">3193</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-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="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3196"><a href="#L-3196"><span class="linenos">3196</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3197"><a href="#L-3197"><span class="linenos">3197</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3198"><a href="#L-3198"><span class="linenos">3198</span></a> <span class="s2">"postfix"</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 class="p">}</span> -</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><span id="L-3202"><a href="#L-3202"><span class="linenos">3202</span></a><span class="c1"># Represents both the standard SQL PIVOT operator and DuckDB's "simplified" PIVOT syntax</span> -</span><span id="L-3203"><a href="#L-3203"><span class="linenos">3203</span></a><span class="c1"># https://duckdb.org/docs/sql/statements/pivot</span> -</span><span id="L-3204"><a href="#L-3204"><span class="linenos">3204</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-3205"><a href="#L-3205"><span class="linenos">3205</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3206"><a href="#L-3206"><span class="linenos">3206</span></a> <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 class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3208"><a href="#L-3208"><span class="linenos">3208</span></a> <span class="s2">"expressions"</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 class="s2">"field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3210"><a href="#L-3210"><span class="linenos">3210</span></a> <span class="s2">"unpivot"</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 class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3212"><a href="#L-3212"><span class="linenos">3212</span></a> <span class="s2">"group"</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 class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3214"><a href="#L-3214"><span class="linenos">3214</span></a> <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">Window</span><span class="p">(</span><span class="n">Expression</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><span id="L-3219"><a href="#L-3219"><span class="linenos">3219</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-3220"><a href="#L-3220"><span class="linenos">3220</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-3221"><a href="#L-3221"><span class="linenos">3221</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3222"><a href="#L-3222"><span class="linenos">3222</span></a> <span class="s2">"spec"</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 class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3224"><a href="#L-3224"><span class="linenos">3224</span></a> <span class="s2">"over"</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 class="s2">"first"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3226"><a href="#L-3226"><span class="linenos">3226</span></a> <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">WindowSpec</span><span class="p">(</span><span class="n">Expression</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><span id="L-3231"><a href="#L-3231"><span class="linenos">3231</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3232"><a href="#L-3232"><span class="linenos">3232</span></a> <span class="s2">"start"</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 class="s2">"start_side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3234"><a href="#L-3234"><span class="linenos">3234</span></a> <span class="s2">"end"</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 class="s2">"end_side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3236"><a href="#L-3236"><span class="linenos">3236</span></a> <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">Where</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-3240"><a href="#L-3240"><span class="linenos">3240</span></a> <span class="k">pass</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">Star</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-3244"><a href="#L-3244"><span class="linenos">3244</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-3245"><a href="#L-3245"><span class="linenos">3245</span></a> -</span><span id="L-3246"><a href="#L-3246"><span class="linenos">3246</span></a> <span class="nd">@property</span> -</span><span id="L-3247"><a href="#L-3247"><span class="linenos">3247</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-3248"><a href="#L-3248"><span class="linenos">3248</span></a> <span class="k">return</span> <span class="s2">"*"</span> -</span><span id="L-3249"><a href="#L-3249"><span class="linenos">3249</span></a> -</span><span id="L-3250"><a href="#L-3250"><span class="linenos">3250</span></a> <span class="nd">@property</span> -</span><span id="L-3251"><a href="#L-3251"><span class="linenos">3251</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-3252"><a href="#L-3252"><span class="linenos">3252</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-3253"><a href="#L-3253"><span class="linenos">3253</span></a> -</span><span id="L-3254"><a href="#L-3254"><span class="linenos">3254</span></a> -</span><span id="L-3255"><a href="#L-3255"><span class="linenos">3255</span></a><span class="k">class</span> <span class="nc">Parameter</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-3256"><a href="#L-3256"><span class="linenos">3256</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3257"><a href="#L-3257"><span class="linenos">3257</span></a> -</span><span id="L-3258"><a href="#L-3258"><span class="linenos">3258</span></a> -</span><span id="L-3259"><a href="#L-3259"><span class="linenos">3259</span></a><span class="k">class</span> <span class="nc">SessionParameter</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-3260"><a href="#L-3260"><span class="linenos">3260</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3261"><a href="#L-3261"><span class="linenos">3261</span></a> -</span><span id="L-3262"><a href="#L-3262"><span class="linenos">3262</span></a> -</span><span id="L-3263"><a href="#L-3263"><span class="linenos">3263</span></a><span class="k">class</span> <span class="nc">Placeholder</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-3264"><a href="#L-3264"><span class="linenos">3264</span></a> <span class="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">False</span><span class="p">}</span> -</span><span id="L-3265"><a href="#L-3265"><span class="linenos">3265</span></a> -</span><span id="L-3266"><a href="#L-3266"><span class="linenos">3266</span></a> -</span><span id="L-3267"><a href="#L-3267"><span class="linenos">3267</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-3268"><a href="#L-3268"><span class="linenos">3268</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-3269"><a href="#L-3269"><span class="linenos">3269</span></a> -</span><span id="L-3270"><a href="#L-3270"><span class="linenos">3270</span></a> <span class="nd">@property</span> -</span><span id="L-3271"><a href="#L-3271"><span class="linenos">3271</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-3272"><a href="#L-3272"><span class="linenos">3272</span></a> <span class="k">return</span> <span class="s2">"NULL"</span> -</span><span id="L-3273"><a href="#L-3273"><span class="linenos">3273</span></a> -</span><span id="L-3274"><a href="#L-3274"><span class="linenos">3274</span></a> -</span><span id="L-3275"><a href="#L-3275"><span class="linenos">3275</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-3276"><a href="#L-3276"><span class="linenos">3276</span></a> <span class="k">pass</span> -</span><span id="L-3277"><a href="#L-3277"><span class="linenos">3277</span></a> -</span><span id="L-3278"><a href="#L-3278"><span class="linenos">3278</span></a> -</span><span id="L-3279"><a href="#L-3279"><span class="linenos">3279</span></a><span class="k">class</span> <span class="nc">DataTypeSize</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-3280"><a href="#L-3280"><span class="linenos">3280</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3281"><a href="#L-3281"><span class="linenos">3281</span></a> -</span><span id="L-3282"><a href="#L-3282"><span class="linenos">3282</span></a> -</span><span id="L-3283"><a href="#L-3283"><span class="linenos">3283</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-3284"><a href="#L-3284"><span class="linenos">3284</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3285"><a href="#L-3285"><span class="linenos">3285</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-3286"><a href="#L-3286"><span class="linenos">3286</span></a> <span class="s2">"expressions"</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 class="s2">"nested"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3288"><a href="#L-3288"><span class="linenos">3288</span></a> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3289"><a href="#L-3289"><span class="linenos">3289</span></a> <span class="s2">"prefix"</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="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 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-3293"><a href="#L-3293"><span class="linenos">3293</span></a> <span class="n">ARRAY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3294"><a href="#L-3294"><span class="linenos">3294</span></a> <span class="n">BIGDECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3295"><a href="#L-3295"><span class="linenos">3295</span></a> <span class="n">BIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3296"><a href="#L-3296"><span class="linenos">3296</span></a> <span class="n">BIGSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3297"><a href="#L-3297"><span class="linenos">3297</span></a> <span class="n">BINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3298"><a href="#L-3298"><span class="linenos">3298</span></a> <span class="n">BIT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3299"><a href="#L-3299"><span class="linenos">3299</span></a> <span class="n">BOOLEAN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3300"><a href="#L-3300"><span class="linenos">3300</span></a> <span class="n">CHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3301"><a href="#L-3301"><span class="linenos">3301</span></a> <span class="n">DATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3302"><a href="#L-3302"><span class="linenos">3302</span></a> <span class="n">DATETIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3303"><a href="#L-3303"><span class="linenos">3303</span></a> <span class="n">DATETIME64</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3304"><a href="#L-3304"><span class="linenos">3304</span></a> <span class="n">ENUM</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3305"><a href="#L-3305"><span class="linenos">3305</span></a> <span class="n">INT4RANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3306"><a href="#L-3306"><span class="linenos">3306</span></a> <span class="n">INT4MULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3307"><a href="#L-3307"><span class="linenos">3307</span></a> <span class="n">INT8RANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3308"><a href="#L-3308"><span class="linenos">3308</span></a> <span class="n">INT8MULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3309"><a href="#L-3309"><span class="linenos">3309</span></a> <span class="n">NUMRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3310"><a href="#L-3310"><span class="linenos">3310</span></a> <span class="n">NUMMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3311"><a href="#L-3311"><span class="linenos">3311</span></a> <span class="n">TSRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3312"><a href="#L-3312"><span class="linenos">3312</span></a> <span class="n">TSMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3313"><a href="#L-3313"><span class="linenos">3313</span></a> <span class="n">TSTZRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3314"><a href="#L-3314"><span class="linenos">3314</span></a> <span class="n">TSTZMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3315"><a href="#L-3315"><span class="linenos">3315</span></a> <span class="n">DATERANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3316"><a href="#L-3316"><span class="linenos">3316</span></a> <span class="n">DATEMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3317"><a href="#L-3317"><span class="linenos">3317</span></a> <span class="n">DECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3318"><a href="#L-3318"><span class="linenos">3318</span></a> <span class="n">DOUBLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3319"><a href="#L-3319"><span class="linenos">3319</span></a> <span class="n">FLOAT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3320"><a href="#L-3320"><span class="linenos">3320</span></a> <span class="n">GEOGRAPHY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3321"><a href="#L-3321"><span class="linenos">3321</span></a> <span class="n">GEOMETRY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3322"><a href="#L-3322"><span class="linenos">3322</span></a> <span class="n">HLLSKETCH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3323"><a href="#L-3323"><span class="linenos">3323</span></a> <span class="n">HSTORE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3324"><a href="#L-3324"><span class="linenos">3324</span></a> <span class="n">IMAGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3325"><a href="#L-3325"><span class="linenos">3325</span></a> <span class="n">INET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3326"><a href="#L-3326"><span class="linenos">3326</span></a> <span class="n">INT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3327"><a href="#L-3327"><span class="linenos">3327</span></a> <span class="n">INT128</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3328"><a href="#L-3328"><span class="linenos">3328</span></a> <span class="n">INT256</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3329"><a href="#L-3329"><span class="linenos">3329</span></a> <span class="n">INTERVAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3330"><a href="#L-3330"><span class="linenos">3330</span></a> <span class="n">JSON</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3331"><a href="#L-3331"><span class="linenos">3331</span></a> <span class="n">JSONB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3332"><a href="#L-3332"><span class="linenos">3332</span></a> <span class="n">LONGBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3333"><a href="#L-3333"><span class="linenos">3333</span></a> <span class="n">LONGTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3334"><a href="#L-3334"><span class="linenos">3334</span></a> <span class="n">MAP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3335"><a href="#L-3335"><span class="linenos">3335</span></a> <span class="n">MEDIUMBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3336"><a href="#L-3336"><span class="linenos">3336</span></a> <span class="n">MEDIUMTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3337"><a href="#L-3337"><span class="linenos">3337</span></a> <span class="n">MONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3338"><a href="#L-3338"><span class="linenos">3338</span></a> <span class="n">NCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3339"><a href="#L-3339"><span class="linenos">3339</span></a> <span class="n">NULL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3340"><a href="#L-3340"><span class="linenos">3340</span></a> <span class="n">NULLABLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3341"><a href="#L-3341"><span class="linenos">3341</span></a> <span class="n">NVARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3342"><a href="#L-3342"><span class="linenos">3342</span></a> <span class="n">OBJECT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3343"><a href="#L-3343"><span class="linenos">3343</span></a> <span class="n">ROWVERSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3344"><a href="#L-3344"><span class="linenos">3344</span></a> <span class="n">SERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3345"><a href="#L-3345"><span class="linenos">3345</span></a> <span class="n">SET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3346"><a href="#L-3346"><span class="linenos">3346</span></a> <span class="n">SMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3347"><a href="#L-3347"><span class="linenos">3347</span></a> <span class="n">SMALLMONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3348"><a href="#L-3348"><span class="linenos">3348</span></a> <span class="n">SMALLSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3349"><a href="#L-3349"><span class="linenos">3349</span></a> <span class="n">STRUCT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3350"><a href="#L-3350"><span class="linenos">3350</span></a> <span class="n">SUPER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3351"><a href="#L-3351"><span class="linenos">3351</span></a> <span class="n">TEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3352"><a href="#L-3352"><span class="linenos">3352</span></a> <span class="n">TIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3353"><a href="#L-3353"><span class="linenos">3353</span></a> <span class="n">TIMESTAMP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3354"><a href="#L-3354"><span class="linenos">3354</span></a> <span class="n">TIMESTAMPTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3355"><a href="#L-3355"><span class="linenos">3355</span></a> <span class="n">TIMESTAMPLTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3356"><a href="#L-3356"><span class="linenos">3356</span></a> <span class="n">TINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3357"><a href="#L-3357"><span class="linenos">3357</span></a> <span class="n">UBIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3358"><a href="#L-3358"><span class="linenos">3358</span></a> <span class="n">UINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3359"><a href="#L-3359"><span class="linenos">3359</span></a> <span class="n">USMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3360"><a href="#L-3360"><span class="linenos">3360</span></a> <span class="n">UTINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3361"><a href="#L-3361"><span class="linenos">3361</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-3362"><a href="#L-3362"><span class="linenos">3362</span></a> <span class="n">UINT128</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3363"><a href="#L-3363"><span class="linenos">3363</span></a> <span class="n">UINT256</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3364"><a href="#L-3364"><span class="linenos">3364</span></a> <span class="n">UNIQUEIDENTIFIER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3365"><a href="#L-3365"><span class="linenos">3365</span></a> <span class="n">USERDEFINED</span> <span class="o">=</span> <span class="s2">"USER-DEFINED"</span> -</span><span id="L-3366"><a href="#L-3366"><span class="linenos">3366</span></a> <span class="n">UUID</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3367"><a href="#L-3367"><span class="linenos">3367</span></a> <span class="n">VARBINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3368"><a href="#L-3368"><span class="linenos">3368</span></a> <span class="n">VARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3369"><a href="#L-3369"><span class="linenos">3369</span></a> <span class="n">VARIANT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-3370"><a href="#L-3370"><span class="linenos">3370</span></a> <span class="n">XML</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</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 class="n">TEXT_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3373"><a href="#L-3373"><span class="linenos">3373</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">,</span> -</span><span id="L-3374"><a href="#L-3374"><span class="linenos">3374</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">,</span> -</span><span id="L-3375"><a href="#L-3375"><span class="linenos">3375</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">,</span> -</span><span id="L-3376"><a href="#L-3376"><span class="linenos">3376</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">,</span> -</span><span id="L-3377"><a href="#L-3377"><span class="linenos">3377</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">,</span> -</span><span id="L-3378"><a href="#L-3378"><span class="linenos">3378</span></a> <span class="p">}</span> -</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 class="n">INTEGER_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3381"><a href="#L-3381"><span class="linenos">3381</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">,</span> -</span><span id="L-3382"><a href="#L-3382"><span class="linenos">3382</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">,</span> -</span><span id="L-3383"><a href="#L-3383"><span class="linenos">3383</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">,</span> -</span><span id="L-3384"><a href="#L-3384"><span class="linenos">3384</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span> -</span><span id="L-3385"><a href="#L-3385"><span class="linenos">3385</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT128</span><span class="p">,</span> -</span><span id="L-3386"><a href="#L-3386"><span class="linenos">3386</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT256</span><span class="p">,</span> -</span><span id="L-3387"><a href="#L-3387"><span class="linenos">3387</span></a> <span class="p">}</span> -</span><span id="L-3388"><a href="#L-3388"><span class="linenos">3388</span></a> -</span><span id="L-3389"><a href="#L-3389"><span class="linenos">3389</span></a> <span class="n">FLOAT_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3390"><a href="#L-3390"><span class="linenos">3390</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">,</span> -</span><span id="L-3391"><a href="#L-3391"><span class="linenos">3391</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span> -</span><span id="L-3392"><a href="#L-3392"><span class="linenos">3392</span></a> <span class="p">}</span> +</span><span id="L-3136"><a href="#L-3136"><span class="linenos">3136</span></a> <span class="nd">@property</span> +</span><span id="L-3137"><a href="#L-3137"><span class="linenos">3137</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-3138"><a href="#L-3138"><span class="linenos">3138</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-3139"><a href="#L-3139"><span class="linenos">3139</span></a> +</span><span id="L-3140"><a href="#L-3140"><span class="linenos">3140</span></a> <span class="nd">@property</span> +</span><span id="L-3141"><a href="#L-3141"><span class="linenos">3141</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-3142"><a href="#L-3142"><span class="linenos">3142</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-3143"><a href="#L-3143"><span class="linenos">3143</span></a> +</span><span id="L-3144"><a href="#L-3144"><span class="linenos">3144</span></a> <span class="nd">@property</span> +</span><span id="L-3145"><a href="#L-3145"><span class="linenos">3145</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-3146"><a href="#L-3146"><span class="linenos">3146</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-3147"><a href="#L-3147"><span class="linenos">3147</span></a> +</span><span id="L-3148"><a href="#L-3148"><span class="linenos">3148</span></a> +</span><span id="L-3149"><a href="#L-3149"><span class="linenos">3149</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-3150"><a href="#L-3150"><span class="linenos">3150</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-3151"><a href="#L-3151"><span class="linenos">3151</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-3152"><a href="#L-3152"><span class="linenos">3152</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3153"><a href="#L-3153"><span class="linenos">3153</span></a> <span class="s2">"with"</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="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> +</span><span id="L-3155"><a href="#L-3155"><span class="linenos">3155</span></a> <span class="p">}</span> +</span><span id="L-3156"><a href="#L-3156"><span class="linenos">3156</span></a> +</span><span id="L-3157"><a href="#L-3157"><span class="linenos">3157</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-3158"><a href="#L-3158"><span class="linenos">3158</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-3159"><a href="#L-3159"><span class="linenos">3159</span></a><span class="sd"> Returns the first non subquery.</span> +</span><span id="L-3160"><a href="#L-3160"><span class="linenos">3160</span></a><span class="sd"> """</span> +</span><span id="L-3161"><a href="#L-3161"><span class="linenos">3161</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="L-3162"><a href="#L-3162"><span class="linenos">3162</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-3163"><a href="#L-3163"><span class="linenos">3163</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-3164"><a href="#L-3164"><span class="linenos">3164</span></a> <span class="k">return</span> <span class="n">expression</span> +</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 class="nd">@property</span> +</span><span id="L-3167"><a href="#L-3167"><span class="linenos">3167</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-3168"><a href="#L-3168"><span class="linenos">3168</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-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 class="nd">@property</span> +</span><span id="L-3171"><a href="#L-3171"><span class="linenos">3171</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-3172"><a href="#L-3172"><span class="linenos">3172</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-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">TableSample</span><span class="p">(</span><span class="n">Expression</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><span id="L-3177"><a href="#L-3177"><span class="linenos">3177</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3178"><a href="#L-3178"><span class="linenos">3178</span></a> <span class="s2">"method"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3179"><a href="#L-3179"><span class="linenos">3179</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-3180"><a href="#L-3180"><span class="linenos">3180</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-3181"><a href="#L-3181"><span class="linenos">3181</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-3182"><a href="#L-3182"><span class="linenos">3182</span></a> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3183"><a href="#L-3183"><span class="linenos">3183</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3184"><a href="#L-3184"><span class="linenos">3184</span></a> <span class="s2">"size"</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 class="s2">"seed"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3186"><a href="#L-3186"><span class="linenos">3186</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3187"><a href="#L-3187"><span class="linenos">3187</span></a> <span class="p">}</span> +</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><span id="L-3190"><a href="#L-3190"><span class="linenos">3190</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-3191"><a href="#L-3191"><span class="linenos">3191</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-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="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-3194"><a href="#L-3194"><span class="linenos">3194</span></a> <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 class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3196"><a href="#L-3196"><span class="linenos">3196</span></a> <span class="s2">"postfix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3197"><a href="#L-3197"><span class="linenos">3197</span></a> <span class="p">}</span> +</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><span id="L-3200"><a href="#L-3200"><span class="linenos">3200</span></a><span class="c1"># Represents both the standard SQL PIVOT operator and DuckDB's "simplified" PIVOT syntax</span> +</span><span id="L-3201"><a href="#L-3201"><span class="linenos">3201</span></a><span class="c1"># https://duckdb.org/docs/sql/statements/pivot</span> +</span><span id="L-3202"><a href="#L-3202"><span class="linenos">3202</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-3203"><a href="#L-3203"><span class="linenos">3203</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-3204"><a href="#L-3204"><span class="linenos">3204</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3205"><a href="#L-3205"><span class="linenos">3205</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3206"><a href="#L-3206"><span class="linenos">3206</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-3207"><a href="#L-3207"><span class="linenos">3207</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3208"><a href="#L-3208"><span class="linenos">3208</span></a> <span class="s2">"unpivot"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3209"><a href="#L-3209"><span class="linenos">3209</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3210"><a href="#L-3210"><span class="linenos">3210</span></a> <span class="s2">"group"</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 class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3212"><a href="#L-3212"><span class="linenos">3212</span></a> <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">Window</span><span class="p">(</span><span class="n">Expression</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><span id="L-3217"><a href="#L-3217"><span class="linenos">3217</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-3218"><a href="#L-3218"><span class="linenos">3218</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-3219"><a href="#L-3219"><span class="linenos">3219</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3220"><a href="#L-3220"><span class="linenos">3220</span></a> <span class="s2">"spec"</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 class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3222"><a href="#L-3222"><span class="linenos">3222</span></a> <span class="s2">"over"</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 class="s2">"first"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3224"><a href="#L-3224"><span class="linenos">3224</span></a> <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">WindowSpec</span><span class="p">(</span><span class="n">Expression</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><span id="L-3229"><a href="#L-3229"><span class="linenos">3229</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3230"><a href="#L-3230"><span class="linenos">3230</span></a> <span class="s2">"start"</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 class="s2">"start_side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3232"><a href="#L-3232"><span class="linenos">3232</span></a> <span class="s2">"end"</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 class="s2">"end_side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3234"><a href="#L-3234"><span class="linenos">3234</span></a> <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">Where</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-3238"><a href="#L-3238"><span class="linenos">3238</span></a> <span class="k">pass</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">Star</span><span class="p">(</span><span class="n">Expression</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">"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-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 class="nd">@property</span> +</span><span id="L-3245"><a href="#L-3245"><span class="linenos">3245</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-3246"><a href="#L-3246"><span class="linenos">3246</span></a> <span class="k">return</span> <span class="s2">"*"</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="nd">@property</span> +</span><span id="L-3249"><a href="#L-3249"><span class="linenos">3249</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-3250"><a href="#L-3250"><span class="linenos">3250</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-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><span id="L-3253"><a href="#L-3253"><span class="linenos">3253</span></a><span class="k">class</span> <span class="nc">Parameter</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-3254"><a href="#L-3254"><span class="linenos">3254</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-3257"><a href="#L-3257"><span class="linenos">3257</span></a><span class="k">class</span> <span class="nc">SessionParameter</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-3258"><a href="#L-3258"><span class="linenos">3258</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-3261"><a href="#L-3261"><span class="linenos">3261</span></a><span class="k">class</span> <span class="nc">Placeholder</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-3262"><a href="#L-3262"><span class="linenos">3262</span></a> <span class="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">False</span><span class="p">}</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><span id="L-3265"><a href="#L-3265"><span class="linenos">3265</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-3266"><a href="#L-3266"><span class="linenos">3266</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-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="nd">@property</span> +</span><span id="L-3269"><a href="#L-3269"><span class="linenos">3269</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-3270"><a href="#L-3270"><span class="linenos">3270</span></a> <span class="k">return</span> <span class="s2">"NULL"</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><span id="L-3273"><a href="#L-3273"><span class="linenos">3273</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-3274"><a href="#L-3274"><span class="linenos">3274</span></a> <span class="k">pass</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><span id="L-3277"><a href="#L-3277"><span class="linenos">3277</span></a><span class="k">class</span> <span class="nc">DataTypeSize</span><span class="p">(</span><span class="n">Expression</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">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><span id="L-3281"><a href="#L-3281"><span class="linenos">3281</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-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><span id="L-3283"><a href="#L-3283"><span class="linenos">3283</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-3284"><a href="#L-3284"><span class="linenos">3284</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3285"><a href="#L-3285"><span class="linenos">3285</span></a> <span class="s2">"nested"</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 class="s2">"values"</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 class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3288"><a href="#L-3288"><span class="linenos">3288</span></a> <span class="p">}</span> +</span><span id="L-3289"><a href="#L-3289"><span class="linenos">3289</span></a> +</span><span id="L-3290"><a href="#L-3290"><span class="linenos">3290</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-3291"><a href="#L-3291"><span class="linenos">3291</span></a> <span class="n">ARRAY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3292"><a href="#L-3292"><span class="linenos">3292</span></a> <span class="n">BIGDECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3293"><a href="#L-3293"><span class="linenos">3293</span></a> <span class="n">BIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3294"><a href="#L-3294"><span class="linenos">3294</span></a> <span class="n">BIGSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3295"><a href="#L-3295"><span class="linenos">3295</span></a> <span class="n">BINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3296"><a href="#L-3296"><span class="linenos">3296</span></a> <span class="n">BIT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3297"><a href="#L-3297"><span class="linenos">3297</span></a> <span class="n">BOOLEAN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3298"><a href="#L-3298"><span class="linenos">3298</span></a> <span class="n">CHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3299"><a href="#L-3299"><span class="linenos">3299</span></a> <span class="n">DATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3300"><a href="#L-3300"><span class="linenos">3300</span></a> <span class="n">DATETIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3301"><a href="#L-3301"><span class="linenos">3301</span></a> <span class="n">DATETIME64</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3302"><a href="#L-3302"><span class="linenos">3302</span></a> <span class="n">ENUM</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3303"><a href="#L-3303"><span class="linenos">3303</span></a> <span class="n">INT4RANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3304"><a href="#L-3304"><span class="linenos">3304</span></a> <span class="n">INT4MULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3305"><a href="#L-3305"><span class="linenos">3305</span></a> <span class="n">INT8RANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3306"><a href="#L-3306"><span class="linenos">3306</span></a> <span class="n">INT8MULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3307"><a href="#L-3307"><span class="linenos">3307</span></a> <span class="n">NUMRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3308"><a href="#L-3308"><span class="linenos">3308</span></a> <span class="n">NUMMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3309"><a href="#L-3309"><span class="linenos">3309</span></a> <span class="n">TSRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3310"><a href="#L-3310"><span class="linenos">3310</span></a> <span class="n">TSMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3311"><a href="#L-3311"><span class="linenos">3311</span></a> <span class="n">TSTZRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3312"><a href="#L-3312"><span class="linenos">3312</span></a> <span class="n">TSTZMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3313"><a href="#L-3313"><span class="linenos">3313</span></a> <span class="n">DATERANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3314"><a href="#L-3314"><span class="linenos">3314</span></a> <span class="n">DATEMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3315"><a href="#L-3315"><span class="linenos">3315</span></a> <span class="n">DECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3316"><a href="#L-3316"><span class="linenos">3316</span></a> <span class="n">DOUBLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3317"><a href="#L-3317"><span class="linenos">3317</span></a> <span class="n">FLOAT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3318"><a href="#L-3318"><span class="linenos">3318</span></a> <span class="n">GEOGRAPHY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3319"><a href="#L-3319"><span class="linenos">3319</span></a> <span class="n">GEOMETRY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3320"><a href="#L-3320"><span class="linenos">3320</span></a> <span class="n">HLLSKETCH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3321"><a href="#L-3321"><span class="linenos">3321</span></a> <span class="n">HSTORE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3322"><a href="#L-3322"><span class="linenos">3322</span></a> <span class="n">IMAGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3323"><a href="#L-3323"><span class="linenos">3323</span></a> <span class="n">INET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3324"><a href="#L-3324"><span class="linenos">3324</span></a> <span class="n">INT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3325"><a href="#L-3325"><span class="linenos">3325</span></a> <span class="n">INT128</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3326"><a href="#L-3326"><span class="linenos">3326</span></a> <span class="n">INT256</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3327"><a href="#L-3327"><span class="linenos">3327</span></a> <span class="n">INTERVAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3328"><a href="#L-3328"><span class="linenos">3328</span></a> <span class="n">JSON</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3329"><a href="#L-3329"><span class="linenos">3329</span></a> <span class="n">JSONB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3330"><a href="#L-3330"><span class="linenos">3330</span></a> <span class="n">LONGBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3331"><a href="#L-3331"><span class="linenos">3331</span></a> <span class="n">LONGTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3332"><a href="#L-3332"><span class="linenos">3332</span></a> <span class="n">MAP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3333"><a href="#L-3333"><span class="linenos">3333</span></a> <span class="n">MEDIUMBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3334"><a href="#L-3334"><span class="linenos">3334</span></a> <span class="n">MEDIUMTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3335"><a href="#L-3335"><span class="linenos">3335</span></a> <span class="n">MONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3336"><a href="#L-3336"><span class="linenos">3336</span></a> <span class="n">NCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3337"><a href="#L-3337"><span class="linenos">3337</span></a> <span class="n">NULL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3338"><a href="#L-3338"><span class="linenos">3338</span></a> <span class="n">NULLABLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3339"><a href="#L-3339"><span class="linenos">3339</span></a> <span class="n">NVARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3340"><a href="#L-3340"><span class="linenos">3340</span></a> <span class="n">OBJECT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3341"><a href="#L-3341"><span class="linenos">3341</span></a> <span class="n">ROWVERSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3342"><a href="#L-3342"><span class="linenos">3342</span></a> <span class="n">SERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3343"><a href="#L-3343"><span class="linenos">3343</span></a> <span class="n">SET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3344"><a href="#L-3344"><span class="linenos">3344</span></a> <span class="n">SMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3345"><a href="#L-3345"><span class="linenos">3345</span></a> <span class="n">SMALLMONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3346"><a href="#L-3346"><span class="linenos">3346</span></a> <span class="n">SMALLSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3347"><a href="#L-3347"><span class="linenos">3347</span></a> <span class="n">STRUCT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3348"><a href="#L-3348"><span class="linenos">3348</span></a> <span class="n">SUPER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3349"><a href="#L-3349"><span class="linenos">3349</span></a> <span class="n">TEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3350"><a href="#L-3350"><span class="linenos">3350</span></a> <span class="n">TIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3351"><a href="#L-3351"><span class="linenos">3351</span></a> <span class="n">TIMESTAMP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3352"><a href="#L-3352"><span class="linenos">3352</span></a> <span class="n">TIMESTAMPTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3353"><a href="#L-3353"><span class="linenos">3353</span></a> <span class="n">TIMESTAMPLTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3354"><a href="#L-3354"><span class="linenos">3354</span></a> <span class="n">TINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3355"><a href="#L-3355"><span class="linenos">3355</span></a> <span class="n">UBIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3356"><a href="#L-3356"><span class="linenos">3356</span></a> <span class="n">UINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3357"><a href="#L-3357"><span class="linenos">3357</span></a> <span class="n">USMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3358"><a href="#L-3358"><span class="linenos">3358</span></a> <span class="n">UTINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3359"><a href="#L-3359"><span class="linenos">3359</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-3360"><a href="#L-3360"><span class="linenos">3360</span></a> <span class="n">UINT128</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3361"><a href="#L-3361"><span class="linenos">3361</span></a> <span class="n">UINT256</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3362"><a href="#L-3362"><span class="linenos">3362</span></a> <span class="n">UNIQUEIDENTIFIER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3363"><a href="#L-3363"><span class="linenos">3363</span></a> <span class="n">USERDEFINED</span> <span class="o">=</span> <span class="s2">"USER-DEFINED"</span> +</span><span id="L-3364"><a href="#L-3364"><span class="linenos">3364</span></a> <span class="n">UUID</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3365"><a href="#L-3365"><span class="linenos">3365</span></a> <span class="n">VARBINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3366"><a href="#L-3366"><span class="linenos">3366</span></a> <span class="n">VARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3367"><a href="#L-3367"><span class="linenos">3367</span></a> <span class="n">VARIANT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3368"><a href="#L-3368"><span class="linenos">3368</span></a> <span class="n">XML</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-3369"><a href="#L-3369"><span class="linenos">3369</span></a> +</span><span id="L-3370"><a href="#L-3370"><span class="linenos">3370</span></a> <span class="n">TEXT_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-3371"><a href="#L-3371"><span class="linenos">3371</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">,</span> +</span><span id="L-3372"><a href="#L-3372"><span class="linenos">3372</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">,</span> +</span><span id="L-3373"><a href="#L-3373"><span class="linenos">3373</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">,</span> +</span><span id="L-3374"><a href="#L-3374"><span class="linenos">3374</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">,</span> +</span><span id="L-3375"><a href="#L-3375"><span class="linenos">3375</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">,</span> +</span><span id="L-3376"><a href="#L-3376"><span class="linenos">3376</span></a> <span class="p">}</span> +</span><span id="L-3377"><a href="#L-3377"><span class="linenos">3377</span></a> +</span><span id="L-3378"><a href="#L-3378"><span class="linenos">3378</span></a> <span class="n">INTEGER_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-3379"><a href="#L-3379"><span class="linenos">3379</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">,</span> +</span><span id="L-3380"><a href="#L-3380"><span class="linenos">3380</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">,</span> +</span><span id="L-3381"><a href="#L-3381"><span class="linenos">3381</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">,</span> +</span><span id="L-3382"><a href="#L-3382"><span class="linenos">3382</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span> +</span><span id="L-3383"><a href="#L-3383"><span class="linenos">3383</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT128</span><span class="p">,</span> +</span><span id="L-3384"><a href="#L-3384"><span class="linenos">3384</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT256</span><span class="p">,</span> +</span><span id="L-3385"><a href="#L-3385"><span class="linenos">3385</span></a> <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 class="n">FLOAT_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-3388"><a href="#L-3388"><span class="linenos">3388</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">,</span> +</span><span id="L-3389"><a href="#L-3389"><span class="linenos">3389</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span> +</span><span id="L-3390"><a href="#L-3390"><span class="linenos">3390</span></a> <span class="p">}</span> +</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">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-3393"><a href="#L-3393"><span class="linenos">3393</span></a> -</span><span id="L-3394"><a href="#L-3394"><span class="linenos">3394</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-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="n">TEMPORAL_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3397"><a href="#L-3397"><span class="linenos">3397</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIME</span><span class="p">,</span> -</span><span id="L-3398"><a href="#L-3398"><span class="linenos">3398</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">,</span> -</span><span id="L-3399"><a href="#L-3399"><span class="linenos">3399</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">,</span> -</span><span id="L-3400"><a href="#L-3400"><span class="linenos">3400</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPLTZ</span><span class="p">,</span> -</span><span id="L-3401"><a href="#L-3401"><span class="linenos">3401</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATE</span><span class="p">,</span> -</span><span id="L-3402"><a href="#L-3402"><span class="linenos">3402</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATETIME</span><span class="p">,</span> -</span><span id="L-3403"><a href="#L-3403"><span class="linenos">3403</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATETIME64</span><span class="p">,</span> -</span><span id="L-3404"><a href="#L-3404"><span class="linenos">3404</span></a> <span class="p">}</span> +</span><span id="L-3394"><a href="#L-3394"><span class="linenos">3394</span></a> <span class="n">TEMPORAL_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-3395"><a href="#L-3395"><span class="linenos">3395</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIME</span><span class="p">,</span> +</span><span id="L-3396"><a href="#L-3396"><span class="linenos">3396</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">,</span> +</span><span id="L-3397"><a href="#L-3397"><span class="linenos">3397</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">,</span> +</span><span id="L-3398"><a href="#L-3398"><span class="linenos">3398</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPLTZ</span><span class="p">,</span> +</span><span id="L-3399"><a href="#L-3399"><span class="linenos">3399</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATE</span><span class="p">,</span> +</span><span id="L-3400"><a href="#L-3400"><span class="linenos">3400</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATETIME</span><span class="p">,</span> +</span><span id="L-3401"><a href="#L-3401"><span class="linenos">3401</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATETIME64</span><span class="p">,</span> +</span><span id="L-3402"><a href="#L-3402"><span class="linenos">3402</span></a> <span class="p">}</span> +</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="n">META_TYPES</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"UNKNOWN"</span><span class="p">,</span> <span class="s2">"NULL"</span><span class="p">}</span> </span><span id="L-3405"><a href="#L-3405"><span class="linenos">3405</span></a> -</span><span id="L-3406"><a href="#L-3406"><span class="linenos">3406</span></a> <span class="n">META_TYPES</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"UNKNOWN"</span><span class="p">,</span> <span class="s2">"NULL"</span><span class="p">}</span> -</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="nd">@classmethod</span> -</span><span id="L-3409"><a href="#L-3409"><span class="linenos">3409</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span> -</span><span id="L-3410"><a href="#L-3410"><span class="linenos">3410</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-3411"><a href="#L-3411"><span class="linenos">3411</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">DataType</span><span class="p">:</span> -</span><span id="L-3412"><a href="#L-3412"><span class="linenos">3412</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-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 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-3415"><a href="#L-3415"><span class="linenos">3415</span></a> <span class="n">upper</span> <span class="o">=</span> <span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="L-3416"><a href="#L-3416"><span class="linenos">3416</span></a> <span class="k">if</span> <span class="n">upper</span> <span class="ow">in</span> <span class="n">DataType</span><span class="o">.</span><span class="n">META_TYPES</span><span class="p">:</span> -</span><span id="L-3417"><a href="#L-3417"><span class="linenos">3417</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">upper</span><span class="p">])</span> -</span><span id="L-3418"><a href="#L-3418"><span class="linenos">3418</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-3419"><a href="#L-3419"><span class="linenos">3419</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-3420"><a href="#L-3420"><span class="linenos">3420</span></a> -</span><span id="L-3421"><a href="#L-3421"><span class="linenos">3421</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-3422"><a href="#L-3422"><span class="linenos">3422</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-3423"><a href="#L-3423"><span class="linenos">3423</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-3424"><a href="#L-3424"><span class="linenos">3424</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-3425"><a href="#L-3425"><span class="linenos">3425</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-3426"><a href="#L-3426"><span class="linenos">3426</span></a> <span class="k">return</span> <span class="n">dtype</span> -</span><span id="L-3427"><a href="#L-3427"><span class="linenos">3427</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-3428"><a href="#L-3428"><span class="linenos">3428</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-3406"><a href="#L-3406"><span class="linenos">3406</span></a> <span class="nd">@classmethod</span> +</span><span id="L-3407"><a href="#L-3407"><span class="linenos">3407</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span> +</span><span id="L-3408"><a href="#L-3408"><span class="linenos">3408</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-3409"><a href="#L-3409"><span class="linenos">3409</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">DataType</span><span class="p">:</span> +</span><span id="L-3410"><a href="#L-3410"><span class="linenos">3410</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-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">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-3413"><a href="#L-3413"><span class="linenos">3413</span></a> <span class="n">upper</span> <span class="o">=</span> <span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="L-3414"><a href="#L-3414"><span class="linenos">3414</span></a> <span class="k">if</span> <span class="n">upper</span> <span class="ow">in</span> <span class="n">DataType</span><span class="o">.</span><span class="n">META_TYPES</span><span class="p">:</span> +</span><span id="L-3415"><a href="#L-3415"><span class="linenos">3415</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">upper</span><span class="p">])</span> +</span><span id="L-3416"><a href="#L-3416"><span class="linenos">3416</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-3417"><a href="#L-3417"><span class="linenos">3417</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-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 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-3420"><a href="#L-3420"><span class="linenos">3420</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-3421"><a href="#L-3421"><span class="linenos">3421</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-3422"><a href="#L-3422"><span class="linenos">3422</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-3423"><a href="#L-3423"><span class="linenos">3423</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-3424"><a href="#L-3424"><span class="linenos">3424</span></a> <span class="k">return</span> <span class="n">dtype</span> +</span><span id="L-3425"><a href="#L-3425"><span class="linenos">3425</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-3426"><a href="#L-3426"><span class="linenos">3426</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-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">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-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 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-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="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">dtypes</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="nb">bool</span><span class="p">:</span> -</span><span id="L-3433"><a href="#L-3433"><span class="linenos">3433</span></a> <span class="k">return</span> <span class="nb">any</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">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 class="o">.</span><span class="n">this</span> <span class="k">for</span> <span class="n">dtype</span> <span class="ow">in</span> <span class="n">dtypes</span><span class="p">)</span> -</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><span id="L-3436"><a href="#L-3436"><span class="linenos">3436</span></a><span class="c1"># https://www.postgresql.org/docs/15/datatype-pseudo.html</span> -</span><span id="L-3437"><a href="#L-3437"><span class="linenos">3437</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-3438"><a href="#L-3438"><span class="linenos">3438</span></a> <span class="k">pass</span> -</span><span id="L-3439"><a href="#L-3439"><span class="linenos">3439</span></a> -</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 class="c1"># WHERE x <OP> EXISTS|ALL|ANY|SOME(SELECT ...)</span> -</span><span id="L-3442"><a href="#L-3442"><span class="linenos">3442</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-3443"><a href="#L-3443"><span class="linenos">3443</span></a> <span class="k">pass</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">All</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> -</span><span id="L-3447"><a href="#L-3447"><span class="linenos">3447</span></a> <span class="k">pass</span> -</span><span id="L-3448"><a href="#L-3448"><span class="linenos">3448</span></a> -</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="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-3451"><a href="#L-3451"><span class="linenos">3451</span></a> <span class="k">pass</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">Exists</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> -</span><span id="L-3455"><a href="#L-3455"><span class="linenos">3455</span></a> <span class="k">pass</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="c1"># Commands to interact with the databases or engines. For most of the command</span> -</span><span id="L-3459"><a href="#L-3459"><span class="linenos">3459</span></a><span class="c1"># expressions we parse whatever comes after the command's name as a string.</span> -</span><span id="L-3460"><a href="#L-3460"><span class="linenos">3460</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-3461"><a href="#L-3461"><span class="linenos">3461</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3462"><a href="#L-3462"><span class="linenos">3462</span></a> -</span><span id="L-3463"><a href="#L-3463"><span class="linenos">3463</span></a> -</span><span id="L-3464"><a href="#L-3464"><span class="linenos">3464</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-3465"><a href="#L-3465"><span class="linenos">3465</span></a> <span class="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-3466"><a href="#L-3466"><span class="linenos">3466</span></a> -</span><span id="L-3467"><a href="#L-3467"><span class="linenos">3467</span></a> -</span><span id="L-3468"><a href="#L-3468"><span class="linenos">3468</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-3469"><a href="#L-3469"><span class="linenos">3469</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-3470"><a href="#L-3470"><span class="linenos">3470</span></a> -</span><span id="L-3471"><a href="#L-3471"><span class="linenos">3471</span></a> -</span><span id="L-3472"><a href="#L-3472"><span class="linenos">3472</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-3473"><a href="#L-3473"><span class="linenos">3473</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-3474"><a href="#L-3474"><span class="linenos">3474</span></a> -</span><span id="L-3475"><a href="#L-3475"><span class="linenos">3475</span></a> -</span><span id="L-3476"><a href="#L-3476"><span class="linenos">3476</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-3477"><a href="#L-3477"><span class="linenos">3477</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3478"><a href="#L-3478"><span class="linenos">3478</span></a> -</span><span id="L-3479"><a href="#L-3479"><span class="linenos">3479</span></a> -</span><span id="L-3480"><a href="#L-3480"><span class="linenos">3480</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-3481"><a href="#L-3481"><span class="linenos">3481</span></a> <span class="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-3482"><a href="#L-3482"><span class="linenos">3482</span></a> -</span><span id="L-3483"><a href="#L-3483"><span class="linenos">3483</span></a> -</span><span id="L-3484"><a href="#L-3484"><span class="linenos">3484</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-3485"><a href="#L-3485"><span class="linenos">3485</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-3486"><a href="#L-3486"><span class="linenos">3486</span></a> -</span><span id="L-3487"><a href="#L-3487"><span class="linenos">3487</span></a> -</span><span id="L-3488"><a href="#L-3488"><span class="linenos">3488</span></a><span class="c1"># Binary expressions like (ADD a b)</span> -</span><span id="L-3489"><a href="#L-3489"><span class="linenos">3489</span></a><span class="k">class</span> <span class="nc">Binary</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-3490"><a href="#L-3490"><span class="linenos">3490</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3491"><a href="#L-3491"><span class="linenos">3491</span></a> -</span><span id="L-3492"><a href="#L-3492"><span class="linenos">3492</span></a> <span class="nd">@property</span> -</span><span id="L-3493"><a href="#L-3493"><span class="linenos">3493</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-3494"><a href="#L-3494"><span class="linenos">3494</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-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="nd">@property</span> -</span><span id="L-3497"><a href="#L-3497"><span class="linenos">3497</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-3498"><a href="#L-3498"><span class="linenos">3498</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-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><span id="L-3501"><a href="#L-3501"><span class="linenos">3501</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-3502"><a href="#L-3502"><span class="linenos">3502</span></a> <span class="k">pass</span> -</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><span id="L-3505"><a href="#L-3505"><span class="linenos">3505</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><span id="L-3506"><a href="#L-3506"><span class="linenos">3506</span></a> <span class="k">pass</span> -</span><span id="L-3507"><a href="#L-3507"><span class="linenos">3507</span></a> -</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 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-3510"><a href="#L-3510"><span class="linenos">3510</span></a> <span class="k">pass</span> -</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><span id="L-3513"><a href="#L-3513"><span class="linenos">3513</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-3514"><a href="#L-3514"><span class="linenos">3514</span></a> <span class="k">pass</span> -</span><span id="L-3515"><a href="#L-3515"><span class="linenos">3515</span></a> -</span><span id="L-3516"><a href="#L-3516"><span class="linenos">3516</span></a> -</span><span id="L-3517"><a href="#L-3517"><span class="linenos">3517</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-3518"><a href="#L-3518"><span class="linenos">3518</span></a> <span class="k">pass</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">BitwiseLeftShift</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-3522"><a href="#L-3522"><span class="linenos">3522</span></a> <span class="k">pass</span> -</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">BitwiseOr</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-3526"><a href="#L-3526"><span class="linenos">3526</span></a> <span class="k">pass</span> -</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="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-3530"><a href="#L-3530"><span class="linenos">3530</span></a> <span class="k">pass</span> -</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><span id="L-3533"><a href="#L-3533"><span class="linenos">3533</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-3534"><a href="#L-3534"><span class="linenos">3534</span></a> <span class="k">pass</span> -</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><span id="L-3537"><a href="#L-3537"><span class="linenos">3537</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-3538"><a href="#L-3538"><span class="linenos">3538</span></a> <span class="k">pass</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><span id="L-3541"><a href="#L-3541"><span class="linenos">3541</span></a><span class="k">class</span> <span class="nc">Overlaps</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-3542"><a href="#L-3542"><span class="linenos">3542</span></a> <span class="k">pass</span> -</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><span id="L-3545"><a href="#L-3545"><span class="linenos">3545</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-3546"><a href="#L-3546"><span class="linenos">3546</span></a> <span class="nd">@property</span> -</span><span id="L-3547"><a href="#L-3547"><span class="linenos">3547</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-3548"><a href="#L-3548"><span class="linenos">3548</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-3549"><a href="#L-3549"><span class="linenos">3549</span></a> -</span><span id="L-3550"><a href="#L-3550"><span class="linenos">3550</span></a> <span class="nd">@property</span> -</span><span id="L-3551"><a href="#L-3551"><span class="linenos">3551</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-3552"><a href="#L-3552"><span class="linenos">3552</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-3553"><a href="#L-3553"><span class="linenos">3553</span></a> -</span><span id="L-3554"><a href="#L-3554"><span class="linenos">3554</span></a> <span class="nd">@classmethod</span> -</span><span id="L-3555"><a href="#L-3555"><span class="linenos">3555</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expressions</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="n">Expression</span><span class="p">])</span> <span class="o">-></span> <span class="n">Dot</span><span class="p">:</span> -</span><span id="L-3556"><a href="#L-3556"><span class="linenos">3556</span></a><span class="w"> </span><span class="sd">"""Build a Dot object with a sequence of expressions."""</span> -</span><span id="L-3557"><a href="#L-3557"><span class="linenos">3557</span></a> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">expressions</span><span class="p">)</span> <span class="o"><</span> <span class="mi">2</span><span class="p">:</span> -</span><span id="L-3558"><a href="#L-3558"><span class="linenos">3558</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Dot requires >= 2 expressions."</span><span class="p">)</span> -</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="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span> <span class="o">=</span> <span class="n">expressions</span> -</span><span id="L-3561"><a href="#L-3561"><span class="linenos">3561</span></a> <span class="n">dot</span> <span class="o">=</span> <span class="n">Dot</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">a</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">b</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 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-3564"><a href="#L-3564"><span class="linenos">3564</span></a> <span class="n">dot</span> <span class="o">=</span> <span class="n">Dot</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">dot</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> +</span><span id="L-3430"><a href="#L-3430"><span class="linenos">3430</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="o">*</span><span class="n">dtypes</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="nb">bool</span><span class="p">:</span> +</span><span id="L-3431"><a href="#L-3431"><span class="linenos">3431</span></a> <span class="k">return</span> <span class="nb">any</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">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 class="o">.</span><span class="n">this</span> <span class="k">for</span> <span class="n">dtype</span> <span class="ow">in</span> <span class="n">dtypes</span><span class="p">)</span> +</span><span id="L-3432"><a href="#L-3432"><span class="linenos">3432</span></a> +</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 class="c1"># https://www.postgresql.org/docs/15/datatype-pseudo.html</span> +</span><span id="L-3435"><a href="#L-3435"><span class="linenos">3435</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-3436"><a href="#L-3436"><span class="linenos">3436</span></a> <span class="k">pass</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><span id="L-3439"><a href="#L-3439"><span class="linenos">3439</span></a><span class="c1"># WHERE x <OP> EXISTS|ALL|ANY|SOME(SELECT ...)</span> +</span><span id="L-3440"><a href="#L-3440"><span class="linenos">3440</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-3441"><a href="#L-3441"><span class="linenos">3441</span></a> <span class="k">pass</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">All</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> +</span><span id="L-3445"><a href="#L-3445"><span class="linenos">3445</span></a> <span class="k">pass</span> +</span><span id="L-3446"><a href="#L-3446"><span class="linenos">3446</span></a> +</span><span id="L-3447"><a href="#L-3447"><span class="linenos">3447</span></a> +</span><span id="L-3448"><a href="#L-3448"><span class="linenos">3448</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-3449"><a href="#L-3449"><span class="linenos">3449</span></a> <span class="k">pass</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">Exists</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> +</span><span id="L-3453"><a href="#L-3453"><span class="linenos">3453</span></a> <span class="k">pass</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="c1"># Commands to interact with the databases or engines. For most of the command</span> +</span><span id="L-3457"><a href="#L-3457"><span class="linenos">3457</span></a><span class="c1"># expressions we parse whatever comes after the command's name as a string.</span> +</span><span id="L-3458"><a href="#L-3458"><span class="linenos">3458</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-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">Transaction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-3463"><a href="#L-3463"><span class="linenos">3463</span></a> <span class="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-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">Commit</span><span class="p">(</span><span class="n">Expression</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">"chain"</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">Rollback</span><span class="p">(</span><span class="n">Expression</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">"savepoint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</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">AlterTable</span><span class="p">(</span><span class="n">Expression</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">"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-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">AddConstraint</span><span class="p">(</span><span class="n">Expression</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">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-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">DropPartition</span><span class="p">(</span><span class="n">Expression</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">"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-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="c1"># Binary expressions like (ADD a b)</span> +</span><span id="L-3487"><a href="#L-3487"><span class="linenos">3487</span></a><span class="k">class</span> <span class="nc">Binary</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-3488"><a href="#L-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">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</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="nd">@property</span> +</span><span id="L-3491"><a href="#L-3491"><span class="linenos">3491</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-3492"><a href="#L-3492"><span class="linenos">3492</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-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="nd">@property</span> +</span><span id="L-3495"><a href="#L-3495"><span class="linenos">3495</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-3496"><a href="#L-3496"><span class="linenos">3496</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-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><span id="L-3499"><a href="#L-3499"><span class="linenos">3499</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-3500"><a href="#L-3500"><span class="linenos">3500</span></a> <span class="k">pass</span> +</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><span id="L-3503"><a href="#L-3503"><span class="linenos">3503</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><span id="L-3504"><a href="#L-3504"><span class="linenos">3504</span></a> <span class="k">pass</span> +</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><span id="L-3507"><a href="#L-3507"><span class="linenos">3507</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-3508"><a href="#L-3508"><span class="linenos">3508</span></a> <span class="k">pass</span> +</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><span id="L-3511"><a href="#L-3511"><span class="linenos">3511</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-3512"><a href="#L-3512"><span class="linenos">3512</span></a> <span class="k">pass</span> +</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><span id="L-3515"><a href="#L-3515"><span class="linenos">3515</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-3516"><a href="#L-3516"><span class="linenos">3516</span></a> <span class="k">pass</span> +</span><span id="L-3517"><a href="#L-3517"><span class="linenos">3517</span></a> +</span><span id="L-3518"><a href="#L-3518"><span class="linenos">3518</span></a> +</span><span id="L-3519"><a href="#L-3519"><span class="linenos">3519</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-3520"><a href="#L-3520"><span class="linenos">3520</span></a> <span class="k">pass</span> +</span><span id="L-3521"><a href="#L-3521"><span class="linenos">3521</span></a> +</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 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-3524"><a href="#L-3524"><span class="linenos">3524</span></a> <span class="k">pass</span> +</span><span id="L-3525"><a href="#L-3525"><span class="linenos">3525</span></a> +</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 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-3528"><a href="#L-3528"><span class="linenos">3528</span></a> <span class="k">pass</span> +</span><span id="L-3529"><a href="#L-3529"><span class="linenos">3529</span></a> +</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 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-3532"><a href="#L-3532"><span class="linenos">3532</span></a> <span class="k">pass</span> +</span><span id="L-3533"><a href="#L-3533"><span class="linenos">3533</span></a> +</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">Div</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-3536"><a href="#L-3536"><span class="linenos">3536</span></a> <span class="k">pass</span> +</span><span id="L-3537"><a href="#L-3537"><span class="linenos">3537</span></a> +</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">Overlaps</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-3540"><a href="#L-3540"><span class="linenos">3540</span></a> <span class="k">pass</span> +</span><span id="L-3541"><a href="#L-3541"><span class="linenos">3541</span></a> +</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 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-3544"><a href="#L-3544"><span class="linenos">3544</span></a> <span class="nd">@property</span> +</span><span id="L-3545"><a href="#L-3545"><span class="linenos">3545</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-3546"><a href="#L-3546"><span class="linenos">3546</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-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="nd">@property</span> +</span><span id="L-3549"><a href="#L-3549"><span class="linenos">3549</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-3550"><a href="#L-3550"><span class="linenos">3550</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-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="nd">@classmethod</span> +</span><span id="L-3553"><a href="#L-3553"><span class="linenos">3553</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expressions</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="n">Expression</span><span class="p">])</span> <span class="o">-></span> <span class="n">Dot</span><span class="p">:</span> +</span><span id="L-3554"><a href="#L-3554"><span class="linenos">3554</span></a><span class="w"> </span><span class="sd">"""Build a Dot object with a sequence of expressions."""</span> +</span><span id="L-3555"><a href="#L-3555"><span class="linenos">3555</span></a> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">expressions</span><span class="p">)</span> <span class="o"><</span> <span class="mi">2</span><span class="p">:</span> +</span><span id="L-3556"><a href="#L-3556"><span class="linenos">3556</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Dot requires >= 2 expressions."</span><span class="p">)</span> +</span><span id="L-3557"><a href="#L-3557"><span class="linenos">3557</span></a> +</span><span id="L-3558"><a href="#L-3558"><span class="linenos">3558</span></a> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span> <span class="o">=</span> <span class="n">expressions</span> +</span><span id="L-3559"><a href="#L-3559"><span class="linenos">3559</span></a> <span class="n">dot</span> <span class="o">=</span> <span class="n">Dot</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">a</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">b</span><span class="p">)</span> +</span><span id="L-3560"><a href="#L-3560"><span class="linenos">3560</span></a> +</span><span id="L-3561"><a href="#L-3561"><span class="linenos">3561</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-3562"><a href="#L-3562"><span class="linenos">3562</span></a> <span class="n">dot</span> <span class="o">=</span> <span class="n">Dot</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">dot</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> +</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">return</span> <span class="n">dot</span> </span><span id="L-3565"><a href="#L-3565"><span class="linenos">3565</span></a> -</span><span id="L-3566"><a href="#L-3566"><span class="linenos">3566</span></a> <span class="k">return</span> <span class="n">dot</span> -</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><span id="L-3569"><a href="#L-3569"><span class="linenos">3569</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-3570"><a href="#L-3570"><span class="linenos">3570</span></a> <span class="k">pass</span> -</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><span id="L-3573"><a href="#L-3573"><span class="linenos">3573</span></a><span class="k">class</span> <span class="nc">SafeDPipe</span><span class="p">(</span><span class="n">DPipe</span><span class="p">):</span> -</span><span id="L-3574"><a href="#L-3574"><span class="linenos">3574</span></a> <span class="k">pass</span> -</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><span id="L-3577"><a href="#L-3577"><span class="linenos">3577</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-3578"><a href="#L-3578"><span class="linenos">3578</span></a> <span class="k">pass</span> -</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><span id="L-3581"><a href="#L-3581"><span class="linenos">3581</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-3582"><a href="#L-3582"><span class="linenos">3582</span></a> <span class="k">pass</span> -</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><span id="L-3585"><a href="#L-3585"><span class="linenos">3585</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-3586"><a href="#L-3586"><span class="linenos">3586</span></a> <span class="k">pass</span> -</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><span id="L-3589"><a href="#L-3589"><span class="linenos">3589</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-3590"><a href="#L-3590"><span class="linenos">3590</span></a> <span class="k">pass</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><span id="L-3593"><a href="#L-3593"><span class="linenos">3593</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-3594"><a href="#L-3594"><span class="linenos">3594</span></a> <span class="k">pass</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">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-3598"><a href="#L-3598"><span class="linenos">3598</span></a> <span class="k">pass</span> -</span><span id="L-3599"><a href="#L-3599"><span class="linenos">3599</span></a> -</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">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-3602"><a href="#L-3602"><span class="linenos">3602</span></a> <span class="k">pass</span> -</span><span id="L-3603"><a href="#L-3603"><span class="linenos">3603</span></a> -</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">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-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-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">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-3610"><a href="#L-3610"><span class="linenos">3610</span></a> <span class="k">pass</span> -</span><span id="L-3611"><a href="#L-3611"><span class="linenos">3611</span></a> -</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">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-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-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">IntDiv</span><span class="p">(</span><span class="n">Binary</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-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">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-3622"><a href="#L-3622"><span class="linenos">3622</span></a> <span class="k">pass</span> -</span><span id="L-3623"><a href="#L-3623"><span class="linenos">3623</span></a> -</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="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-3626"><a href="#L-3626"><span class="linenos">3626</span></a><span class="w"> </span><span class="sd">"""Kwarg in special functions like func(kwarg => y)."""</span> -</span><span id="L-3627"><a href="#L-3627"><span class="linenos">3627</span></a> -</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 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-3630"><a href="#L-3630"><span class="linenos">3630</span></a> <span class="k">pass</span> -</span><span id="L-3631"><a href="#L-3631"><span class="linenos">3631</span></a> -</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 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-3634"><a href="#L-3634"><span class="linenos">3634</span></a> <span class="k">pass</span> -</span><span id="L-3635"><a href="#L-3635"><span class="linenos">3635</span></a> -</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 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-3638"><a href="#L-3638"><span class="linenos">3638</span></a> <span class="k">pass</span> -</span><span id="L-3639"><a href="#L-3639"><span class="linenos">3639</span></a> -</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 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-3642"><a href="#L-3642"><span class="linenos">3642</span></a> <span class="k">pass</span> -</span><span id="L-3643"><a href="#L-3643"><span class="linenos">3643</span></a> -</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 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-3646"><a href="#L-3646"><span class="linenos">3646</span></a> <span class="k">pass</span> -</span><span id="L-3647"><a href="#L-3647"><span class="linenos">3647</span></a> -</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 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-3650"><a href="#L-3650"><span class="linenos">3650</span></a> <span class="k">pass</span> -</span><span id="L-3651"><a href="#L-3651"><span class="linenos">3651</span></a> -</span><span id="L-3652"><a href="#L-3652"><span class="linenos">3652</span></a> -</span><span id="L-3653"><a href="#L-3653"><span class="linenos">3653</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-3654"><a href="#L-3654"><span class="linenos">3654</span></a> <span class="k">pass</span> -</span><span id="L-3655"><a href="#L-3655"><span class="linenos">3655</span></a> -</span><span id="L-3656"><a href="#L-3656"><span class="linenos">3656</span></a> -</span><span id="L-3657"><a href="#L-3657"><span class="linenos">3657</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-3658"><a href="#L-3658"><span class="linenos">3658</span></a> <span class="k">pass</span> -</span><span id="L-3659"><a href="#L-3659"><span class="linenos">3659</span></a> -</span><span id="L-3660"><a href="#L-3660"><span class="linenos">3660</span></a> -</span><span id="L-3661"><a href="#L-3661"><span class="linenos">3661</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-3662"><a href="#L-3662"><span class="linenos">3662</span></a> <span class="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-3663"><a href="#L-3663"><span class="linenos">3663</span></a> -</span><span id="L-3664"><a href="#L-3664"><span class="linenos">3664</span></a> -</span><span id="L-3665"><a href="#L-3665"><span class="linenos">3665</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-3666"><a href="#L-3666"><span class="linenos">3666</span></a> <span class="k">pass</span> -</span><span id="L-3667"><a href="#L-3667"><span class="linenos">3667</span></a> -</span><span id="L-3668"><a href="#L-3668"><span class="linenos">3668</span></a> -</span><span id="L-3669"><a href="#L-3669"><span class="linenos">3669</span></a><span class="k">class</span> <span class="nc">ArrayOverlaps</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-3670"><a href="#L-3670"><span class="linenos">3670</span></a> <span class="k">pass</span> -</span><span id="L-3671"><a href="#L-3671"><span class="linenos">3671</span></a> -</span><span id="L-3672"><a href="#L-3672"><span class="linenos">3672</span></a> -</span><span id="L-3673"><a href="#L-3673"><span class="linenos">3673</span></a><span class="c1"># Unary Expressions</span> -</span><span id="L-3674"><a href="#L-3674"><span class="linenos">3674</span></a><span class="c1"># (NOT a)</span> -</span><span id="L-3675"><a href="#L-3675"><span class="linenos">3675</span></a><span class="k">class</span> <span class="nc">Unary</span><span class="p">(</span><span class="n">Condition</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><span id="L-3679"><a href="#L-3679"><span class="linenos">3679</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-3680"><a href="#L-3680"><span class="linenos">3680</span></a> <span class="k">pass</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="k">class</span> <span class="nc">Not</span><span class="p">(</span><span class="n">Unary</span><span class="p">):</span> -</span><span id="L-3684"><a href="#L-3684"><span class="linenos">3684</span></a> <span class="k">pass</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><span id="L-3687"><a href="#L-3687"><span class="linenos">3687</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><span id="L-3688"><a href="#L-3688"><span class="linenos">3688</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3689"><a href="#L-3689"><span class="linenos">3689</span></a> -</span><span id="L-3690"><a href="#L-3690"><span class="linenos">3690</span></a> <span class="nd">@property</span> -</span><span id="L-3691"><a href="#L-3691"><span class="linenos">3691</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-3692"><a href="#L-3692"><span class="linenos">3692</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-3693"><a href="#L-3693"><span class="linenos">3693</span></a> -</span><span id="L-3694"><a href="#L-3694"><span class="linenos">3694</span></a> -</span><span id="L-3695"><a href="#L-3695"><span class="linenos">3695</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-3696"><a href="#L-3696"><span class="linenos">3696</span></a> <span class="k">pass</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="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-3700"><a href="#L-3700"><span class="linenos">3700</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3701"><a href="#L-3701"><span class="linenos">3701</span></a> -</span><span id="L-3702"><a href="#L-3702"><span class="linenos">3702</span></a> <span class="nd">@property</span> -</span><span id="L-3703"><a href="#L-3703"><span class="linenos">3703</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-3704"><a href="#L-3704"><span class="linenos">3704</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-3705"><a href="#L-3705"><span class="linenos">3705</span></a> -</span><span id="L-3706"><a href="#L-3706"><span class="linenos">3706</span></a> -</span><span id="L-3707"><a href="#L-3707"><span class="linenos">3707</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-3708"><a href="#L-3708"><span class="linenos">3708</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3709"><a href="#L-3709"><span class="linenos">3709</span></a> -</span><span id="L-3710"><a href="#L-3710"><span class="linenos">3710</span></a> <span class="nd">@property</span> -</span><span id="L-3711"><a href="#L-3711"><span class="linenos">3711</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-3712"><a href="#L-3712"><span class="linenos">3712</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-3713"><a href="#L-3713"><span class="linenos">3713</span></a> -</span><span id="L-3714"><a href="#L-3714"><span class="linenos">3714</span></a> -</span><span id="L-3715"><a href="#L-3715"><span class="linenos">3715</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-3716"><a href="#L-3716"><span class="linenos">3716</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3717"><a href="#L-3717"><span class="linenos">3717</span></a> -</span><span id="L-3718"><a href="#L-3718"><span class="linenos">3718</span></a> -</span><span id="L-3719"><a href="#L-3719"><span class="linenos">3719</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-3720"><a href="#L-3720"><span class="linenos">3720</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3721"><a href="#L-3721"><span class="linenos">3721</span></a> -</span><span id="L-3722"><a href="#L-3722"><span class="linenos">3722</span></a> -</span><span id="L-3723"><a href="#L-3723"><span class="linenos">3723</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-3724"><a href="#L-3724"><span class="linenos">3724</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3725"><a href="#L-3725"><span class="linenos">3725</span></a> -</span><span id="L-3726"><a href="#L-3726"><span class="linenos">3726</span></a> -</span><span id="L-3727"><a href="#L-3727"><span class="linenos">3727</span></a><span class="k">class</span> <span class="nc">SafeBracket</span><span class="p">(</span><span class="n">Bracket</span><span class="p">):</span> -</span><span id="L-3728"><a href="#L-3728"><span class="linenos">3728</span></a><span class="w"> </span><span class="sd">"""Represents array lookup where OOB index yields NULL instead of causing a failure."""</span> -</span><span id="L-3729"><a href="#L-3729"><span class="linenos">3729</span></a> -</span><span id="L-3730"><a href="#L-3730"><span class="linenos">3730</span></a> -</span><span id="L-3731"><a href="#L-3731"><span class="linenos">3731</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-3732"><a href="#L-3732"><span class="linenos">3732</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-3733"><a href="#L-3733"><span class="linenos">3733</span></a> -</span><span id="L-3734"><a href="#L-3734"><span class="linenos">3734</span></a> -</span><span id="L-3735"><a href="#L-3735"><span class="linenos">3735</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-3736"><a href="#L-3736"><span class="linenos">3736</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3737"><a href="#L-3737"><span class="linenos">3737</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-3738"><a href="#L-3738"><span class="linenos">3738</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3739"><a href="#L-3739"><span class="linenos">3739</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3740"><a href="#L-3740"><span class="linenos">3740</span></a> <span class="s2">"unnest"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3741"><a href="#L-3741"><span class="linenos">3741</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3742"><a href="#L-3742"><span class="linenos">3742</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-3743"><a href="#L-3743"><span class="linenos">3743</span></a> <span class="p">}</span> -</span><span id="L-3744"><a href="#L-3744"><span class="linenos">3744</span></a> -</span><span id="L-3745"><a href="#L-3745"><span class="linenos">3745</span></a> -</span><span id="L-3746"><a href="#L-3746"><span class="linenos">3746</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-3747"><a href="#L-3747"><span class="linenos">3747</span></a><span class="w"> </span><span class="sd">"""Automatically converts unit arg into a var."""</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 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-3568"><a href="#L-3568"><span class="linenos">3568</span></a> <span class="k">pass</span> +</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><span id="L-3571"><a href="#L-3571"><span class="linenos">3571</span></a><span class="k">class</span> <span class="nc">SafeDPipe</span><span class="p">(</span><span class="n">DPipe</span><span class="p">):</span> +</span><span id="L-3572"><a href="#L-3572"><span class="linenos">3572</span></a> <span class="k">pass</span> +</span><span id="L-3573"><a href="#L-3573"><span class="linenos">3573</span></a> +</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 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-3576"><a href="#L-3576"><span class="linenos">3576</span></a> <span class="k">pass</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 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-3580"><a href="#L-3580"><span class="linenos">3580</span></a> <span class="k">pass</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 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-3584"><a href="#L-3584"><span class="linenos">3584</span></a> <span class="k">pass</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 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-3588"><a href="#L-3588"><span class="linenos">3588</span></a> <span class="k">pass</span> +</span><span id="L-3589"><a href="#L-3589"><span class="linenos">3589</span></a> +</span><span id="L-3590"><a href="#L-3590"><span class="linenos">3590</span></a> +</span><span id="L-3591"><a href="#L-3591"><span class="linenos">3591</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-3592"><a href="#L-3592"><span class="linenos">3592</span></a> <span class="k">pass</span> +</span><span id="L-3593"><a href="#L-3593"><span class="linenos">3593</span></a> +</span><span id="L-3594"><a href="#L-3594"><span class="linenos">3594</span></a> +</span><span id="L-3595"><a href="#L-3595"><span class="linenos">3595</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-3596"><a href="#L-3596"><span class="linenos">3596</span></a> <span class="k">pass</span> +</span><span id="L-3597"><a href="#L-3597"><span class="linenos">3597</span></a> +</span><span id="L-3598"><a href="#L-3598"><span class="linenos">3598</span></a> +</span><span id="L-3599"><a href="#L-3599"><span class="linenos">3599</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-3600"><a href="#L-3600"><span class="linenos">3600</span></a> <span class="k">pass</span> +</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><span id="L-3603"><a href="#L-3603"><span class="linenos">3603</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-3604"><a href="#L-3604"><span class="linenos">3604</span></a> <span class="k">pass</span> +</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><span id="L-3607"><a href="#L-3607"><span class="linenos">3607</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-3608"><a href="#L-3608"><span class="linenos">3608</span></a> <span class="k">pass</span> +</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><span id="L-3611"><a href="#L-3611"><span class="linenos">3611</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-3612"><a href="#L-3612"><span class="linenos">3612</span></a> <span class="k">pass</span> +</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><span id="L-3615"><a href="#L-3615"><span class="linenos">3615</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-3616"><a href="#L-3616"><span class="linenos">3616</span></a> <span class="k">pass</span> +</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><span id="L-3619"><a href="#L-3619"><span class="linenos">3619</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-3620"><a href="#L-3620"><span class="linenos">3620</span></a> <span class="k">pass</span> +</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><span id="L-3623"><a href="#L-3623"><span class="linenos">3623</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-3624"><a href="#L-3624"><span class="linenos">3624</span></a><span class="w"> </span><span class="sd">"""Kwarg in special functions like func(kwarg => y)."""</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><span id="L-3627"><a href="#L-3627"><span class="linenos">3627</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-3628"><a href="#L-3628"><span class="linenos">3628</span></a> <span class="k">pass</span> +</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><span id="L-3631"><a href="#L-3631"><span class="linenos">3631</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-3632"><a href="#L-3632"><span class="linenos">3632</span></a> <span class="k">pass</span> +</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">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-3636"><a href="#L-3636"><span class="linenos">3636</span></a> <span class="k">pass</span> +</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">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-3640"><a href="#L-3640"><span class="linenos">3640</span></a> <span class="k">pass</span> +</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">Mod</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-3644"><a href="#L-3644"><span class="linenos">3644</span></a> <span class="k">pass</span> +</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">Mul</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-3648"><a href="#L-3648"><span class="linenos">3648</span></a> <span class="k">pass</span> +</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">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-3652"><a href="#L-3652"><span class="linenos">3652</span></a> <span class="k">pass</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">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-3656"><a href="#L-3656"><span class="linenos">3656</span></a> <span class="k">pass</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">Slice</span><span class="p">(</span><span class="n">Binary</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">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-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">Sub</span><span class="p">(</span><span class="n">Binary</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">ArrayOverlaps</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-3668"><a href="#L-3668"><span class="linenos">3668</span></a> <span class="k">pass</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="c1"># Unary Expressions</span> +</span><span id="L-3672"><a href="#L-3672"><span class="linenos">3672</span></a><span class="c1"># (NOT a)</span> +</span><span id="L-3673"><a href="#L-3673"><span class="linenos">3673</span></a><span class="k">class</span> <span class="nc">Unary</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-3674"><a href="#L-3674"><span class="linenos">3674</span></a> <span class="k">pass</span> +</span><span id="L-3675"><a href="#L-3675"><span class="linenos">3675</span></a> +</span><span id="L-3676"><a href="#L-3676"><span class="linenos">3676</span></a> +</span><span id="L-3677"><a href="#L-3677"><span class="linenos">3677</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-3678"><a href="#L-3678"><span class="linenos">3678</span></a> <span class="k">pass</span> +</span><span id="L-3679"><a href="#L-3679"><span class="linenos">3679</span></a> +</span><span id="L-3680"><a href="#L-3680"><span class="linenos">3680</span></a> +</span><span id="L-3681"><a href="#L-3681"><span class="linenos">3681</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><span id="L-3682"><a href="#L-3682"><span class="linenos">3682</span></a> <span class="k">pass</span> +</span><span id="L-3683"><a href="#L-3683"><span class="linenos">3683</span></a> +</span><span id="L-3684"><a href="#L-3684"><span class="linenos">3684</span></a> +</span><span id="L-3685"><a href="#L-3685"><span class="linenos">3685</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><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">"with"</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="nd">@property</span> +</span><span id="L-3689"><a href="#L-3689"><span class="linenos">3689</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-3690"><a href="#L-3690"><span class="linenos">3690</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-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><span id="L-3693"><a href="#L-3693"><span class="linenos">3693</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-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><span id="L-3697"><a href="#L-3697"><span class="linenos">3697</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-3698"><a href="#L-3698"><span class="linenos">3698</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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 class="nd">@property</span> +</span><span id="L-3701"><a href="#L-3701"><span class="linenos">3701</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-3702"><a href="#L-3702"><span class="linenos">3702</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-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">Aliases</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-3706"><a href="#L-3706"><span class="linenos">3706</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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 class="nd">@property</span> +</span><span id="L-3709"><a href="#L-3709"><span class="linenos">3709</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-3710"><a href="#L-3710"><span class="linenos">3710</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-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">AtTimeZone</span><span class="p">(</span><span class="n">Expression</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">"zone"</span><span class="p">:</span> <span class="kc">True</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="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-3718"><a href="#L-3718"><span class="linenos">3718</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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">Bracket</span><span class="p">(</span><span class="n">Condition</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">"expressions"</span><span class="p">:</span> <span class="kc">True</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">SafeBracket</span><span class="p">(</span><span class="n">Bracket</span><span class="p">):</span> +</span><span id="L-3726"><a href="#L-3726"><span class="linenos">3726</span></a><span class="w"> </span><span class="sd">"""Represents array lookup where OOB index yields NULL instead of causing a failure."""</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><span id="L-3729"><a href="#L-3729"><span class="linenos">3729</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-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">"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-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">class</span> <span class="nc">In</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-3734"><a href="#L-3734"><span class="linenos">3734</span></a> <span class="n">arg_types</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 class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-3736"><a href="#L-3736"><span class="linenos">3736</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3737"><a href="#L-3737"><span class="linenos">3737</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3738"><a href="#L-3738"><span class="linenos">3738</span></a> <span class="s2">"unnest"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3739"><a href="#L-3739"><span class="linenos">3739</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3740"><a href="#L-3740"><span class="linenos">3740</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-3741"><a href="#L-3741"><span class="linenos">3741</span></a> <span class="p">}</span> +</span><span id="L-3742"><a href="#L-3742"><span class="linenos">3742</span></a> +</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">class</span> <span class="nc">TimeUnit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-3745"><a href="#L-3745"><span class="linenos">3745</span></a><span class="w"> </span><span class="sd">"""Automatically converts unit arg into a var."""</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 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-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 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-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 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-3752"><a href="#L-3752"><span class="linenos">3752</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-3753"><a href="#L-3753"><span class="linenos">3753</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="p">(</span><span class="n">Column</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)):</span> -</span><span id="L-3754"><a href="#L-3754"><span class="linenos">3754</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-3755"><a href="#L-3755"><span class="linenos">3755</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-3756"><a href="#L-3756"><span class="linenos">3756</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-3749"><a href="#L-3749"><span class="linenos">3749</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-3750"><a href="#L-3750"><span class="linenos">3750</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-3751"><a href="#L-3751"><span class="linenos">3751</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="p">(</span><span class="n">Column</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)):</span> +</span><span id="L-3752"><a href="#L-3752"><span class="linenos">3752</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-3753"><a href="#L-3753"><span class="linenos">3753</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-3754"><a href="#L-3754"><span class="linenos">3754</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-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 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-3757"><a href="#L-3757"><span class="linenos">3757</span></a> -</span><span id="L-3758"><a href="#L-3758"><span class="linenos">3758</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-3759"><a href="#L-3759"><span class="linenos">3759</span></a> -</span><span id="L-3760"><a href="#L-3760"><span class="linenos">3760</span></a> -</span><span id="L-3761"><a href="#L-3761"><span class="linenos">3761</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-3762"><a href="#L-3762"><span class="linenos">3762</span></a> <span class="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-3763"><a href="#L-3763"><span class="linenos">3763</span></a> -</span><span id="L-3764"><a href="#L-3764"><span class="linenos">3764</span></a> <span class="nd">@property</span> -</span><span id="L-3765"><a href="#L-3765"><span class="linenos">3765</span></a> <span class="k">def</span> <span class="nf">unit</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">Var</span><span class="p">]:</span> -</span><span id="L-3766"><a href="#L-3766"><span class="linenos">3766</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">"unit"</span><span class="p">)</span> -</span><span id="L-3767"><a href="#L-3767"><span class="linenos">3767</span></a> -</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="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-3770"><a href="#L-3770"><span class="linenos">3770</span></a> <span class="k">pass</span> -</span><span id="L-3771"><a href="#L-3771"><span class="linenos">3771</span></a> -</span><span id="L-3772"><a href="#L-3772"><span class="linenos">3772</span></a> -</span><span id="L-3773"><a href="#L-3773"><span class="linenos">3773</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-3774"><a href="#L-3774"><span class="linenos">3774</span></a> <span class="k">pass</span> -</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><span id="L-3777"><a href="#L-3777"><span class="linenos">3777</span></a><span class="c1"># Functions</span> -</span><span id="L-3778"><a href="#L-3778"><span class="linenos">3778</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-3779"><a href="#L-3779"><span class="linenos">3779</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-3780"><a href="#L-3780"><span class="linenos">3780</span></a><span class="sd"> The base class for all function expressions.</span> -</span><span id="L-3781"><a href="#L-3781"><span class="linenos">3781</span></a> -</span><span id="L-3782"><a href="#L-3782"><span class="linenos">3782</span></a><span class="sd"> Attributes:</span> -</span><span id="L-3783"><a href="#L-3783"><span class="linenos">3783</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-3784"><a href="#L-3784"><span class="linenos">3784</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-3785"><a href="#L-3785"><span class="linenos">3785</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-3786"><a href="#L-3786"><span class="linenos">3786</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-3787"><a href="#L-3787"><span class="linenos">3787</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-3788"><a href="#L-3788"><span class="linenos">3788</span></a><span class="sd"> name is set to the expression's class name transformed to snake case.</span> -</span><span id="L-3789"><a href="#L-3789"><span class="linenos">3789</span></a><span class="sd"> """</span> +</span><span id="L-3758"><a href="#L-3758"><span class="linenos">3758</span></a> +</span><span id="L-3759"><a href="#L-3759"><span class="linenos">3759</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-3760"><a href="#L-3760"><span class="linenos">3760</span></a> <span class="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-3761"><a href="#L-3761"><span class="linenos">3761</span></a> +</span><span id="L-3762"><a href="#L-3762"><span class="linenos">3762</span></a> <span class="nd">@property</span> +</span><span id="L-3763"><a href="#L-3763"><span class="linenos">3763</span></a> <span class="k">def</span> <span class="nf">unit</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">Var</span><span class="p">]:</span> +</span><span id="L-3764"><a href="#L-3764"><span class="linenos">3764</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">"unit"</span><span class="p">)</span> +</span><span id="L-3765"><a href="#L-3765"><span class="linenos">3765</span></a> +</span><span id="L-3766"><a href="#L-3766"><span class="linenos">3766</span></a> +</span><span id="L-3767"><a href="#L-3767"><span class="linenos">3767</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-3768"><a href="#L-3768"><span class="linenos">3768</span></a> <span class="k">pass</span> +</span><span id="L-3769"><a href="#L-3769"><span class="linenos">3769</span></a> +</span><span id="L-3770"><a href="#L-3770"><span class="linenos">3770</span></a> +</span><span id="L-3771"><a href="#L-3771"><span class="linenos">3771</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-3772"><a href="#L-3772"><span class="linenos">3772</span></a> <span class="k">pass</span> +</span><span id="L-3773"><a href="#L-3773"><span class="linenos">3773</span></a> +</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 class="c1"># Functions</span> +</span><span id="L-3776"><a href="#L-3776"><span class="linenos">3776</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-3777"><a href="#L-3777"><span class="linenos">3777</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-3778"><a href="#L-3778"><span class="linenos">3778</span></a><span class="sd"> The base class for all function expressions.</span> +</span><span id="L-3779"><a href="#L-3779"><span class="linenos">3779</span></a> +</span><span id="L-3780"><a href="#L-3780"><span class="linenos">3780</span></a><span class="sd"> Attributes:</span> +</span><span id="L-3781"><a href="#L-3781"><span class="linenos">3781</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-3782"><a href="#L-3782"><span class="linenos">3782</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-3783"><a href="#L-3783"><span class="linenos">3783</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-3784"><a href="#L-3784"><span class="linenos">3784</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-3785"><a href="#L-3785"><span class="linenos">3785</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-3786"><a href="#L-3786"><span class="linenos">3786</span></a><span class="sd"> name is set to the expression's class name transformed to snake case.</span> +</span><span id="L-3787"><a href="#L-3787"><span class="linenos">3787</span></a><span class="sd"> """</span> +</span><span id="L-3788"><a href="#L-3788"><span class="linenos">3788</span></a> +</span><span id="L-3789"><a href="#L-3789"><span class="linenos">3789</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">False</span> </span><span id="L-3790"><a href="#L-3790"><span class="linenos">3790</span></a> -</span><span id="L-3791"><a href="#L-3791"><span class="linenos">3791</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">False</span> -</span><span id="L-3792"><a href="#L-3792"><span class="linenos">3792</span></a> -</span><span id="L-3793"><a href="#L-3793"><span class="linenos">3793</span></a> <span class="nd">@classmethod</span> -</span><span id="L-3794"><a href="#L-3794"><span class="linenos">3794</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-3795"><a href="#L-3795"><span class="linenos">3795</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-3796"><a href="#L-3796"><span class="linenos">3796</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-3797"><a href="#L-3797"><span class="linenos">3797</span></a> <span class="c1"># If this function supports variable length argument treat the last argument as such.</span> -</span><span id="L-3798"><a href="#L-3798"><span class="linenos">3798</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-3799"><a href="#L-3799"><span class="linenos">3799</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-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 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-3802"><a href="#L-3802"><span class="linenos">3802</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-3803"><a href="#L-3803"><span class="linenos">3803</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-3804"><a href="#L-3804"><span class="linenos">3804</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-3791"><a href="#L-3791"><span class="linenos">3791</span></a> <span class="nd">@classmethod</span> +</span><span id="L-3792"><a href="#L-3792"><span class="linenos">3792</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-3793"><a href="#L-3793"><span class="linenos">3793</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-3794"><a href="#L-3794"><span class="linenos">3794</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-3795"><a href="#L-3795"><span class="linenos">3795</span></a> <span class="c1"># If this function supports variable length argument treat the last argument as such.</span> +</span><span id="L-3796"><a href="#L-3796"><span class="linenos">3796</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-3797"><a href="#L-3797"><span class="linenos">3797</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-3798"><a href="#L-3798"><span class="linenos">3798</span></a> +</span><span id="L-3799"><a href="#L-3799"><span class="linenos">3799</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-3800"><a href="#L-3800"><span class="linenos">3800</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-3801"><a href="#L-3801"><span class="linenos">3801</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-3802"><a href="#L-3802"><span class="linenos">3802</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-3803"><a href="#L-3803"><span class="linenos">3803</span></a> +</span><span id="L-3804"><a href="#L-3804"><span class="linenos">3804</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-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="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-3807"><a href="#L-3807"><span class="linenos">3807</span></a> -</span><span id="L-3808"><a href="#L-3808"><span class="linenos">3808</span></a> <span class="nd">@classmethod</span> -</span><span id="L-3809"><a href="#L-3809"><span class="linenos">3809</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-3810"><a href="#L-3810"><span class="linenos">3810</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-3811"><a href="#L-3811"><span class="linenos">3811</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span> -</span><span id="L-3812"><a href="#L-3812"><span class="linenos">3812</span></a> <span class="s2">"SQL name is only supported by concrete function implementations"</span> -</span><span id="L-3813"><a href="#L-3813"><span class="linenos">3813</span></a> <span class="p">)</span> -</span><span id="L-3814"><a href="#L-3814"><span class="linenos">3814</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-3815"><a href="#L-3815"><span class="linenos">3815</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-3816"><a href="#L-3816"><span class="linenos">3816</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-3817"><a href="#L-3817"><span class="linenos">3817</span></a> -</span><span id="L-3818"><a href="#L-3818"><span class="linenos">3818</span></a> <span class="nd">@classmethod</span> -</span><span id="L-3819"><a href="#L-3819"><span class="linenos">3819</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-3820"><a href="#L-3820"><span class="linenos">3820</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-3821"><a href="#L-3821"><span class="linenos">3821</span></a> -</span><span id="L-3822"><a href="#L-3822"><span class="linenos">3822</span></a> <span class="nd">@classmethod</span> -</span><span id="L-3823"><a href="#L-3823"><span class="linenos">3823</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-3824"><a href="#L-3824"><span class="linenos">3824</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-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><span id="L-3827"><a href="#L-3827"><span class="linenos">3827</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-3828"><a href="#L-3828"><span class="linenos">3828</span></a> <span class="k">pass</span> -</span><span id="L-3829"><a href="#L-3829"><span class="linenos">3829</span></a> -</span><span id="L-3830"><a href="#L-3830"><span class="linenos">3830</span></a> -</span><span id="L-3831"><a href="#L-3831"><span class="linenos">3831</span></a><span class="k">class</span> <span class="nc">ParameterizedAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3832"><a href="#L-3832"><span class="linenos">3832</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"params"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</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><span id="L-3835"><a href="#L-3835"><span class="linenos">3835</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-3836"><a href="#L-3836"><span class="linenos">3836</span></a> <span class="k">pass</span> -</span><span id="L-3837"><a href="#L-3837"><span class="linenos">3837</span></a> -</span><span id="L-3838"><a href="#L-3838"><span class="linenos">3838</span></a> -</span><span id="L-3839"><a href="#L-3839"><span class="linenos">3839</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-3840"><a href="#L-3840"><span class="linenos">3840</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3841"><a href="#L-3841"><span class="linenos">3841</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-3842"><a href="#L-3842"><span class="linenos">3842</span></a> -</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 class="c1"># https://docs.snowflake.com/en/sql-reference/functions/hll</span> -</span><span id="L-3845"><a href="#L-3845"><span class="linenos">3845</span></a><span class="c1"># https://docs.aws.amazon.com/redshift/latest/dg/r_HLL_function.html</span> -</span><span id="L-3846"><a href="#L-3846"><span class="linenos">3846</span></a><span class="k">class</span> <span class="nc">Hll</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3847"><a href="#L-3847"><span class="linenos">3847</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3848"><a href="#L-3848"><span class="linenos">3848</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-3849"><a href="#L-3849"><span class="linenos">3849</span></a> -</span><span id="L-3850"><a href="#L-3850"><span class="linenos">3850</span></a> -</span><span id="L-3851"><a href="#L-3851"><span class="linenos">3851</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-3852"><a href="#L-3852"><span class="linenos">3852</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3853"><a href="#L-3853"><span class="linenos">3853</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"APPROX_DISTINCT"</span><span class="p">,</span> <span class="s2">"APPROX_COUNT_DISTINCT"</span><span class="p">]</span> -</span><span id="L-3854"><a href="#L-3854"><span class="linenos">3854</span></a> -</span><span id="L-3855"><a href="#L-3855"><span class="linenos">3855</span></a> -</span><span id="L-3856"><a href="#L-3856"><span class="linenos">3856</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-3857"><a href="#L-3857"><span class="linenos">3857</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-3858"><a href="#L-3858"><span class="linenos">3858</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</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><span id="L-3861"><a href="#L-3861"><span class="linenos">3861</span></a><span class="c1"># https://docs.snowflake.com/en/sql-reference/functions/to_char</span> -</span><span id="L-3862"><a href="#L-3862"><span class="linenos">3862</span></a><span class="k">class</span> <span class="nc">ToChar</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3863"><a href="#L-3863"><span class="linenos">3863</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-3866"><a href="#L-3866"><span class="linenos">3866</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-3867"><a href="#L-3867"><span class="linenos">3867</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-3868"><a href="#L-3868"><span class="linenos">3868</span></a> -</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 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-3871"><a href="#L-3871"><span class="linenos">3871</span></a> <span class="k">pass</span> -</span><span id="L-3872"><a href="#L-3872"><span class="linenos">3872</span></a> -</span><span id="L-3873"><a href="#L-3873"><span class="linenos">3873</span></a> -</span><span id="L-3874"><a href="#L-3874"><span class="linenos">3874</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-3875"><a href="#L-3875"><span class="linenos">3875</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3876"><a href="#L-3876"><span class="linenos">3876</span></a> -</span><span id="L-3877"><a href="#L-3877"><span class="linenos">3877</span></a> -</span><span id="L-3878"><a href="#L-3878"><span class="linenos">3878</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-3879"><a href="#L-3879"><span class="linenos">3879</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-3882"><a href="#L-3882"><span class="linenos">3882</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-3883"><a href="#L-3883"><span class="linenos">3883</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3884"><a href="#L-3884"><span class="linenos">3884</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</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">class</span> <span class="nc">ArrayContains</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-3888"><a href="#L-3888"><span class="linenos">3888</span></a> <span class="k">pass</span> -</span><span id="L-3889"><a href="#L-3889"><span class="linenos">3889</span></a> -</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="k">class</span> <span class="nc">ArrayContained</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-3892"><a href="#L-3892"><span class="linenos">3892</span></a> <span class="k">pass</span> -</span><span id="L-3893"><a href="#L-3893"><span class="linenos">3893</span></a> -</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="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-3896"><a href="#L-3896"><span class="linenos">3896</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3897"><a href="#L-3897"><span class="linenos">3897</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-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><span id="L-3900"><a href="#L-3900"><span class="linenos">3900</span></a><span class="k">class</span> <span class="nc">ArrayJoin</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3901"><a href="#L-3901"><span class="linenos">3901</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">"null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</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><span id="L-3904"><a href="#L-3904"><span class="linenos">3904</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-3905"><a href="#L-3905"><span class="linenos">3905</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3906"><a href="#L-3906"><span class="linenos">3906</span></a> -</span><span id="L-3907"><a href="#L-3907"><span class="linenos">3907</span></a> -</span><span id="L-3908"><a href="#L-3908"><span class="linenos">3908</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-3909"><a href="#L-3909"><span class="linenos">3909</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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">class</span> <span class="nc">ArraySum</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3913"><a href="#L-3913"><span class="linenos">3913</span></a> <span class="k">pass</span> -</span><span id="L-3914"><a href="#L-3914"><span class="linenos">3914</span></a> -</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="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-3917"><a href="#L-3917"><span class="linenos">3917</span></a> <span class="k">pass</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><span id="L-3920"><a href="#L-3920"><span class="linenos">3920</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-3921"><a href="#L-3921"><span class="linenos">3921</span></a> <span class="k">pass</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><span id="L-3924"><a href="#L-3924"><span class="linenos">3924</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-3925"><a href="#L-3925"><span class="linenos">3925</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"having"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"max"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3926"><a href="#L-3926"><span class="linenos">3926</span></a> -</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 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-3929"><a href="#L-3929"><span class="linenos">3929</span></a> <span class="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-3930"><a href="#L-3930"><span class="linenos">3930</span></a> -</span><span id="L-3931"><a href="#L-3931"><span class="linenos">3931</span></a> <span class="k">def</span> <span class="nf">when</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condition</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">then</span><span class="p">:</span> <span class="n">ExpOrStr</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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Case</span><span class="p">:</span> -</span><span id="L-3932"><a href="#L-3932"><span class="linenos">3932</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-3933"><a href="#L-3933"><span class="linenos">3933</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> -</span><span id="L-3934"><a href="#L-3934"><span class="linenos">3934</span></a> <span class="s2">"ifs"</span><span class="p">,</span> -</span><span id="L-3935"><a href="#L-3935"><span class="linenos">3935</span></a> <span class="n">If</span><span class="p">(</span> -</span><span id="L-3936"><a href="#L-3936"><span class="linenos">3936</span></a> <span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">condition</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="L-3937"><a href="#L-3937"><span class="linenos">3937</span></a> <span class="n">true</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">then</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</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="p">),</span> -</span><span id="L-3939"><a href="#L-3939"><span class="linenos">3939</span></a> <span class="p">)</span> -</span><span id="L-3940"><a href="#L-3940"><span class="linenos">3940</span></a> <span class="k">return</span> <span class="n">instance</span> -</span><span id="L-3941"><a href="#L-3941"><span class="linenos">3941</span></a> -</span><span id="L-3942"><a href="#L-3942"><span class="linenos">3942</span></a> <span class="k">def</span> <span class="nf">else_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condition</span><span class="p">:</span> <span class="n">ExpOrStr</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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Case</span><span class="p">:</span> -</span><span id="L-3943"><a href="#L-3943"><span class="linenos">3943</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-3944"><a href="#L-3944"><span class="linenos">3944</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"default"</span><span class="p">,</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">condition</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> -</span><span id="L-3945"><a href="#L-3945"><span class="linenos">3945</span></a> <span class="k">return</span> <span class="n">instance</span> -</span><span id="L-3946"><a href="#L-3946"><span class="linenos">3946</span></a> -</span><span id="L-3947"><a href="#L-3947"><span class="linenos">3947</span></a> -</span><span id="L-3948"><a href="#L-3948"><span class="linenos">3948</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-3949"><a href="#L-3949"><span class="linenos">3949</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3950"><a href="#L-3950"><span class="linenos">3950</span></a> -</span><span id="L-3951"><a href="#L-3951"><span class="linenos">3951</span></a> <span class="nd">@property</span> -</span><span id="L-3952"><a href="#L-3952"><span class="linenos">3952</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-3953"><a href="#L-3953"><span class="linenos">3953</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-3954"><a href="#L-3954"><span class="linenos">3954</span></a> -</span><span id="L-3955"><a href="#L-3955"><span class="linenos">3955</span></a> <span class="nd">@property</span> -</span><span id="L-3956"><a href="#L-3956"><span class="linenos">3956</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 class="o">-></span> <span class="n">DataType</span><span class="p">:</span> -</span><span id="L-3957"><a href="#L-3957"><span class="linenos">3957</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-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="nd">@property</span> -</span><span id="L-3960"><a href="#L-3960"><span class="linenos">3960</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-3961"><a href="#L-3961"><span class="linenos">3961</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-3962"><a href="#L-3962"><span class="linenos">3962</span></a> -</span><span id="L-3963"><a href="#L-3963"><span class="linenos">3963</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="o">*</span><span class="n">dtypes</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="nb">bool</span><span class="p">:</span> -</span><span id="L-3964"><a href="#L-3964"><span class="linenos">3964</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="o">*</span><span class="n">dtypes</span><span class="p">)</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><span id="L-3967"><a href="#L-3967"><span class="linenos">3967</span></a><span class="k">class</span> <span class="nc">CastToStrType</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3968"><a href="#L-3968"><span class="linenos">3968</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-3971"><a href="#L-3971"><span class="linenos">3971</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-3972"><a href="#L-3972"><span class="linenos">3972</span></a> <span class="k">pass</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><span id="L-3975"><a href="#L-3975"><span class="linenos">3975</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-3976"><a href="#L-3976"><span class="linenos">3976</span></a> <span class="k">pass</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><span id="L-3979"><a href="#L-3979"><span class="linenos">3979</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-3980"><a href="#L-3980"><span class="linenos">3980</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3981"><a href="#L-3981"><span class="linenos">3981</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-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">class</span> <span class="nc">Coalesce</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3985"><a href="#L-3985"><span class="linenos">3985</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3986"><a href="#L-3986"><span class="linenos">3986</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-3987"><a href="#L-3987"><span class="linenos">3987</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"COALESCE"</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-3988"><a href="#L-3988"><span class="linenos">3988</span></a> -</span><span id="L-3989"><a href="#L-3989"><span class="linenos">3989</span></a> -</span><span id="L-3990"><a href="#L-3990"><span class="linenos">3990</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-3991"><a href="#L-3991"><span class="linenos">3991</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-3992"><a href="#L-3992"><span class="linenos">3992</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</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">class</span> <span class="nc">SafeConcat</span><span class="p">(</span><span class="n">Concat</span><span class="p">):</span> -</span><span id="L-3996"><a href="#L-3996"><span class="linenos">3996</span></a> <span class="k">pass</span> -</span><span id="L-3997"><a href="#L-3997"><span class="linenos">3997</span></a> -</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="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-4000"><a href="#L-4000"><span class="linenos">4000</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-4001"><a href="#L-4001"><span class="linenos">4001</span></a> -</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="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-4004"><a href="#L-4004"><span class="linenos">4004</span></a> <span class="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-4005"><a href="#L-4005"><span class="linenos">4005</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-4006"><a href="#L-4006"><span class="linenos">4006</span></a> -</span><span id="L-4007"><a href="#L-4007"><span class="linenos">4007</span></a> -</span><span id="L-4008"><a href="#L-4008"><span class="linenos">4008</span></a><span class="k">class</span> <span class="nc">CountIf</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-4009"><a href="#L-4009"><span class="linenos">4009</span></a> <span class="k">pass</span> -</span><span id="L-4010"><a href="#L-4010"><span class="linenos">4010</span></a> -</span><span id="L-4011"><a href="#L-4011"><span class="linenos">4011</span></a> -</span><span id="L-4012"><a href="#L-4012"><span class="linenos">4012</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-4013"><a href="#L-4013"><span class="linenos">4013</span></a> <span class="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-4014"><a href="#L-4014"><span class="linenos">4014</span></a> -</span><span id="L-4015"><a href="#L-4015"><span class="linenos">4015</span></a> -</span><span id="L-4016"><a href="#L-4016"><span class="linenos">4016</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-4017"><a href="#L-4017"><span class="linenos">4017</span></a> <span class="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-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">class</span> <span class="nc">CurrentTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4021"><a href="#L-4021"><span class="linenos">4021</span></a> <span class="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-4022"><a href="#L-4022"><span class="linenos">4022</span></a> -</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="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-4025"><a href="#L-4025"><span class="linenos">4025</span></a> <span class="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-4026"><a href="#L-4026"><span class="linenos">4026</span></a> -</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="k">class</span> <span class="nc">CurrentUser</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4029"><a href="#L-4029"><span class="linenos">4029</span></a> <span class="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-4030"><a href="#L-4030"><span class="linenos">4030</span></a> -</span><span id="L-4031"><a href="#L-4031"><span class="linenos">4031</span></a> -</span><span id="L-4032"><a href="#L-4032"><span class="linenos">4032</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-4033"><a href="#L-4033"><span class="linenos">4033</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4034"><a href="#L-4034"><span class="linenos">4034</span></a> -</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="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-4037"><a href="#L-4037"><span class="linenos">4037</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4038"><a href="#L-4038"><span class="linenos">4038</span></a> -</span><span id="L-4039"><a href="#L-4039"><span class="linenos">4039</span></a> -</span><span id="L-4040"><a href="#L-4040"><span class="linenos">4040</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-4041"><a href="#L-4041"><span class="linenos">4041</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DATEDIFF"</span><span class="p">,</span> <span class="s2">"DATE_DIFF"</span><span class="p">]</span> -</span><span id="L-4042"><a href="#L-4042"><span class="linenos">4042</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4043"><a href="#L-4043"><span class="linenos">4043</span></a> -</span><span id="L-4044"><a href="#L-4044"><span class="linenos">4044</span></a> -</span><span id="L-4045"><a href="#L-4045"><span class="linenos">4045</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-4046"><a href="#L-4046"><span class="linenos">4046</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-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><span id="L-4049"><a href="#L-4049"><span class="linenos">4049</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-4050"><a href="#L-4050"><span class="linenos">4050</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4053"><a href="#L-4053"><span class="linenos">4053</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-4054"><a href="#L-4054"><span class="linenos">4054</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4057"><a href="#L-4057"><span class="linenos">4057</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-4058"><a href="#L-4058"><span class="linenos">4058</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4059"><a href="#L-4059"><span class="linenos">4059</span></a> -</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="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-4062"><a href="#L-4062"><span class="linenos">4062</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4065"><a href="#L-4065"><span class="linenos">4065</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-4066"><a href="#L-4066"><span class="linenos">4066</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-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><span id="L-4069"><a href="#L-4069"><span class="linenos">4069</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-4070"><a href="#L-4070"><span class="linenos">4070</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-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><span id="L-4073"><a href="#L-4073"><span class="linenos">4073</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-4074"><a href="#L-4074"><span class="linenos">4074</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-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><span id="L-4077"><a href="#L-4077"><span class="linenos">4077</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-4078"><a href="#L-4078"><span class="linenos">4078</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-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><span id="L-4081"><a href="#L-4081"><span class="linenos">4081</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-4082"><a href="#L-4082"><span class="linenos">4082</span></a> <span class="k">pass</span> -</span><span id="L-4083"><a href="#L-4083"><span class="linenos">4083</span></a> -</span><span id="L-4084"><a href="#L-4084"><span class="linenos">4084</span></a> -</span><span id="L-4085"><a href="#L-4085"><span class="linenos">4085</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-4086"><a href="#L-4086"><span class="linenos">4086</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4087"><a href="#L-4087"><span class="linenos">4087</span></a> -</span><span id="L-4088"><a href="#L-4088"><span class="linenos">4088</span></a> -</span><span id="L-4089"><a href="#L-4089"><span class="linenos">4089</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-4090"><a href="#L-4090"><span class="linenos">4090</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4091"><a href="#L-4091"><span class="linenos">4091</span></a> -</span><span id="L-4092"><a href="#L-4092"><span class="linenos">4092</span></a> -</span><span id="L-4093"><a href="#L-4093"><span class="linenos">4093</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-4094"><a href="#L-4094"><span class="linenos">4094</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4095"><a href="#L-4095"><span class="linenos">4095</span></a> -</span><span id="L-4096"><a href="#L-4096"><span class="linenos">4096</span></a> -</span><span id="L-4097"><a href="#L-4097"><span class="linenos">4097</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-4098"><a href="#L-4098"><span class="linenos">4098</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4099"><a href="#L-4099"><span class="linenos">4099</span></a> -</span><span id="L-4100"><a href="#L-4100"><span class="linenos">4100</span></a> -</span><span id="L-4101"><a href="#L-4101"><span class="linenos">4101</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-4102"><a href="#L-4102"><span class="linenos">4102</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4103"><a href="#L-4103"><span class="linenos">4103</span></a> -</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">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-4106"><a href="#L-4106"><span class="linenos">4106</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4107"><a href="#L-4107"><span class="linenos">4107</span></a> -</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="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-4110"><a href="#L-4110"><span class="linenos">4110</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4111"><a href="#L-4111"><span class="linenos">4111</span></a> -</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="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-4114"><a href="#L-4114"><span class="linenos">4114</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4115"><a href="#L-4115"><span class="linenos">4115</span></a> -</span><span id="L-4116"><a href="#L-4116"><span class="linenos">4116</span></a> -</span><span id="L-4117"><a href="#L-4117"><span class="linenos">4117</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-4118"><a href="#L-4118"><span class="linenos">4118</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4119"><a href="#L-4119"><span class="linenos">4119</span></a> -</span><span id="L-4120"><a href="#L-4120"><span class="linenos">4120</span></a> -</span><span id="L-4121"><a href="#L-4121"><span class="linenos">4121</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-4122"><a href="#L-4122"><span class="linenos">4122</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-4123"><a href="#L-4123"><span class="linenos">4123</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-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><span id="L-4126"><a href="#L-4126"><span class="linenos">4126</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-4127"><a href="#L-4127"><span class="linenos">4127</span></a> <span class="k">pass</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><span id="L-4130"><a href="#L-4130"><span class="linenos">4130</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-4131"><a href="#L-4131"><span class="linenos">4131</span></a> <span class="k">pass</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><span id="L-4134"><a href="#L-4134"><span class="linenos">4134</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-4135"><a href="#L-4135"><span class="linenos">4135</span></a> <span class="k">pass</span> -</span><span id="L-4136"><a href="#L-4136"><span class="linenos">4136</span></a> -</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="k">class</span> <span class="nc">Date</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4139"><a href="#L-4139"><span class="linenos">4139</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-4140"><a href="#L-4140"><span class="linenos">4140</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-4141"><a href="#L-4141"><span class="linenos">4141</span></a> -</span><span id="L-4142"><a href="#L-4142"><span class="linenos">4142</span></a> -</span><span id="L-4143"><a href="#L-4143"><span class="linenos">4143</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-4144"><a href="#L-4144"><span class="linenos">4144</span></a> <span class="k">pass</span> -</span><span id="L-4145"><a href="#L-4145"><span class="linenos">4145</span></a> -</span><span id="L-4146"><a href="#L-4146"><span class="linenos">4146</span></a> -</span><span id="L-4147"><a href="#L-4147"><span class="linenos">4147</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-4148"><a href="#L-4148"><span class="linenos">4148</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4149"><a href="#L-4149"><span class="linenos">4149</span></a> -</span><span id="L-4150"><a href="#L-4150"><span class="linenos">4150</span></a> -</span><span id="L-4151"><a href="#L-4151"><span class="linenos">4151</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-4152"><a href="#L-4152"><span class="linenos">4152</span></a> <span class="k">pass</span> -</span><span id="L-4153"><a href="#L-4153"><span class="linenos">4153</span></a> -</span><span id="L-4154"><a href="#L-4154"><span class="linenos">4154</span></a> -</span><span id="L-4155"><a href="#L-4155"><span class="linenos">4155</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-4156"><a href="#L-4156"><span class="linenos">4156</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4157"><a href="#L-4157"><span class="linenos">4157</span></a> -</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="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-4160"><a href="#L-4160"><span class="linenos">4160</span></a> <span class="k">pass</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">class</span> <span class="nc">Explode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4164"><a href="#L-4164"><span class="linenos">4164</span></a> <span class="k">pass</span> -</span><span id="L-4165"><a href="#L-4165"><span class="linenos">4165</span></a> -</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="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-4168"><a href="#L-4168"><span class="linenos">4168</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4171"><a href="#L-4171"><span class="linenos">4171</span></a><span class="k">class</span> <span class="nc">FromBase64</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4172"><a href="#L-4172"><span class="linenos">4172</span></a> <span class="k">pass</span> -</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><span id="L-4175"><a href="#L-4175"><span class="linenos">4175</span></a><span class="k">class</span> <span class="nc">ToBase64</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4176"><a href="#L-4176"><span class="linenos">4176</span></a> <span class="k">pass</span> -</span><span id="L-4177"><a href="#L-4177"><span class="linenos">4177</span></a> -</span><span id="L-4178"><a href="#L-4178"><span class="linenos">4178</span></a> -</span><span id="L-4179"><a href="#L-4179"><span class="linenos">4179</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-4180"><a href="#L-4180"><span class="linenos">4180</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4181"><a href="#L-4181"><span class="linenos">4181</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</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><span id="L-4184"><a href="#L-4184"><span class="linenos">4184</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-4185"><a href="#L-4185"><span class="linenos">4185</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4188"><a href="#L-4188"><span class="linenos">4188</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-4189"><a href="#L-4189"><span class="linenos">4189</span></a> <span class="k">pass</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><span id="L-4192"><a href="#L-4192"><span class="linenos">4192</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-4193"><a href="#L-4193"><span class="linenos">4193</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4194"><a href="#L-4194"><span class="linenos">4194</span></a> -</span><span id="L-4195"><a href="#L-4195"><span class="linenos">4195</span></a> -</span><span id="L-4196"><a href="#L-4196"><span class="linenos">4196</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-4197"><a href="#L-4197"><span class="linenos">4197</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4198"><a href="#L-4198"><span class="linenos">4198</span></a> -</span><span id="L-4199"><a href="#L-4199"><span class="linenos">4199</span></a> -</span><span id="L-4200"><a href="#L-4200"><span class="linenos">4200</span></a><span class="k">class</span> <span class="nc">JSONKeyValue</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-4201"><a href="#L-4201"><span class="linenos">4201</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4204"><a href="#L-4204"><span class="linenos">4204</span></a><span class="k">class</span> <span class="nc">JSONObject</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4205"><a href="#L-4205"><span class="linenos">4205</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-4206"><a href="#L-4206"><span class="linenos">4206</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4207"><a href="#L-4207"><span class="linenos">4207</span></a> <span class="s2">"null_handling"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4208"><a href="#L-4208"><span class="linenos">4208</span></a> <span class="s2">"unique_keys"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4209"><a href="#L-4209"><span class="linenos">4209</span></a> <span class="s2">"return_type"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4210"><a href="#L-4210"><span class="linenos">4210</span></a> <span class="s2">"format_json"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4211"><a href="#L-4211"><span class="linenos">4211</span></a> <span class="s2">"encoding"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4212"><a href="#L-4212"><span class="linenos">4212</span></a> <span class="p">}</span> -</span><span id="L-4213"><a href="#L-4213"><span class="linenos">4213</span></a> -</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 class="k">class</span> <span class="nc">OpenJSONColumnDef</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-4216"><a href="#L-4216"><span class="linenos">4216</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">True</span><span class="p">,</span> <span class="s2">"path"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"as_json"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-4217"><a href="#L-4217"><span class="linenos">4217</span></a> -</span><span id="L-4218"><a href="#L-4218"><span class="linenos">4218</span></a> -</span><span id="L-4219"><a href="#L-4219"><span class="linenos">4219</span></a><span class="k">class</span> <span class="nc">OpenJSON</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4220"><a href="#L-4220"><span class="linenos">4220</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"path"</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-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><span id="L-4223"><a href="#L-4223"><span class="linenos">4223</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-4224"><a href="#L-4224"><span class="linenos">4224</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-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><span id="L-4227"><a href="#L-4227"><span class="linenos">4227</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-4228"><a href="#L-4228"><span class="linenos">4228</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-4229"><a href="#L-4229"><span class="linenos">4229</span></a> -</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 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-4232"><a href="#L-4232"><span class="linenos">4232</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-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="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-4236"><a href="#L-4236"><span class="linenos">4236</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-4237"><a href="#L-4237"><span class="linenos">4237</span></a> -</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 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-4240"><a href="#L-4240"><span class="linenos">4240</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-4241"><a href="#L-4241"><span class="linenos">4241</span></a> -</span><span id="L-4242"><a href="#L-4242"><span class="linenos">4242</span></a> -</span><span id="L-4243"><a href="#L-4243"><span class="linenos">4243</span></a><span class="k">class</span> <span class="nc">JSONFormat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4244"><a href="#L-4244"><span class="linenos">4244</span></a> <span class="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">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-4245"><a href="#L-4245"><span class="linenos">4245</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_FORMAT"</span><span class="p">]</span> -</span><span id="L-4246"><a href="#L-4246"><span class="linenos">4246</span></a> -</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="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-4249"><a href="#L-4249"><span class="linenos">4249</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-4250"><a href="#L-4250"><span class="linenos">4250</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</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><span id="L-4253"><a href="#L-4253"><span class="linenos">4253</span></a><span class="k">class</span> <span class="nc">Left</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4254"><a href="#L-4254"><span class="linenos">4254</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3806"><a href="#L-3806"><span class="linenos">3806</span></a> <span class="nd">@classmethod</span> +</span><span id="L-3807"><a href="#L-3807"><span class="linenos">3807</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-3808"><a href="#L-3808"><span class="linenos">3808</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-3809"><a href="#L-3809"><span class="linenos">3809</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span> +</span><span id="L-3810"><a href="#L-3810"><span class="linenos">3810</span></a> <span class="s2">"SQL name is only supported by concrete function implementations"</span> +</span><span id="L-3811"><a href="#L-3811"><span class="linenos">3811</span></a> <span class="p">)</span> +</span><span id="L-3812"><a href="#L-3812"><span class="linenos">3812</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-3813"><a href="#L-3813"><span class="linenos">3813</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-3814"><a href="#L-3814"><span class="linenos">3814</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-3815"><a href="#L-3815"><span class="linenos">3815</span></a> +</span><span id="L-3816"><a href="#L-3816"><span class="linenos">3816</span></a> <span class="nd">@classmethod</span> +</span><span id="L-3817"><a href="#L-3817"><span class="linenos">3817</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-3818"><a href="#L-3818"><span class="linenos">3818</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-3819"><a href="#L-3819"><span class="linenos">3819</span></a> +</span><span id="L-3820"><a href="#L-3820"><span class="linenos">3820</span></a> <span class="nd">@classmethod</span> +</span><span id="L-3821"><a href="#L-3821"><span class="linenos">3821</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-3822"><a href="#L-3822"><span class="linenos">3822</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-3823"><a href="#L-3823"><span class="linenos">3823</span></a> +</span><span id="L-3824"><a href="#L-3824"><span class="linenos">3824</span></a> +</span><span id="L-3825"><a href="#L-3825"><span class="linenos">3825</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-3826"><a href="#L-3826"><span class="linenos">3826</span></a> <span class="k">pass</span> +</span><span id="L-3827"><a href="#L-3827"><span class="linenos">3827</span></a> +</span><span id="L-3828"><a href="#L-3828"><span class="linenos">3828</span></a> +</span><span id="L-3829"><a href="#L-3829"><span class="linenos">3829</span></a><span class="k">class</span> <span class="nc">ParameterizedAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3830"><a href="#L-3830"><span class="linenos">3830</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"params"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3831"><a href="#L-3831"><span class="linenos">3831</span></a> +</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 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-3834"><a href="#L-3834"><span class="linenos">3834</span></a> <span class="k">pass</span> +</span><span id="L-3835"><a href="#L-3835"><span class="linenos">3835</span></a> +</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="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-3838"><a href="#L-3838"><span class="linenos">3838</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3839"><a href="#L-3839"><span class="linenos">3839</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</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><span id="L-3842"><a href="#L-3842"><span class="linenos">3842</span></a><span class="c1"># https://docs.snowflake.com/en/sql-reference/functions/hll</span> +</span><span id="L-3843"><a href="#L-3843"><span class="linenos">3843</span></a><span class="c1"># https://docs.aws.amazon.com/redshift/latest/dg/r_HLL_function.html</span> +</span><span id="L-3844"><a href="#L-3844"><span class="linenos">3844</span></a><span class="k">class</span> <span class="nc">Hll</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3845"><a href="#L-3845"><span class="linenos">3845</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3846"><a href="#L-3846"><span class="linenos">3846</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3847"><a href="#L-3847"><span class="linenos">3847</span></a> +</span><span id="L-3848"><a href="#L-3848"><span class="linenos">3848</span></a> +</span><span id="L-3849"><a href="#L-3849"><span class="linenos">3849</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-3850"><a href="#L-3850"><span class="linenos">3850</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3851"><a href="#L-3851"><span class="linenos">3851</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"APPROX_DISTINCT"</span><span class="p">,</span> <span class="s2">"APPROX_COUNT_DISTINCT"</span><span class="p">]</span> +</span><span id="L-3852"><a href="#L-3852"><span class="linenos">3852</span></a> +</span><span id="L-3853"><a href="#L-3853"><span class="linenos">3853</span></a> +</span><span id="L-3854"><a href="#L-3854"><span class="linenos">3854</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-3855"><a href="#L-3855"><span class="linenos">3855</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-3856"><a href="#L-3856"><span class="linenos">3856</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3857"><a href="#L-3857"><span class="linenos">3857</span></a> +</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="c1"># https://docs.snowflake.com/en/sql-reference/functions/to_char</span> +</span><span id="L-3860"><a href="#L-3860"><span class="linenos">3860</span></a><span class="k">class</span> <span class="nc">ToChar</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3861"><a href="#L-3861"><span class="linenos">3861</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3862"><a href="#L-3862"><span class="linenos">3862</span></a> +</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="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-3865"><a href="#L-3865"><span class="linenos">3865</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-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><span id="L-3868"><a href="#L-3868"><span class="linenos">3868</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-3869"><a href="#L-3869"><span class="linenos">3869</span></a> <span class="k">pass</span> +</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><span id="L-3872"><a href="#L-3872"><span class="linenos">3872</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-3873"><a href="#L-3873"><span class="linenos">3873</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3874"><a href="#L-3874"><span class="linenos">3874</span></a> +</span><span id="L-3875"><a href="#L-3875"><span class="linenos">3875</span></a> +</span><span id="L-3876"><a href="#L-3876"><span class="linenos">3876</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-3877"><a href="#L-3877"><span class="linenos">3877</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3878"><a href="#L-3878"><span class="linenos">3878</span></a> +</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 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-3881"><a href="#L-3881"><span class="linenos">3881</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3882"><a href="#L-3882"><span class="linenos">3882</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</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><span id="L-3885"><a href="#L-3885"><span class="linenos">3885</span></a><span class="k">class</span> <span class="nc">ArrayContains</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-3886"><a href="#L-3886"><span class="linenos">3886</span></a> <span class="k">pass</span> +</span><span id="L-3887"><a href="#L-3887"><span class="linenos">3887</span></a> +</span><span id="L-3888"><a href="#L-3888"><span class="linenos">3888</span></a> +</span><span id="L-3889"><a href="#L-3889"><span class="linenos">3889</span></a><span class="k">class</span> <span class="nc">ArrayContained</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-3890"><a href="#L-3890"><span class="linenos">3890</span></a> <span class="k">pass</span> +</span><span id="L-3891"><a href="#L-3891"><span class="linenos">3891</span></a> +</span><span id="L-3892"><a href="#L-3892"><span class="linenos">3892</span></a> +</span><span id="L-3893"><a href="#L-3893"><span class="linenos">3893</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-3894"><a href="#L-3894"><span class="linenos">3894</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3895"><a href="#L-3895"><span class="linenos">3895</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-3896"><a href="#L-3896"><span class="linenos">3896</span></a> +</span><span id="L-3897"><a href="#L-3897"><span class="linenos">3897</span></a> +</span><span id="L-3898"><a href="#L-3898"><span class="linenos">3898</span></a><span class="k">class</span> <span class="nc">ArrayJoin</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3899"><a href="#L-3899"><span class="linenos">3899</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">"null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3900"><a href="#L-3900"><span class="linenos">3900</span></a> +</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 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-3903"><a href="#L-3903"><span class="linenos">3903</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3904"><a href="#L-3904"><span class="linenos">3904</span></a> +</span><span id="L-3905"><a href="#L-3905"><span class="linenos">3905</span></a> +</span><span id="L-3906"><a href="#L-3906"><span class="linenos">3906</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-3907"><a href="#L-3907"><span class="linenos">3907</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-3910"><a href="#L-3910"><span class="linenos">3910</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-3911"><a href="#L-3911"><span class="linenos">3911</span></a> <span class="k">pass</span> +</span><span id="L-3912"><a href="#L-3912"><span class="linenos">3912</span></a> +</span><span id="L-3913"><a href="#L-3913"><span class="linenos">3913</span></a> +</span><span id="L-3914"><a href="#L-3914"><span class="linenos">3914</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-3915"><a href="#L-3915"><span class="linenos">3915</span></a> <span class="k">pass</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><span id="L-3918"><a href="#L-3918"><span class="linenos">3918</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-3919"><a href="#L-3919"><span class="linenos">3919</span></a> <span class="k">pass</span> +</span><span id="L-3920"><a href="#L-3920"><span class="linenos">3920</span></a> +</span><span id="L-3921"><a href="#L-3921"><span class="linenos">3921</span></a> +</span><span id="L-3922"><a href="#L-3922"><span class="linenos">3922</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-3923"><a href="#L-3923"><span class="linenos">3923</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"having"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"max"</span><span class="p">:</span> <span class="kc">False</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><span id="L-3926"><a href="#L-3926"><span class="linenos">3926</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-3927"><a href="#L-3927"><span class="linenos">3927</span></a> <span class="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-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">when</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condition</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">then</span><span class="p">:</span> <span class="n">ExpOrStr</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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Case</span><span class="p">:</span> +</span><span id="L-3930"><a href="#L-3930"><span class="linenos">3930</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-3931"><a href="#L-3931"><span class="linenos">3931</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> +</span><span id="L-3932"><a href="#L-3932"><span class="linenos">3932</span></a> <span class="s2">"ifs"</span><span class="p">,</span> +</span><span id="L-3933"><a href="#L-3933"><span class="linenos">3933</span></a> <span class="n">If</span><span class="p">(</span> +</span><span id="L-3934"><a href="#L-3934"><span class="linenos">3934</span></a> <span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">condition</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="L-3935"><a href="#L-3935"><span class="linenos">3935</span></a> <span class="n">true</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">then</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="L-3936"><a href="#L-3936"><span class="linenos">3936</span></a> <span class="p">),</span> +</span><span id="L-3937"><a href="#L-3937"><span class="linenos">3937</span></a> <span class="p">)</span> +</span><span id="L-3938"><a href="#L-3938"><span class="linenos">3938</span></a> <span class="k">return</span> <span class="n">instance</span> +</span><span id="L-3939"><a href="#L-3939"><span class="linenos">3939</span></a> +</span><span id="L-3940"><a href="#L-3940"><span class="linenos">3940</span></a> <span class="k">def</span> <span class="nf">else_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condition</span><span class="p">:</span> <span class="n">ExpOrStr</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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Case</span><span class="p">:</span> +</span><span id="L-3941"><a href="#L-3941"><span class="linenos">3941</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-3942"><a href="#L-3942"><span class="linenos">3942</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"default"</span><span class="p">,</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">condition</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> +</span><span id="L-3943"><a href="#L-3943"><span class="linenos">3943</span></a> <span class="k">return</span> <span class="n">instance</span> +</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><span id="L-3946"><a href="#L-3946"><span class="linenos">3946</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-3947"><a href="#L-3947"><span class="linenos">3947</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</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="nd">@property</span> +</span><span id="L-3950"><a href="#L-3950"><span class="linenos">3950</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-3951"><a href="#L-3951"><span class="linenos">3951</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-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="nd">@property</span> +</span><span id="L-3954"><a href="#L-3954"><span class="linenos">3954</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 class="o">-></span> <span class="n">DataType</span><span class="p">:</span> +</span><span id="L-3955"><a href="#L-3955"><span class="linenos">3955</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-3956"><a href="#L-3956"><span class="linenos">3956</span></a> +</span><span id="L-3957"><a href="#L-3957"><span class="linenos">3957</span></a> <span class="nd">@property</span> +</span><span id="L-3958"><a href="#L-3958"><span class="linenos">3958</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-3959"><a href="#L-3959"><span class="linenos">3959</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-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 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="o">*</span><span class="n">dtypes</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="nb">bool</span><span class="p">:</span> +</span><span id="L-3962"><a href="#L-3962"><span class="linenos">3962</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="o">*</span><span class="n">dtypes</span><span class="p">)</span> +</span><span id="L-3963"><a href="#L-3963"><span class="linenos">3963</span></a> +</span><span id="L-3964"><a href="#L-3964"><span class="linenos">3964</span></a> +</span><span id="L-3965"><a href="#L-3965"><span class="linenos">3965</span></a><span class="k">class</span> <span class="nc">CastToStrType</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3966"><a href="#L-3966"><span class="linenos">3966</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3967"><a href="#L-3967"><span class="linenos">3967</span></a> +</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 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-3970"><a href="#L-3970"><span class="linenos">3970</span></a> <span class="k">pass</span> +</span><span id="L-3971"><a href="#L-3971"><span class="linenos">3971</span></a> +</span><span id="L-3972"><a href="#L-3972"><span class="linenos">3972</span></a> +</span><span id="L-3973"><a href="#L-3973"><span class="linenos">3973</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-3974"><a href="#L-3974"><span class="linenos">3974</span></a> <span class="k">pass</span> +</span><span id="L-3975"><a href="#L-3975"><span class="linenos">3975</span></a> +</span><span id="L-3976"><a href="#L-3976"><span class="linenos">3976</span></a> +</span><span id="L-3977"><a href="#L-3977"><span class="linenos">3977</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-3978"><a href="#L-3978"><span class="linenos">3978</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3979"><a href="#L-3979"><span class="linenos">3979</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-3980"><a href="#L-3980"><span class="linenos">3980</span></a> +</span><span id="L-3981"><a href="#L-3981"><span class="linenos">3981</span></a> +</span><span id="L-3982"><a href="#L-3982"><span class="linenos">3982</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-3983"><a href="#L-3983"><span class="linenos">3983</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3984"><a href="#L-3984"><span class="linenos">3984</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3985"><a href="#L-3985"><span class="linenos">3985</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"COALESCE"</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-3986"><a href="#L-3986"><span class="linenos">3986</span></a> +</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="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-3989"><a href="#L-3989"><span class="linenos">3989</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-3990"><a href="#L-3990"><span class="linenos">3990</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</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><span id="L-3993"><a href="#L-3993"><span class="linenos">3993</span></a><span class="k">class</span> <span class="nc">SafeConcat</span><span class="p">(</span><span class="n">Concat</span><span class="p">):</span> +</span><span id="L-3994"><a href="#L-3994"><span class="linenos">3994</span></a> <span class="k">pass</span> +</span><span id="L-3995"><a href="#L-3995"><span class="linenos">3995</span></a> +</span><span id="L-3996"><a href="#L-3996"><span class="linenos">3996</span></a> +</span><span id="L-3997"><a href="#L-3997"><span class="linenos">3997</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-3998"><a href="#L-3998"><span class="linenos">3998</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-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><span id="L-4001"><a href="#L-4001"><span class="linenos">4001</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-4002"><a href="#L-4002"><span class="linenos">4002</span></a> <span class="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-4003"><a href="#L-4003"><span class="linenos">4003</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</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">class</span> <span class="nc">CountIf</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-4007"><a href="#L-4007"><span class="linenos">4007</span></a> <span class="k">pass</span> +</span><span id="L-4008"><a href="#L-4008"><span class="linenos">4008</span></a> +</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="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-4011"><a href="#L-4011"><span class="linenos">4011</span></a> <span class="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-4012"><a href="#L-4012"><span class="linenos">4012</span></a> +</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="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-4015"><a href="#L-4015"><span class="linenos">4015</span></a> <span class="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-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><span id="L-4018"><a href="#L-4018"><span class="linenos">4018</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-4019"><a href="#L-4019"><span class="linenos">4019</span></a> <span class="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-4020"><a href="#L-4020"><span class="linenos">4020</span></a> +</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="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-4023"><a href="#L-4023"><span class="linenos">4023</span></a> <span class="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-4024"><a href="#L-4024"><span class="linenos">4024</span></a> +</span><span id="L-4025"><a href="#L-4025"><span class="linenos">4025</span></a> +</span><span id="L-4026"><a href="#L-4026"><span class="linenos">4026</span></a><span class="k">class</span> <span class="nc">CurrentUser</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4027"><a href="#L-4027"><span class="linenos">4027</span></a> <span class="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-4028"><a href="#L-4028"><span class="linenos">4028</span></a> +</span><span id="L-4029"><a href="#L-4029"><span class="linenos">4029</span></a> +</span><span id="L-4030"><a href="#L-4030"><span class="linenos">4030</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-4031"><a href="#L-4031"><span class="linenos">4031</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4032"><a href="#L-4032"><span class="linenos">4032</span></a> +</span><span id="L-4033"><a href="#L-4033"><span class="linenos">4033</span></a> +</span><span id="L-4034"><a href="#L-4034"><span class="linenos">4034</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-4035"><a href="#L-4035"><span class="linenos">4035</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4036"><a href="#L-4036"><span class="linenos">4036</span></a> +</span><span id="L-4037"><a href="#L-4037"><span class="linenos">4037</span></a> +</span><span id="L-4038"><a href="#L-4038"><span class="linenos">4038</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-4039"><a href="#L-4039"><span class="linenos">4039</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DATEDIFF"</span><span class="p">,</span> <span class="s2">"DATE_DIFF"</span><span class="p">]</span> +</span><span id="L-4040"><a href="#L-4040"><span class="linenos">4040</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4043"><a href="#L-4043"><span class="linenos">4043</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-4044"><a href="#L-4044"><span class="linenos">4044</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-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><span id="L-4047"><a href="#L-4047"><span class="linenos">4047</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-4048"><a href="#L-4048"><span class="linenos">4048</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4051"><a href="#L-4051"><span class="linenos">4051</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-4052"><a href="#L-4052"><span class="linenos">4052</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4053"><a href="#L-4053"><span class="linenos">4053</span></a> +</span><span id="L-4054"><a href="#L-4054"><span class="linenos">4054</span></a> +</span><span id="L-4055"><a href="#L-4055"><span class="linenos">4055</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-4056"><a href="#L-4056"><span class="linenos">4056</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4059"><a href="#L-4059"><span class="linenos">4059</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-4060"><a href="#L-4060"><span class="linenos">4060</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4061"><a href="#L-4061"><span class="linenos">4061</span></a> +</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 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-4064"><a href="#L-4064"><span class="linenos">4064</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-4065"><a href="#L-4065"><span class="linenos">4065</span></a> +</span><span id="L-4066"><a href="#L-4066"><span class="linenos">4066</span></a> +</span><span id="L-4067"><a href="#L-4067"><span class="linenos">4067</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-4068"><a href="#L-4068"><span class="linenos">4068</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-4069"><a href="#L-4069"><span class="linenos">4069</span></a> +</span><span id="L-4070"><a href="#L-4070"><span class="linenos">4070</span></a> +</span><span id="L-4071"><a href="#L-4071"><span class="linenos">4071</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-4072"><a href="#L-4072"><span class="linenos">4072</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-4073"><a href="#L-4073"><span class="linenos">4073</span></a> +</span><span id="L-4074"><a href="#L-4074"><span class="linenos">4074</span></a> +</span><span id="L-4075"><a href="#L-4075"><span class="linenos">4075</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-4076"><a href="#L-4076"><span class="linenos">4076</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-4077"><a href="#L-4077"><span class="linenos">4077</span></a> +</span><span id="L-4078"><a href="#L-4078"><span class="linenos">4078</span></a> +</span><span id="L-4079"><a href="#L-4079"><span class="linenos">4079</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-4080"><a href="#L-4080"><span class="linenos">4080</span></a> <span class="k">pass</span> +</span><span id="L-4081"><a href="#L-4081"><span class="linenos">4081</span></a> +</span><span id="L-4082"><a href="#L-4082"><span class="linenos">4082</span></a> +</span><span id="L-4083"><a href="#L-4083"><span class="linenos">4083</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-4084"><a href="#L-4084"><span class="linenos">4084</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4087"><a href="#L-4087"><span class="linenos">4087</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-4088"><a href="#L-4088"><span class="linenos">4088</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4089"><a href="#L-4089"><span class="linenos">4089</span></a> +</span><span id="L-4090"><a href="#L-4090"><span class="linenos">4090</span></a> +</span><span id="L-4091"><a href="#L-4091"><span class="linenos">4091</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-4092"><a href="#L-4092"><span class="linenos">4092</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4095"><a href="#L-4095"><span class="linenos">4095</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-4096"><a href="#L-4096"><span class="linenos">4096</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4097"><a href="#L-4097"><span class="linenos">4097</span></a> +</span><span id="L-4098"><a href="#L-4098"><span class="linenos">4098</span></a> +</span><span id="L-4099"><a href="#L-4099"><span class="linenos">4099</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-4100"><a href="#L-4100"><span class="linenos">4100</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4101"><a href="#L-4101"><span class="linenos">4101</span></a> +</span><span id="L-4102"><a href="#L-4102"><span class="linenos">4102</span></a> +</span><span id="L-4103"><a href="#L-4103"><span class="linenos">4103</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-4104"><a href="#L-4104"><span class="linenos">4104</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4107"><a href="#L-4107"><span class="linenos">4107</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-4108"><a href="#L-4108"><span class="linenos">4108</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4111"><a href="#L-4111"><span class="linenos">4111</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-4112"><a href="#L-4112"><span class="linenos">4112</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4115"><a href="#L-4115"><span class="linenos">4115</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-4116"><a href="#L-4116"><span class="linenos">4116</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4117"><a href="#L-4117"><span class="linenos">4117</span></a> +</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="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-4120"><a href="#L-4120"><span class="linenos">4120</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-4121"><a href="#L-4121"><span class="linenos">4121</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-4122"><a href="#L-4122"><span class="linenos">4122</span></a> +</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 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-4125"><a href="#L-4125"><span class="linenos">4125</span></a> <span class="k">pass</span> +</span><span id="L-4126"><a href="#L-4126"><span class="linenos">4126</span></a> +</span><span id="L-4127"><a href="#L-4127"><span class="linenos">4127</span></a> +</span><span id="L-4128"><a href="#L-4128"><span class="linenos">4128</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-4129"><a href="#L-4129"><span class="linenos">4129</span></a> <span class="k">pass</span> +</span><span id="L-4130"><a href="#L-4130"><span class="linenos">4130</span></a> +</span><span id="L-4131"><a href="#L-4131"><span class="linenos">4131</span></a> +</span><span id="L-4132"><a href="#L-4132"><span class="linenos">4132</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-4133"><a href="#L-4133"><span class="linenos">4133</span></a> <span class="k">pass</span> +</span><span id="L-4134"><a href="#L-4134"><span class="linenos">4134</span></a> +</span><span id="L-4135"><a href="#L-4135"><span class="linenos">4135</span></a> +</span><span id="L-4136"><a href="#L-4136"><span class="linenos">4136</span></a><span class="k">class</span> <span class="nc">Date</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4137"><a href="#L-4137"><span class="linenos">4137</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-4138"><a href="#L-4138"><span class="linenos">4138</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-4139"><a href="#L-4139"><span class="linenos">4139</span></a> +</span><span id="L-4140"><a href="#L-4140"><span class="linenos">4140</span></a> +</span><span id="L-4141"><a href="#L-4141"><span class="linenos">4141</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-4142"><a href="#L-4142"><span class="linenos">4142</span></a> <span class="k">pass</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">class</span> <span class="nc">Decode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4146"><a href="#L-4146"><span class="linenos">4146</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4147"><a href="#L-4147"><span class="linenos">4147</span></a> +</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="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-4150"><a href="#L-4150"><span class="linenos">4150</span></a> <span class="k">pass</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><span id="L-4153"><a href="#L-4153"><span class="linenos">4153</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-4154"><a href="#L-4154"><span class="linenos">4154</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4155"><a href="#L-4155"><span class="linenos">4155</span></a> +</span><span id="L-4156"><a href="#L-4156"><span class="linenos">4156</span></a> +</span><span id="L-4157"><a href="#L-4157"><span class="linenos">4157</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-4158"><a href="#L-4158"><span class="linenos">4158</span></a> <span class="k">pass</span> +</span><span id="L-4159"><a href="#L-4159"><span class="linenos">4159</span></a> +</span><span id="L-4160"><a href="#L-4160"><span class="linenos">4160</span></a> +</span><span id="L-4161"><a href="#L-4161"><span class="linenos">4161</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-4162"><a href="#L-4162"><span class="linenos">4162</span></a> <span class="k">pass</span> +</span><span id="L-4163"><a href="#L-4163"><span class="linenos">4163</span></a> +</span><span id="L-4164"><a href="#L-4164"><span class="linenos">4164</span></a> +</span><span id="L-4165"><a href="#L-4165"><span class="linenos">4165</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-4166"><a href="#L-4166"><span class="linenos">4166</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4167"><a href="#L-4167"><span class="linenos">4167</span></a> +</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 class="k">class</span> <span class="nc">FromBase64</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4170"><a href="#L-4170"><span class="linenos">4170</span></a> <span class="k">pass</span> +</span><span id="L-4171"><a href="#L-4171"><span class="linenos">4171</span></a> +</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 class="k">class</span> <span class="nc">ToBase64</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4174"><a href="#L-4174"><span class="linenos">4174</span></a> <span class="k">pass</span> +</span><span id="L-4175"><a href="#L-4175"><span class="linenos">4175</span></a> +</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="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-4178"><a href="#L-4178"><span class="linenos">4178</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4179"><a href="#L-4179"><span class="linenos">4179</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-4180"><a href="#L-4180"><span class="linenos">4180</span></a> +</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="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-4183"><a href="#L-4183"><span class="linenos">4183</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4184"><a href="#L-4184"><span class="linenos">4184</span></a> +</span><span id="L-4185"><a href="#L-4185"><span class="linenos">4185</span></a> +</span><span id="L-4186"><a href="#L-4186"><span class="linenos">4186</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-4187"><a href="#L-4187"><span class="linenos">4187</span></a> <span class="k">pass</span> +</span><span id="L-4188"><a href="#L-4188"><span class="linenos">4188</span></a> +</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="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-4191"><a href="#L-4191"><span class="linenos">4191</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4192"><a href="#L-4192"><span class="linenos">4192</span></a> +</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="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-4195"><a href="#L-4195"><span class="linenos">4195</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4198"><a href="#L-4198"><span class="linenos">4198</span></a><span class="k">class</span> <span class="nc">JSONKeyValue</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-4199"><a href="#L-4199"><span class="linenos">4199</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4202"><a href="#L-4202"><span class="linenos">4202</span></a><span class="k">class</span> <span class="nc">JSONObject</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4203"><a href="#L-4203"><span class="linenos">4203</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-4204"><a href="#L-4204"><span class="linenos">4204</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4205"><a href="#L-4205"><span class="linenos">4205</span></a> <span class="s2">"null_handling"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4206"><a href="#L-4206"><span class="linenos">4206</span></a> <span class="s2">"unique_keys"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4207"><a href="#L-4207"><span class="linenos">4207</span></a> <span class="s2">"return_type"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4208"><a href="#L-4208"><span class="linenos">4208</span></a> <span class="s2">"format_json"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4209"><a href="#L-4209"><span class="linenos">4209</span></a> <span class="s2">"encoding"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4210"><a href="#L-4210"><span class="linenos">4210</span></a> <span class="p">}</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="k">class</span> <span class="nc">OpenJSONColumnDef</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-4214"><a href="#L-4214"><span class="linenos">4214</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">True</span><span class="p">,</span> <span class="s2">"path"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"as_json"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</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><span id="L-4217"><a href="#L-4217"><span class="linenos">4217</span></a><span class="k">class</span> <span class="nc">OpenJSON</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4218"><a href="#L-4218"><span class="linenos">4218</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"path"</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-4219"><a href="#L-4219"><span class="linenos">4219</span></a> +</span><span id="L-4220"><a href="#L-4220"><span class="linenos">4220</span></a> +</span><span id="L-4221"><a href="#L-4221"><span class="linenos">4221</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-4222"><a href="#L-4222"><span class="linenos">4222</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-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><span id="L-4225"><a href="#L-4225"><span class="linenos">4225</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-4226"><a href="#L-4226"><span class="linenos">4226</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-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><span id="L-4229"><a href="#L-4229"><span class="linenos">4229</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-4230"><a href="#L-4230"><span class="linenos">4230</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-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><span id="L-4233"><a href="#L-4233"><span class="linenos">4233</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-4234"><a href="#L-4234"><span class="linenos">4234</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-4235"><a href="#L-4235"><span class="linenos">4235</span></a> +</span><span id="L-4236"><a href="#L-4236"><span class="linenos">4236</span></a> +</span><span id="L-4237"><a href="#L-4237"><span class="linenos">4237</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-4238"><a href="#L-4238"><span class="linenos">4238</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-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><span id="L-4241"><a href="#L-4241"><span class="linenos">4241</span></a><span class="k">class</span> <span class="nc">JSONFormat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4242"><a href="#L-4242"><span class="linenos">4242</span></a> <span class="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">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-4243"><a href="#L-4243"><span class="linenos">4243</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_FORMAT"</span><span class="p">]</span> +</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><span id="L-4246"><a href="#L-4246"><span class="linenos">4246</span></a><span class="c1"># https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#operator_member-of</span> +</span><span id="L-4247"><a href="#L-4247"><span class="linenos">4247</span></a><span class="k">class</span> <span class="nc">JSONArrayContains</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> +</span><span id="L-4248"><a href="#L-4248"><span class="linenos">4248</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_ARRAY_CONTAINS"</span><span class="p">]</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><span id="L-4251"><a href="#L-4251"><span class="linenos">4251</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-4252"><a href="#L-4252"><span class="linenos">4252</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-4253"><a href="#L-4253"><span class="linenos">4253</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-4254"><a href="#L-4254"><span class="linenos">4254</span></a> </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><span id="L-4257"><a href="#L-4257"><span class="linenos">4257</span></a><span class="k">class</span> <span class="nc">Right</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4258"><a href="#L-4258"><span class="linenos">4258</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4256"><a href="#L-4256"><span class="linenos">4256</span></a><span class="k">class</span> <span class="nc">Left</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4257"><a href="#L-4257"><span class="linenos">4257</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><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="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-4262"><a href="#L-4262"><span class="linenos">4262</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LENGTH"</span><span class="p">,</span> <span class="s2">"LEN"</span><span class="p">]</span> +</span><span id="L-4260"><a href="#L-4260"><span class="linenos">4260</span></a><span class="k">class</span> <span class="nc">Right</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4261"><a href="#L-4261"><span class="linenos">4261</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4262"><a href="#L-4262"><span class="linenos">4262</span></a> </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">class</span> <span class="nc">Levenshtein</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4266"><a href="#L-4266"><span class="linenos">4266</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-4267"><a href="#L-4267"><span class="linenos">4267</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-4268"><a href="#L-4268"><span class="linenos">4268</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4269"><a href="#L-4269"><span class="linenos">4269</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-4270"><a href="#L-4270"><span class="linenos">4270</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-4271"><a href="#L-4271"><span class="linenos">4271</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-4272"><a href="#L-4272"><span class="linenos">4272</span></a> <span class="p">}</span> -</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><span id="L-4275"><a href="#L-4275"><span class="linenos">4275</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-4276"><a href="#L-4276"><span class="linenos">4276</span></a> <span class="k">pass</span> +</span><span id="L-4264"><a href="#L-4264"><span class="linenos">4264</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-4265"><a href="#L-4265"><span class="linenos">4265</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LENGTH"</span><span class="p">,</span> <span class="s2">"LEN"</span><span class="p">]</span> +</span><span id="L-4266"><a href="#L-4266"><span class="linenos">4266</span></a> +</span><span id="L-4267"><a href="#L-4267"><span class="linenos">4267</span></a> +</span><span id="L-4268"><a href="#L-4268"><span class="linenos">4268</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-4269"><a href="#L-4269"><span class="linenos">4269</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-4270"><a href="#L-4270"><span class="linenos">4270</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-4271"><a href="#L-4271"><span class="linenos">4271</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4272"><a href="#L-4272"><span class="linenos">4272</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-4273"><a href="#L-4273"><span class="linenos">4273</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-4274"><a href="#L-4274"><span class="linenos">4274</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-4275"><a href="#L-4275"><span class="linenos">4275</span></a> <span class="p">}</span> +</span><span id="L-4276"><a href="#L-4276"><span class="linenos">4276</span></a> </span><span id="L-4277"><a href="#L-4277"><span class="linenos">4277</span></a> -</span><span id="L-4278"><a href="#L-4278"><span class="linenos">4278</span></a> -</span><span id="L-4279"><a href="#L-4279"><span class="linenos">4279</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-4280"><a href="#L-4280"><span class="linenos">4280</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4278"><a href="#L-4278"><span class="linenos">4278</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-4279"><a href="#L-4279"><span class="linenos">4279</span></a> <span class="k">pass</span> +</span><span id="L-4280"><a href="#L-4280"><span class="linenos">4280</span></a> </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><span id="L-4283"><a href="#L-4283"><span class="linenos">4283</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-4284"><a href="#L-4284"><span class="linenos">4284</span></a> <span class="k">pass</span> +</span><span id="L-4282"><a href="#L-4282"><span class="linenos">4282</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-4283"><a href="#L-4283"><span class="linenos">4283</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4284"><a href="#L-4284"><span class="linenos">4284</span></a> </span><span id="L-4285"><a href="#L-4285"><span class="linenos">4285</span></a> -</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">class</span> <span class="nc">Log10</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4288"><a href="#L-4288"><span class="linenos">4288</span></a> <span class="k">pass</span> +</span><span id="L-4286"><a href="#L-4286"><span class="linenos">4286</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-4287"><a href="#L-4287"><span class="linenos">4287</span></a> <span class="k">pass</span> +</span><span id="L-4288"><a href="#L-4288"><span class="linenos">4288</span></a> </span><span id="L-4289"><a href="#L-4289"><span class="linenos">4289</span></a> -</span><span id="L-4290"><a href="#L-4290"><span class="linenos">4290</span></a> -</span><span id="L-4291"><a href="#L-4291"><span class="linenos">4291</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-4292"><a href="#L-4292"><span class="linenos">4292</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 class="s2">"BOOLOR_AGG"</span><span class="p">]</span> +</span><span id="L-4290"><a href="#L-4290"><span class="linenos">4290</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-4291"><a href="#L-4291"><span class="linenos">4291</span></a> <span class="k">pass</span> +</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><span id="L-4294"><a href="#L-4294"><span class="linenos">4294</span></a> -</span><span id="L-4295"><a href="#L-4295"><span class="linenos">4295</span></a><span class="k">class</span> <span class="nc">LogicalAnd</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-4296"><a href="#L-4296"><span class="linenos">4296</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LOGICAL_AND"</span><span class="p">,</span> <span class="s2">"BOOL_AND"</span><span class="p">,</span> <span class="s2">"BOOLAND_AGG"</span><span class="p">]</span> +</span><span id="L-4294"><a href="#L-4294"><span class="linenos">4294</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-4295"><a href="#L-4295"><span class="linenos">4295</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 class="s2">"BOOLOR_AGG"</span><span class="p">]</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><span id="L-4299"><a href="#L-4299"><span class="linenos">4299</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-4300"><a href="#L-4300"><span class="linenos">4300</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-4298"><a href="#L-4298"><span class="linenos">4298</span></a><span class="k">class</span> <span class="nc">LogicalAnd</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-4299"><a href="#L-4299"><span class="linenos">4299</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LOGICAL_AND"</span><span class="p">,</span> <span class="s2">"BOOL_AND"</span><span class="p">,</span> <span class="s2">"BOOLAND_AGG"</span><span class="p">]</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><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">class</span> <span class="nc">Map</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4304"><a href="#L-4304"><span class="linenos">4304</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-4302"><a href="#L-4302"><span class="linenos">4302</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-4303"><a href="#L-4303"><span class="linenos">4303</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-4304"><a href="#L-4304"><span class="linenos">4304</span></a> </span><span id="L-4305"><a href="#L-4305"><span class="linenos">4305</span></a> -</span><span id="L-4306"><a href="#L-4306"><span class="linenos">4306</span></a> -</span><span id="L-4307"><a href="#L-4307"><span class="linenos">4307</span></a><span class="k">class</span> <span class="nc">MapFromEntries</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4308"><a href="#L-4308"><span class="linenos">4308</span></a> <span class="k">pass</span> +</span><span id="L-4306"><a href="#L-4306"><span class="linenos">4306</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-4307"><a href="#L-4307"><span class="linenos">4307</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-4308"><a href="#L-4308"><span class="linenos">4308</span></a> </span><span id="L-4309"><a href="#L-4309"><span class="linenos">4309</span></a> -</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="k">class</span> <span class="nc">StarMap</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4312"><a href="#L-4312"><span class="linenos">4312</span></a> <span class="k">pass</span> +</span><span id="L-4310"><a href="#L-4310"><span class="linenos">4310</span></a><span class="k">class</span> <span class="nc">MapFromEntries</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4311"><a href="#L-4311"><span class="linenos">4311</span></a> <span class="k">pass</span> +</span><span id="L-4312"><a href="#L-4312"><span class="linenos">4312</span></a> </span><span id="L-4313"><a href="#L-4313"><span class="linenos">4313</span></a> -</span><span id="L-4314"><a href="#L-4314"><span class="linenos">4314</span></a> -</span><span id="L-4315"><a href="#L-4315"><span class="linenos">4315</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-4316"><a href="#L-4316"><span class="linenos">4316</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-4317"><a href="#L-4317"><span class="linenos">4317</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</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="nd">@property</span> -</span><span id="L-4320"><a href="#L-4320"><span class="linenos">4320</span></a> <span class="k">def</span> <span class="nf">keys</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-4321"><a href="#L-4321"><span class="linenos">4321</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">"keys"</span><span class="p">]</span><span class="o">.</span><span class="n">expressions</span> -</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="nd">@property</span> -</span><span id="L-4324"><a href="#L-4324"><span class="linenos">4324</span></a> <span class="k">def</span> <span class="nf">values</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-4325"><a href="#L-4325"><span class="linenos">4325</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">"values"</span><span class="p">]</span><span class="o">.</span><span class="n">expressions</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><span id="L-4328"><a href="#L-4328"><span class="linenos">4328</span></a><span class="c1"># https://dev.mysql.com/doc/refman/8.0/en/fulltext-search.html</span> -</span><span id="L-4329"><a href="#L-4329"><span class="linenos">4329</span></a><span class="k">class</span> <span class="nc">MatchAgainst</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4330"><a href="#L-4330"><span class="linenos">4330</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"modifier"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-4331"><a href="#L-4331"><span class="linenos">4331</span></a> -</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">class</span> <span class="nc">Max</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-4334"><a href="#L-4334"><span class="linenos">4334</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4335"><a href="#L-4335"><span class="linenos">4335</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-4336"><a href="#L-4336"><span class="linenos">4336</span></a> -</span><span id="L-4337"><a href="#L-4337"><span class="linenos">4337</span></a> -</span><span id="L-4338"><a href="#L-4338"><span class="linenos">4338</span></a><span class="k">class</span> <span class="nc">MD5</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4339"><a href="#L-4339"><span class="linenos">4339</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"MD5"</span><span class="p">]</span> +</span><span id="L-4314"><a href="#L-4314"><span class="linenos">4314</span></a><span class="k">class</span> <span class="nc">StarMap</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4315"><a href="#L-4315"><span class="linenos">4315</span></a> <span class="k">pass</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><span id="L-4318"><a href="#L-4318"><span class="linenos">4318</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-4319"><a href="#L-4319"><span class="linenos">4319</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-4320"><a href="#L-4320"><span class="linenos">4320</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</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 class="nd">@property</span> +</span><span id="L-4323"><a href="#L-4323"><span class="linenos">4323</span></a> <span class="k">def</span> <span class="nf">keys</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-4324"><a href="#L-4324"><span class="linenos">4324</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">"keys"</span><span class="p">]</span><span class="o">.</span><span class="n">expressions</span> +</span><span id="L-4325"><a href="#L-4325"><span class="linenos">4325</span></a> +</span><span id="L-4326"><a href="#L-4326"><span class="linenos">4326</span></a> <span class="nd">@property</span> +</span><span id="L-4327"><a href="#L-4327"><span class="linenos">4327</span></a> <span class="k">def</span> <span class="nf">values</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-4328"><a href="#L-4328"><span class="linenos">4328</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">"values"</span><span class="p">]</span><span class="o">.</span><span class="n">expressions</span> +</span><span id="L-4329"><a href="#L-4329"><span class="linenos">4329</span></a> +</span><span id="L-4330"><a href="#L-4330"><span class="linenos">4330</span></a> +</span><span id="L-4331"><a href="#L-4331"><span class="linenos">4331</span></a><span class="c1"># https://dev.mysql.com/doc/refman/8.0/en/fulltext-search.html</span> +</span><span id="L-4332"><a href="#L-4332"><span class="linenos">4332</span></a><span class="k">class</span> <span class="nc">MatchAgainst</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4333"><a href="#L-4333"><span class="linenos">4333</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"modifier"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-4334"><a href="#L-4334"><span class="linenos">4334</span></a> +</span><span id="L-4335"><a href="#L-4335"><span class="linenos">4335</span></a> +</span><span id="L-4336"><a href="#L-4336"><span class="linenos">4336</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-4337"><a href="#L-4337"><span class="linenos">4337</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4338"><a href="#L-4338"><span class="linenos">4338</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</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><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">class</span> <span class="nc">Min</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-4343"><a href="#L-4343"><span class="linenos">4343</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4344"><a href="#L-4344"><span class="linenos">4344</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-4345"><a href="#L-4345"><span class="linenos">4345</span></a> -</span><span id="L-4346"><a href="#L-4346"><span class="linenos">4346</span></a> -</span><span id="L-4347"><a href="#L-4347"><span class="linenos">4347</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-4348"><a href="#L-4348"><span class="linenos">4348</span></a> <span class="k">pass</span> +</span><span id="L-4341"><a href="#L-4341"><span class="linenos">4341</span></a><span class="k">class</span> <span class="nc">MD5</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4342"><a href="#L-4342"><span class="linenos">4342</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"MD5"</span><span class="p">]</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><span id="L-4345"><a href="#L-4345"><span class="linenos">4345</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-4346"><a href="#L-4346"><span class="linenos">4346</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4347"><a href="#L-4347"><span class="linenos">4347</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-4348"><a href="#L-4348"><span class="linenos">4348</span></a> </span><span id="L-4349"><a href="#L-4349"><span class="linenos">4349</span></a> -</span><span id="L-4350"><a href="#L-4350"><span class="linenos">4350</span></a> -</span><span id="L-4351"><a href="#L-4351"><span class="linenos">4351</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-4352"><a href="#L-4352"><span class="linenos">4352</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4350"><a href="#L-4350"><span class="linenos">4350</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-4351"><a href="#L-4351"><span class="linenos">4351</span></a> <span class="k">pass</span> +</span><span id="L-4352"><a href="#L-4352"><span class="linenos">4352</span></a> </span><span id="L-4353"><a href="#L-4353"><span class="linenos">4353</span></a> -</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="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-4356"><a href="#L-4356"><span class="linenos">4356</span></a> <span class="k">pass</span> +</span><span id="L-4354"><a href="#L-4354"><span class="linenos">4354</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-4355"><a href="#L-4355"><span class="linenos">4355</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4356"><a href="#L-4356"><span class="linenos">4356</span></a> </span><span id="L-4357"><a href="#L-4357"><span class="linenos">4357</span></a> -</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="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-4360"><a href="#L-4360"><span class="linenos">4360</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-4358"><a href="#L-4358"><span class="linenos">4358</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-4359"><a href="#L-4359"><span class="linenos">4359</span></a> <span class="k">pass</span> +</span><span id="L-4360"><a href="#L-4360"><span class="linenos">4360</span></a> </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">class</span> <span class="nc">PercentileCont</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-4364"><a href="#L-4364"><span class="linenos">4364</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4362"><a href="#L-4362"><span class="linenos">4362</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-4363"><a href="#L-4363"><span class="linenos">4363</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-4364"><a href="#L-4364"><span class="linenos">4364</span></a> </span><span id="L-4365"><a href="#L-4365"><span class="linenos">4365</span></a> -</span><span id="L-4366"><a href="#L-4366"><span class="linenos">4366</span></a> -</span><span id="L-4367"><a href="#L-4367"><span class="linenos">4367</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-4368"><a href="#L-4368"><span class="linenos">4368</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4366"><a href="#L-4366"><span class="linenos">4366</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-4367"><a href="#L-4367"><span class="linenos">4367</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4370"><a href="#L-4370"><span class="linenos">4370</span></a> -</span><span id="L-4371"><a href="#L-4371"><span class="linenos">4371</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-4372"><a href="#L-4372"><span class="linenos">4372</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4370"><a href="#L-4370"><span class="linenos">4370</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-4371"><a href="#L-4371"><span class="linenos">4371</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4372"><a href="#L-4372"><span class="linenos">4372</span></a> </span><span id="L-4373"><a href="#L-4373"><span class="linenos">4373</span></a> -</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">class</span> <span class="nc">ApproxQuantile</span><span class="p">(</span><span class="n">Quantile</span><span class="p">):</span> -</span><span id="L-4376"><a href="#L-4376"><span class="linenos">4376</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4374"><a href="#L-4374"><span class="linenos">4374</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-4375"><a href="#L-4375"><span class="linenos">4375</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4376"><a href="#L-4376"><span class="linenos">4376</span></a> </span><span id="L-4377"><a href="#L-4377"><span class="linenos">4377</span></a> -</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">class</span> <span class="nc">RangeN</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4380"><a href="#L-4380"><span class="linenos">4380</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"each"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-4378"><a href="#L-4378"><span class="linenos">4378</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-4379"><a href="#L-4379"><span class="linenos">4379</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4380"><a href="#L-4380"><span class="linenos">4380</span></a> </span><span id="L-4381"><a href="#L-4381"><span class="linenos">4381</span></a> -</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">class</span> <span class="nc">ReadCSV</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4384"><a href="#L-4384"><span class="linenos">4384</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-4385"><a href="#L-4385"><span class="linenos">4385</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-4386"><a href="#L-4386"><span class="linenos">4386</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4387"><a href="#L-4387"><span class="linenos">4387</span></a> -</span><span id="L-4388"><a href="#L-4388"><span class="linenos">4388</span></a> -</span><span id="L-4389"><a href="#L-4389"><span class="linenos">4389</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-4390"><a href="#L-4390"><span class="linenos">4390</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4382"><a href="#L-4382"><span class="linenos">4382</span></a><span class="k">class</span> <span class="nc">RangeN</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4383"><a href="#L-4383"><span class="linenos">4383</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"each"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</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><span id="L-4386"><a href="#L-4386"><span class="linenos">4386</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-4387"><a href="#L-4387"><span class="linenos">4387</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-4388"><a href="#L-4388"><span class="linenos">4388</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-4389"><a href="#L-4389"><span class="linenos">4389</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4392"><a href="#L-4392"><span class="linenos">4392</span></a> -</span><span id="L-4393"><a href="#L-4393"><span class="linenos">4393</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-4394"><a href="#L-4394"><span class="linenos">4394</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-4395"><a href="#L-4395"><span class="linenos">4395</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-4396"><a href="#L-4396"><span class="linenos">4396</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-4397"><a href="#L-4397"><span class="linenos">4397</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4398"><a href="#L-4398"><span class="linenos">4398</span></a> <span class="s2">"occurrence"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4399"><a href="#L-4399"><span class="linenos">4399</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4400"><a href="#L-4400"><span class="linenos">4400</span></a> <span class="p">}</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><span id="L-4403"><a href="#L-4403"><span class="linenos">4403</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-4404"><a href="#L-4404"><span class="linenos">4404</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4392"><a href="#L-4392"><span class="linenos">4392</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-4393"><a href="#L-4393"><span class="linenos">4393</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4394"><a href="#L-4394"><span class="linenos">4394</span></a> +</span><span id="L-4395"><a href="#L-4395"><span class="linenos">4395</span></a> +</span><span id="L-4396"><a href="#L-4396"><span class="linenos">4396</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-4397"><a href="#L-4397"><span class="linenos">4397</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-4398"><a href="#L-4398"><span class="linenos">4398</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-4399"><a href="#L-4399"><span class="linenos">4399</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-4400"><a href="#L-4400"><span class="linenos">4400</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4401"><a href="#L-4401"><span class="linenos">4401</span></a> <span class="s2">"occurrence"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4402"><a href="#L-4402"><span class="linenos">4402</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4403"><a href="#L-4403"><span class="linenos">4403</span></a> <span class="p">}</span> +</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><span id="L-4406"><a href="#L-4406"><span class="linenos">4406</span></a> -</span><span id="L-4407"><a href="#L-4407"><span class="linenos">4407</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-4408"><a href="#L-4408"><span class="linenos">4408</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4406"><a href="#L-4406"><span class="linenos">4406</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-4407"><a href="#L-4407"><span class="linenos">4407</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4408"><a href="#L-4408"><span class="linenos">4408</span></a> </span><span id="L-4409"><a href="#L-4409"><span class="linenos">4409</span></a> -</span><span id="L-4410"><a href="#L-4410"><span class="linenos">4410</span></a> -</span><span id="L-4411"><a href="#L-4411"><span class="linenos">4411</span></a><span class="c1"># https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.split.html</span> -</span><span id="L-4412"><a href="#L-4412"><span class="linenos">4412</span></a><span class="c1"># limit is the number of times a pattern is applied</span> -</span><span id="L-4413"><a href="#L-4413"><span class="linenos">4413</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-4414"><a href="#L-4414"><span class="linenos">4414</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4415"><a href="#L-4415"><span class="linenos">4415</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="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-4418"><a href="#L-4418"><span class="linenos">4418</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4410"><a href="#L-4410"><span class="linenos">4410</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-4411"><a href="#L-4411"><span class="linenos">4411</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4414"><a href="#L-4414"><span class="linenos">4414</span></a><span class="c1"># https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.split.html</span> +</span><span id="L-4415"><a href="#L-4415"><span class="linenos">4415</span></a><span class="c1"># limit is the number of times a pattern is applied</span> +</span><span id="L-4416"><a href="#L-4416"><span class="linenos">4416</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-4417"><a href="#L-4417"><span class="linenos">4417</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4418"><a href="#L-4418"><span class="linenos">4418</span></a> </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">class</span> <span class="nc">Round</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4422"><a href="#L-4422"><span class="linenos">4422</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4420"><a href="#L-4420"><span class="linenos">4420</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-4421"><a href="#L-4421"><span class="linenos">4421</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4425"><a href="#L-4425"><span class="linenos">4425</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-4426"><a href="#L-4426"><span class="linenos">4426</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-4424"><a href="#L-4424"><span class="linenos">4424</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-4425"><a href="#L-4425"><span class="linenos">4425</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4426"><a href="#L-4426"><span class="linenos">4426</span></a> </span><span id="L-4427"><a href="#L-4427"><span class="linenos">4427</span></a> -</span><span id="L-4428"><a href="#L-4428"><span class="linenos">4428</span></a> -</span><span id="L-4429"><a href="#L-4429"><span class="linenos">4429</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-4430"><a href="#L-4430"><span class="linenos">4430</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4428"><a href="#L-4428"><span class="linenos">4428</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-4429"><a href="#L-4429"><span class="linenos">4429</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-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><span id="L-4432"><a href="#L-4432"><span class="linenos">4432</span></a> -</span><span id="L-4433"><a href="#L-4433"><span class="linenos">4433</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-4434"><a href="#L-4434"><span class="linenos">4434</span></a> <span class="k">pass</span> +</span><span id="L-4432"><a href="#L-4432"><span class="linenos">4432</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-4433"><a href="#L-4433"><span class="linenos">4433</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4436"><a href="#L-4436"><span class="linenos">4436</span></a> -</span><span id="L-4437"><a href="#L-4437"><span class="linenos">4437</span></a><span class="k">class</span> <span class="nc">SHA</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4438"><a href="#L-4438"><span class="linenos">4438</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"SHA"</span><span class="p">,</span> <span class="s2">"SHA1"</span><span class="p">]</span> +</span><span id="L-4436"><a href="#L-4436"><span class="linenos">4436</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-4437"><a href="#L-4437"><span class="linenos">4437</span></a> <span class="k">pass</span> +</span><span id="L-4438"><a href="#L-4438"><span class="linenos">4438</span></a> </span><span id="L-4439"><a href="#L-4439"><span class="linenos">4439</span></a> -</span><span id="L-4440"><a href="#L-4440"><span class="linenos">4440</span></a> -</span><span id="L-4441"><a href="#L-4441"><span class="linenos">4441</span></a><span class="k">class</span> <span class="nc">SHA2</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4442"><a href="#L-4442"><span class="linenos">4442</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"SHA2"</span><span class="p">]</span> -</span><span id="L-4443"><a href="#L-4443"><span class="linenos">4443</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</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-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><span id="L-4446"><a href="#L-4446"><span class="linenos">4446</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-4447"><a href="#L-4447"><span class="linenos">4447</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4440"><a href="#L-4440"><span class="linenos">4440</span></a><span class="k">class</span> <span class="nc">SHA</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4441"><a href="#L-4441"><span class="linenos">4441</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"SHA"</span><span class="p">,</span> <span class="s2">"SHA1"</span><span class="p">]</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><span id="L-4444"><a href="#L-4444"><span class="linenos">4444</span></a><span class="k">class</span> <span class="nc">SHA2</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4445"><a href="#L-4445"><span class="linenos">4445</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"SHA2"</span><span class="p">]</span> +</span><span id="L-4446"><a href="#L-4446"><span class="linenos">4446</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</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-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><span id="L-4449"><a href="#L-4449"><span class="linenos">4449</span></a> -</span><span id="L-4450"><a href="#L-4450"><span class="linenos">4450</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-4451"><a href="#L-4451"><span class="linenos">4451</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4449"><a href="#L-4449"><span class="linenos">4449</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-4450"><a href="#L-4450"><span class="linenos">4450</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4453"><a href="#L-4453"><span class="linenos">4453</span></a> -</span><span id="L-4454"><a href="#L-4454"><span class="linenos">4454</span></a><span class="c1"># Start may be omitted in the case of postgres</span> -</span><span id="L-4455"><a href="#L-4455"><span class="linenos">4455</span></a><span class="c1"># https://www.postgresql.org/docs/9.1/functions-string.html @ Table 9-6</span> -</span><span id="L-4456"><a href="#L-4456"><span class="linenos">4456</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-4457"><a href="#L-4457"><span class="linenos">4457</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4458"><a href="#L-4458"><span class="linenos">4458</span></a> -</span><span id="L-4459"><a href="#L-4459"><span class="linenos">4459</span></a> -</span><span id="L-4460"><a href="#L-4460"><span class="linenos">4460</span></a><span class="k">class</span> <span class="nc">StandardHash</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4461"><a href="#L-4461"><span class="linenos">4461</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4453"><a href="#L-4453"><span class="linenos">4453</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-4454"><a href="#L-4454"><span class="linenos">4454</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4457"><a href="#L-4457"><span class="linenos">4457</span></a><span class="c1"># Start may be omitted in the case of postgres</span> +</span><span id="L-4458"><a href="#L-4458"><span class="linenos">4458</span></a><span class="c1"># https://www.postgresql.org/docs/9.1/functions-string.html @ Table 9-6</span> +</span><span id="L-4459"><a href="#L-4459"><span class="linenos">4459</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-4460"><a href="#L-4460"><span class="linenos">4460</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4464"><a href="#L-4464"><span class="linenos">4464</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-4465"><a href="#L-4465"><span class="linenos">4465</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-4466"><a href="#L-4466"><span class="linenos">4466</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-4467"><a href="#L-4467"><span class="linenos">4467</span></a> <span class="s2">"substr"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-4468"><a href="#L-4468"><span class="linenos">4468</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4469"><a href="#L-4469"><span class="linenos">4469</span></a> <span class="s2">"instance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4470"><a href="#L-4470"><span class="linenos">4470</span></a> <span class="p">}</span> -</span><span id="L-4471"><a href="#L-4471"><span class="linenos">4471</span></a> -</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="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-4474"><a href="#L-4474"><span class="linenos">4474</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4463"><a href="#L-4463"><span class="linenos">4463</span></a><span class="k">class</span> <span class="nc">StandardHash</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4464"><a href="#L-4464"><span class="linenos">4464</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4467"><a href="#L-4467"><span class="linenos">4467</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-4468"><a href="#L-4468"><span class="linenos">4468</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-4469"><a href="#L-4469"><span class="linenos">4469</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-4470"><a href="#L-4470"><span class="linenos">4470</span></a> <span class="s2">"substr"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-4471"><a href="#L-4471"><span class="linenos">4471</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4472"><a href="#L-4472"><span class="linenos">4472</span></a> <span class="s2">"instance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4473"><a href="#L-4473"><span class="linenos">4473</span></a> <span class="p">}</span> +</span><span id="L-4474"><a href="#L-4474"><span class="linenos">4474</span></a> </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><span id="L-4477"><a href="#L-4477"><span class="linenos">4477</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-4478"><a href="#L-4478"><span class="linenos">4478</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4476"><a href="#L-4476"><span class="linenos">4476</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-4477"><a href="#L-4477"><span class="linenos">4477</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><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 class="c1"># Spark allows unix_timestamp()</span> -</span><span id="L-4482"><a href="#L-4482"><span class="linenos">4482</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-4483"><a href="#L-4483"><span class="linenos">4483</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-4484"><a href="#L-4484"><span class="linenos">4484</span></a> <span class="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-4485"><a href="#L-4485"><span class="linenos">4485</span></a> -</span><span id="L-4486"><a href="#L-4486"><span class="linenos">4486</span></a> -</span><span id="L-4487"><a href="#L-4487"><span class="linenos">4487</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-4488"><a href="#L-4488"><span class="linenos">4488</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4480"><a href="#L-4480"><span class="linenos">4480</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-4481"><a href="#L-4481"><span class="linenos">4481</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-4482"><a href="#L-4482"><span class="linenos">4482</span></a> +</span><span id="L-4483"><a href="#L-4483"><span class="linenos">4483</span></a> +</span><span id="L-4484"><a href="#L-4484"><span class="linenos">4484</span></a><span class="c1"># Spark allows unix_timestamp()</span> +</span><span id="L-4485"><a href="#L-4485"><span class="linenos">4485</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-4486"><a href="#L-4486"><span class="linenos">4486</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-4487"><a href="#L-4487"><span class="linenos">4487</span></a> <span class="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-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><span id="L-4491"><a href="#L-4491"><span class="linenos">4491</span></a><span class="k">class</span> <span class="nc">FromBase</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4492"><a href="#L-4492"><span class="linenos">4492</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4490"><a href="#L-4490"><span class="linenos">4490</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-4491"><a href="#L-4491"><span class="linenos">4491</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4494"><a href="#L-4494"><span class="linenos">4494</span></a> -</span><span id="L-4495"><a href="#L-4495"><span class="linenos">4495</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-4496"><a href="#L-4496"><span class="linenos">4496</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-4497"><a href="#L-4497"><span class="linenos">4497</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-4498"><a href="#L-4498"><span class="linenos">4498</span></a> -</span><span id="L-4499"><a href="#L-4499"><span class="linenos">4499</span></a> -</span><span id="L-4500"><a href="#L-4500"><span class="linenos">4500</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-4501"><a href="#L-4501"><span class="linenos">4501</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4494"><a href="#L-4494"><span class="linenos">4494</span></a><span class="k">class</span> <span class="nc">FromBase</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4495"><a href="#L-4495"><span class="linenos">4495</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4498"><a href="#L-4498"><span class="linenos">4498</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-4499"><a href="#L-4499"><span class="linenos">4499</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-4500"><a href="#L-4500"><span class="linenos">4500</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-4501"><a href="#L-4501"><span class="linenos">4501</span></a> </span><span id="L-4502"><a href="#L-4502"><span class="linenos">4502</span></a> -</span><span id="L-4503"><a href="#L-4503"><span class="linenos">4503</span></a> -</span><span id="L-4504"><a href="#L-4504"><span class="linenos">4504</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-4505"><a href="#L-4505"><span class="linenos">4505</span></a> <span class="k">pass</span> +</span><span id="L-4503"><a href="#L-4503"><span class="linenos">4503</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-4504"><a href="#L-4504"><span class="linenos">4504</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4505"><a href="#L-4505"><span class="linenos">4505</span></a> </span><span id="L-4506"><a href="#L-4506"><span class="linenos">4506</span></a> -</span><span id="L-4507"><a href="#L-4507"><span class="linenos">4507</span></a> -</span><span id="L-4508"><a href="#L-4508"><span class="linenos">4508</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-4509"><a href="#L-4509"><span class="linenos">4509</span></a> <span class="k">pass</span> +</span><span id="L-4507"><a href="#L-4507"><span class="linenos">4507</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-4508"><a href="#L-4508"><span class="linenos">4508</span></a> <span class="k">pass</span> +</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><span id="L-4511"><a href="#L-4511"><span class="linenos">4511</span></a> -</span><span id="L-4512"><a href="#L-4512"><span class="linenos">4512</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-4513"><a href="#L-4513"><span class="linenos">4513</span></a> <span class="k">pass</span> +</span><span id="L-4511"><a href="#L-4511"><span class="linenos">4511</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-4512"><a href="#L-4512"><span class="linenos">4512</span></a> <span class="k">pass</span> +</span><span id="L-4513"><a href="#L-4513"><span class="linenos">4513</span></a> </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><span id="L-4516"><a href="#L-4516"><span class="linenos">4516</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-4517"><a href="#L-4517"><span class="linenos">4517</span></a> <span class="k">pass</span> +</span><span id="L-4515"><a href="#L-4515"><span class="linenos">4515</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-4516"><a href="#L-4516"><span class="linenos">4516</span></a> <span class="k">pass</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><span id="L-4519"><a href="#L-4519"><span class="linenos">4519</span></a> -</span><span id="L-4520"><a href="#L-4520"><span class="linenos">4520</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-4521"><a href="#L-4521"><span class="linenos">4521</span></a> <span class="k">pass</span> +</span><span id="L-4519"><a href="#L-4519"><span class="linenos">4519</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-4520"><a href="#L-4520"><span class="linenos">4520</span></a> <span class="k">pass</span> +</span><span id="L-4521"><a href="#L-4521"><span class="linenos">4521</span></a> </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">class</span> <span class="nc">TimeToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4525"><a href="#L-4525"><span class="linenos">4525</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4523"><a href="#L-4523"><span class="linenos">4523</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-4524"><a href="#L-4524"><span class="linenos">4524</span></a> <span class="k">pass</span> +</span><span id="L-4525"><a href="#L-4525"><span class="linenos">4525</span></a> </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><span id="L-4528"><a href="#L-4528"><span class="linenos">4528</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-4529"><a href="#L-4529"><span class="linenos">4529</span></a> <span class="k">pass</span> +</span><span id="L-4527"><a href="#L-4527"><span class="linenos">4527</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-4528"><a href="#L-4528"><span class="linenos">4528</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4529"><a href="#L-4529"><span class="linenos">4529</span></a> </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><span id="L-4532"><a href="#L-4532"><span class="linenos">4532</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-4533"><a href="#L-4533"><span class="linenos">4533</span></a> <span class="k">pass</span> +</span><span id="L-4531"><a href="#L-4531"><span class="linenos">4531</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-4532"><a href="#L-4532"><span class="linenos">4532</span></a> <span class="k">pass</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><span id="L-4535"><a href="#L-4535"><span class="linenos">4535</span></a> -</span><span id="L-4536"><a href="#L-4536"><span class="linenos">4536</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-4537"><a href="#L-4537"><span class="linenos">4537</span></a> <span class="k">pass</span> +</span><span id="L-4535"><a href="#L-4535"><span class="linenos">4535</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-4536"><a href="#L-4536"><span class="linenos">4536</span></a> <span class="k">pass</span> +</span><span id="L-4537"><a href="#L-4537"><span class="linenos">4537</span></a> </span><span id="L-4538"><a href="#L-4538"><span class="linenos">4538</span></a> -</span><span id="L-4539"><a href="#L-4539"><span class="linenos">4539</span></a> -</span><span id="L-4540"><a href="#L-4540"><span class="linenos">4540</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-4541"><a href="#L-4541"><span class="linenos">4541</span></a> <span class="k">pass</span> +</span><span id="L-4539"><a href="#L-4539"><span class="linenos">4539</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-4540"><a href="#L-4540"><span class="linenos">4540</span></a> <span class="k">pass</span> +</span><span id="L-4541"><a href="#L-4541"><span class="linenos">4541</span></a> </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><span id="L-4544"><a href="#L-4544"><span class="linenos">4544</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-4545"><a href="#L-4545"><span class="linenos">4545</span></a> <span class="k">pass</span> +</span><span id="L-4543"><a href="#L-4543"><span class="linenos">4543</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-4544"><a href="#L-4544"><span class="linenos">4544</span></a> <span class="k">pass</span> +</span><span id="L-4545"><a href="#L-4545"><span class="linenos">4545</span></a> </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">class</span> <span class="nc">Trim</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4549"><a href="#L-4549"><span class="linenos">4549</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-4550"><a href="#L-4550"><span class="linenos">4550</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-4551"><a href="#L-4551"><span class="linenos">4551</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4552"><a href="#L-4552"><span class="linenos">4552</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4553"><a href="#L-4553"><span class="linenos">4553</span></a> <span class="s2">"collation"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4554"><a href="#L-4554"><span class="linenos">4554</span></a> <span class="p">}</span> -</span><span id="L-4555"><a href="#L-4555"><span class="linenos">4555</span></a> -</span><span id="L-4556"><a href="#L-4556"><span class="linenos">4556</span></a> -</span><span id="L-4557"><a href="#L-4557"><span class="linenos">4557</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-4558"><a href="#L-4558"><span class="linenos">4558</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4547"><a href="#L-4547"><span class="linenos">4547</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-4548"><a href="#L-4548"><span class="linenos">4548</span></a> <span class="k">pass</span> +</span><span id="L-4549"><a href="#L-4549"><span class="linenos">4549</span></a> +</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="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-4552"><a href="#L-4552"><span class="linenos">4552</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-4553"><a href="#L-4553"><span class="linenos">4553</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-4554"><a href="#L-4554"><span class="linenos">4554</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4555"><a href="#L-4555"><span class="linenos">4555</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4556"><a href="#L-4556"><span class="linenos">4556</span></a> <span class="s2">"collation"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4557"><a href="#L-4557"><span class="linenos">4557</span></a> <span class="p">}</span> +</span><span id="L-4558"><a href="#L-4558"><span class="linenos">4558</span></a> </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><span id="L-4561"><a href="#L-4561"><span class="linenos">4561</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-4562"><a href="#L-4562"><span class="linenos">4562</span></a> <span class="k">pass</span> +</span><span id="L-4560"><a href="#L-4560"><span class="linenos">4560</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-4561"><a href="#L-4561"><span class="linenos">4561</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4564"><a href="#L-4564"><span class="linenos">4564</span></a> -</span><span id="L-4565"><a href="#L-4565"><span class="linenos">4565</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-4566"><a href="#L-4566"><span class="linenos">4566</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4564"><a href="#L-4564"><span class="linenos">4564</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-4565"><a href="#L-4565"><span class="linenos">4565</span></a> <span class="k">pass</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><span id="L-4569"><a href="#L-4569"><span class="linenos">4569</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-4570"><a href="#L-4570"><span class="linenos">4570</span></a> <span class="k">pass</span> +</span><span id="L-4568"><a href="#L-4568"><span class="linenos">4568</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-4569"><a href="#L-4569"><span class="linenos">4569</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><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="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-4574"><a href="#L-4574"><span class="linenos">4574</span></a> <span class="k">pass</span> +</span><span id="L-4572"><a href="#L-4572"><span class="linenos">4572</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-4573"><a href="#L-4573"><span class="linenos">4573</span></a> <span class="k">pass</span> +</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><span id="L-4576"><a href="#L-4576"><span class="linenos">4576</span></a> -</span><span id="L-4577"><a href="#L-4577"><span class="linenos">4577</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-4578"><a href="#L-4578"><span class="linenos">4578</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4576"><a href="#L-4576"><span class="linenos">4576</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-4577"><a href="#L-4577"><span class="linenos">4577</span></a> <span class="k">pass</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><span id="L-4580"><a href="#L-4580"><span class="linenos">4580</span></a> -</span><span id="L-4581"><a href="#L-4581"><span class="linenos">4581</span></a><span class="c1"># https://prestodb.io/docs/current/functions/datetime.html</span> -</span><span id="L-4582"><a href="#L-4582"><span class="linenos">4582</span></a><span class="c1"># presto has weird zone/hours/minutes</span> -</span><span id="L-4583"><a href="#L-4583"><span class="linenos">4583</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-4584"><a href="#L-4584"><span class="linenos">4584</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4585"><a href="#L-4585"><span class="linenos">4585</span></a> -</span><span id="L-4586"><a href="#L-4586"><span class="linenos">4586</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-4587"><a href="#L-4587"><span class="linenos">4587</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-4588"><a href="#L-4588"><span class="linenos">4588</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-4589"><a href="#L-4589"><span class="linenos">4589</span></a> -</span><span id="L-4590"><a href="#L-4590"><span class="linenos">4590</span></a> -</span><span id="L-4591"><a href="#L-4591"><span class="linenos">4591</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-4592"><a href="#L-4592"><span class="linenos">4592</span></a> <span class="k">pass</span> +</span><span id="L-4580"><a href="#L-4580"><span class="linenos">4580</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-4581"><a href="#L-4581"><span class="linenos">4581</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4582"><a href="#L-4582"><span class="linenos">4582</span></a> +</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="c1"># https://prestodb.io/docs/current/functions/datetime.html</span> +</span><span id="L-4585"><a href="#L-4585"><span class="linenos">4585</span></a><span class="c1"># presto has weird zone/hours/minutes</span> +</span><span id="L-4586"><a href="#L-4586"><span class="linenos">4586</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-4587"><a href="#L-4587"><span class="linenos">4587</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4588"><a href="#L-4588"><span class="linenos">4588</span></a> +</span><span id="L-4589"><a href="#L-4589"><span class="linenos">4589</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-4590"><a href="#L-4590"><span class="linenos">4590</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-4591"><a href="#L-4591"><span class="linenos">4591</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-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><span id="L-4594"><a href="#L-4594"><span class="linenos">4594</span></a> -</span><span id="L-4595"><a href="#L-4595"><span class="linenos">4595</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-4596"><a href="#L-4596"><span class="linenos">4596</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-4594"><a href="#L-4594"><span class="linenos">4594</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-4595"><a href="#L-4595"><span class="linenos">4595</span></a> <span class="k">pass</span> +</span><span id="L-4596"><a href="#L-4596"><span class="linenos">4596</span></a> </span><span id="L-4597"><a href="#L-4597"><span class="linenos">4597</span></a> -</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="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-4600"><a href="#L-4600"><span class="linenos">4600</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-4598"><a href="#L-4598"><span class="linenos">4598</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-4599"><a href="#L-4599"><span class="linenos">4599</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-4600"><a href="#L-4600"><span class="linenos">4600</span></a> </span><span id="L-4601"><a href="#L-4601"><span class="linenos">4601</span></a> -</span><span id="L-4602"><a href="#L-4602"><span class="linenos">4602</span></a> -</span><span id="L-4603"><a href="#L-4603"><span class="linenos">4603</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-4604"><a href="#L-4604"><span class="linenos">4604</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-4602"><a href="#L-4602"><span class="linenos">4602</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-4603"><a href="#L-4603"><span class="linenos">4603</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-4604"><a href="#L-4604"><span class="linenos">4604</span></a> </span><span id="L-4605"><a href="#L-4605"><span class="linenos">4605</span></a> -</span><span id="L-4606"><a href="#L-4606"><span class="linenos">4606</span></a> -</span><span id="L-4607"><a href="#L-4607"><span class="linenos">4607</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-4608"><a href="#L-4608"><span class="linenos">4608</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4606"><a href="#L-4606"><span class="linenos">4606</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-4607"><a href="#L-4607"><span class="linenos">4607</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-4608"><a href="#L-4608"><span class="linenos">4608</span></a> </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><span id="L-4611"><a href="#L-4611"><span class="linenos">4611</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-4612"><a href="#L-4612"><span class="linenos">4612</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4610"><a href="#L-4610"><span class="linenos">4610</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-4611"><a href="#L-4611"><span class="linenos">4611</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-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><span id="L-4614"><a href="#L-4614"><span class="linenos">4614</span></a> -</span><span id="L-4615"><a href="#L-4615"><span class="linenos">4615</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-4616"><a href="#L-4616"><span class="linenos">4616</span></a> <span class="k">pass</span> +</span><span id="L-4614"><a href="#L-4614"><span class="linenos">4614</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-4615"><a href="#L-4615"><span class="linenos">4615</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4616"><a href="#L-4616"><span class="linenos">4616</span></a> </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><span id="L-4619"><a href="#L-4619"><span class="linenos">4619</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-4620"><a href="#L-4620"><span class="linenos">4620</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4618"><a href="#L-4618"><span class="linenos">4618</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-4619"><a href="#L-4619"><span class="linenos">4619</span></a> <span class="k">pass</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><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 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-4624"><a href="#L-4624"><span class="linenos">4624</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4622"><a href="#L-4622"><span class="linenos">4622</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-4623"><a href="#L-4623"><span class="linenos">4623</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4624"><a href="#L-4624"><span class="linenos">4624</span></a> </span><span id="L-4625"><a href="#L-4625"><span class="linenos">4625</span></a> -</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="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-4628"><a href="#L-4628"><span class="linenos">4628</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"matched"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"source"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"condition"</span><span class="p">:</span> <span class="kc">False</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-4626"><a href="#L-4626"><span class="linenos">4626</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-4627"><a href="#L-4627"><span class="linenos">4627</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4628"><a href="#L-4628"><span class="linenos">4628</span></a> </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><span id="L-4631"><a href="#L-4631"><span class="linenos">4631</span></a><span class="c1"># https://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqljnextvaluefor.html</span> -</span><span id="L-4632"><a href="#L-4632"><span class="linenos">4632</span></a><span class="c1"># https://learn.microsoft.com/en-us/sql/t-sql/functions/next-value-for-transact-sql?view=sql-server-ver16</span> -</span><span id="L-4633"><a href="#L-4633"><span class="linenos">4633</span></a><span class="k">class</span> <span class="nc">NextValueFor</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-4634"><a href="#L-4634"><span class="linenos">4634</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</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><span id="L-4637"><a href="#L-4637"><span class="linenos">4637</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-4638"><a href="#L-4638"><span class="linenos">4638</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">type</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">str</span> <span class="k">else</span> <span class="n">arg</span> +</span><span id="L-4630"><a href="#L-4630"><span class="linenos">4630</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-4631"><a href="#L-4631"><span class="linenos">4631</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"matched"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"source"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"condition"</span><span class="p">:</span> <span class="kc">False</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-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><span id="L-4634"><a href="#L-4634"><span class="linenos">4634</span></a><span class="c1"># https://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqljnextvaluefor.html</span> +</span><span id="L-4635"><a href="#L-4635"><span class="linenos">4635</span></a><span class="c1"># https://learn.microsoft.com/en-us/sql/t-sql/functions/next-value-for-transact-sql?view=sql-server-ver16</span> +</span><span id="L-4636"><a href="#L-4636"><span class="linenos">4636</span></a><span class="k">class</span> <span class="nc">NextValueFor</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-4637"><a href="#L-4637"><span class="linenos">4637</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-4638"><a href="#L-4638"><span class="linenos">4638</span></a> </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><span id="L-4641"><a href="#L-4641"><span class="linenos">4641</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-4640"><a href="#L-4640"><span class="linenos">4640</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-4641"><a href="#L-4641"><span class="linenos">4641</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">type</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">str</span> <span class="k">else</span> <span class="n">arg</span> </span><span id="L-4642"><a href="#L-4642"><span class="linenos">4642</span></a> </span><span id="L-4643"><a href="#L-4643"><span class="linenos">4643</span></a> -</span><span id="L-4644"><a href="#L-4644"><span class="linenos">4644</span></a><span class="c1"># Helpers</span> -</span><span id="L-4645"><a href="#L-4645"><span class="linenos">4645</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="L-4646"><a href="#L-4646"><span class="linenos">4646</span></a><span class="k">def</span> <span class="nf">maybe_parse</span><span class="p">(</span> -</span><span id="L-4647"><a href="#L-4647"><span class="linenos">4647</span></a> <span class="n">sql_or_expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-4648"><a href="#L-4648"><span class="linenos">4648</span></a> <span class="o">*</span><span class="p">,</span> -</span><span id="L-4649"><a href="#L-4649"><span class="linenos">4649</span></a> <span class="n">into</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">E</span><span class="p">],</span> -</span><span id="L-4650"><a href="#L-4650"><span class="linenos">4650</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-4651"><a href="#L-4651"><span class="linenos">4651</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-4652"><a href="#L-4652"><span class="linenos">4652</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-4653"><a href="#L-4653"><span class="linenos">4653</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4654"><a href="#L-4654"><span class="linenos">4654</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> -</span><span id="L-4655"><a href="#L-4655"><span class="linenos">4655</span></a> <span class="o">...</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><span id="L-4658"><a href="#L-4658"><span class="linenos">4658</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="L-4659"><a href="#L-4659"><span class="linenos">4659</span></a><span class="k">def</span> <span class="nf">maybe_parse</span><span class="p">(</span> -</span><span id="L-4660"><a href="#L-4660"><span class="linenos">4660</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">E</span><span class="p">,</span> -</span><span id="L-4661"><a href="#L-4661"><span class="linenos">4661</span></a> <span class="o">*</span><span class="p">,</span> -</span><span id="L-4662"><a href="#L-4662"><span class="linenos">4662</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-4663"><a href="#L-4663"><span class="linenos">4663</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-4664"><a href="#L-4664"><span class="linenos">4664</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-4665"><a href="#L-4665"><span class="linenos">4665</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-4666"><a href="#L-4666"><span class="linenos">4666</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4667"><a href="#L-4667"><span class="linenos">4667</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> -</span><span id="L-4668"><a href="#L-4668"><span class="linenos">4668</span></a> <span class="o">...</span> -</span><span id="L-4669"><a href="#L-4669"><span class="linenos">4669</span></a> -</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">def</span> <span class="nf">maybe_parse</span><span class="p">(</span> -</span><span id="L-4672"><a href="#L-4672"><span class="linenos">4672</span></a> <span class="n">sql_or_expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-4673"><a href="#L-4673"><span class="linenos">4673</span></a> <span class="o">*</span><span class="p">,</span> -</span><span id="L-4674"><a href="#L-4674"><span class="linenos">4674</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-4675"><a href="#L-4675"><span class="linenos">4675</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-4676"><a href="#L-4676"><span class="linenos">4676</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-4677"><a href="#L-4677"><span class="linenos">4677</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-4678"><a href="#L-4678"><span class="linenos">4678</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4679"><a href="#L-4679"><span class="linenos">4679</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="L-4680"><a href="#L-4680"><span class="linenos">4680</span></a><span class="w"> </span><span class="sd">"""Gracefully handle a possible string or expression.</span> -</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="sd"> Example:</span> -</span><span id="L-4683"><a href="#L-4683"><span class="linenos">4683</span></a><span class="sd"> >>> maybe_parse("1")</span> -</span><span id="L-4684"><a href="#L-4684"><span class="linenos">4684</span></a><span class="sd"> (LITERAL this: 1, is_string: False)</span> -</span><span id="L-4685"><a href="#L-4685"><span class="linenos">4685</span></a><span class="sd"> >>> maybe_parse(to_identifier("x"))</span> -</span><span id="L-4686"><a href="#L-4686"><span class="linenos">4686</span></a><span class="sd"> (IDENTIFIER this: x, quoted: False)</span> -</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="sd"> Args:</span> -</span><span id="L-4689"><a href="#L-4689"><span class="linenos">4689</span></a><span class="sd"> sql_or_expression: the SQL code string or an expression</span> -</span><span id="L-4690"><a href="#L-4690"><span class="linenos">4690</span></a><span class="sd"> into: the SQLGlot Expression to parse into</span> -</span><span id="L-4691"><a href="#L-4691"><span class="linenos">4691</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> -</span><span id="L-4692"><a href="#L-4692"><span class="linenos">4692</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="L-4693"><a href="#L-4693"><span class="linenos">4693</span></a><span class="sd"> prefix: a string to prefix the sql with before it gets parsed</span> -</span><span id="L-4694"><a href="#L-4694"><span class="linenos">4694</span></a><span class="sd"> (automatically includes a space)</span> -</span><span id="L-4695"><a href="#L-4695"><span class="linenos">4695</span></a><span class="sd"> copy: whether or not to copy the expression.</span> -</span><span id="L-4696"><a href="#L-4696"><span class="linenos">4696</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="L-4697"><a href="#L-4697"><span class="linenos">4697</span></a><span class="sd"> that an input expression is a SQL string).</span> -</span><span id="L-4698"><a href="#L-4698"><span class="linenos">4698</span></a> -</span><span id="L-4699"><a href="#L-4699"><span class="linenos">4699</span></a><span class="sd"> Returns:</span> -</span><span id="L-4700"><a href="#L-4700"><span class="linenos">4700</span></a><span class="sd"> Expression: the parsed or given expression.</span> -</span><span id="L-4701"><a href="#L-4701"><span class="linenos">4701</span></a><span class="sd"> """</span> -</span><span id="L-4702"><a href="#L-4702"><span class="linenos">4702</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-4703"><a href="#L-4703"><span class="linenos">4703</span></a> <span class="k">if</span> <span class="n">copy</span><span class="p">:</span> -</span><span id="L-4704"><a href="#L-4704"><span class="linenos">4704</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-4705"><a href="#L-4705"><span class="linenos">4705</span></a> <span class="k">return</span> <span class="n">sql_or_expression</span> -</span><span id="L-4706"><a href="#L-4706"><span class="linenos">4706</span></a> -</span><span id="L-4707"><a href="#L-4707"><span class="linenos">4707</span></a> <span class="k">if</span> <span class="n">sql_or_expression</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> -</span><span id="L-4708"><a href="#L-4708"><span class="linenos">4708</span></a> <span class="k">raise</span> <span class="n">ParseError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"SQL cannot be None"</span><span class="p">)</span> +</span><span id="L-4644"><a href="#L-4644"><span class="linenos">4644</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-4645"><a href="#L-4645"><span class="linenos">4645</span></a> +</span><span id="L-4646"><a href="#L-4646"><span class="linenos">4646</span></a> +</span><span id="L-4647"><a href="#L-4647"><span class="linenos">4647</span></a><span class="c1"># Helpers</span> +</span><span id="L-4648"><a href="#L-4648"><span class="linenos">4648</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> +</span><span id="L-4649"><a href="#L-4649"><span class="linenos">4649</span></a><span class="k">def</span> <span class="nf">maybe_parse</span><span class="p">(</span> +</span><span id="L-4650"><a href="#L-4650"><span class="linenos">4650</span></a> <span class="n">sql_or_expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-4651"><a href="#L-4651"><span class="linenos">4651</span></a> <span class="o">*</span><span class="p">,</span> +</span><span id="L-4652"><a href="#L-4652"><span class="linenos">4652</span></a> <span class="n">into</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">E</span><span class="p">],</span> +</span><span id="L-4653"><a href="#L-4653"><span class="linenos">4653</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-4654"><a href="#L-4654"><span class="linenos">4654</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-4655"><a href="#L-4655"><span class="linenos">4655</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-4656"><a href="#L-4656"><span class="linenos">4656</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4657"><a href="#L-4657"><span class="linenos">4657</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="L-4658"><a href="#L-4658"><span class="linenos">4658</span></a> <span class="o">...</span> +</span><span id="L-4659"><a href="#L-4659"><span class="linenos">4659</span></a> +</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="nd">@t</span><span class="o">.</span><span class="n">overload</span> +</span><span id="L-4662"><a href="#L-4662"><span class="linenos">4662</span></a><span class="k">def</span> <span class="nf">maybe_parse</span><span class="p">(</span> +</span><span id="L-4663"><a href="#L-4663"><span class="linenos">4663</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">E</span><span class="p">,</span> +</span><span id="L-4664"><a href="#L-4664"><span class="linenos">4664</span></a> <span class="o">*</span><span class="p">,</span> +</span><span id="L-4665"><a href="#L-4665"><span class="linenos">4665</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-4666"><a href="#L-4666"><span class="linenos">4666</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-4667"><a href="#L-4667"><span class="linenos">4667</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-4668"><a href="#L-4668"><span class="linenos">4668</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-4669"><a href="#L-4669"><span class="linenos">4669</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4670"><a href="#L-4670"><span class="linenos">4670</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="L-4671"><a href="#L-4671"><span class="linenos">4671</span></a> <span class="o">...</span> +</span><span id="L-4672"><a href="#L-4672"><span class="linenos">4672</span></a> +</span><span id="L-4673"><a href="#L-4673"><span class="linenos">4673</span></a> +</span><span id="L-4674"><a href="#L-4674"><span class="linenos">4674</span></a><span class="k">def</span> <span class="nf">maybe_parse</span><span class="p">(</span> +</span><span id="L-4675"><a href="#L-4675"><span class="linenos">4675</span></a> <span class="n">sql_or_expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-4676"><a href="#L-4676"><span class="linenos">4676</span></a> <span class="o">*</span><span class="p">,</span> +</span><span id="L-4677"><a href="#L-4677"><span class="linenos">4677</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-4678"><a href="#L-4678"><span class="linenos">4678</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-4679"><a href="#L-4679"><span class="linenos">4679</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-4680"><a href="#L-4680"><span class="linenos">4680</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-4681"><a href="#L-4681"><span class="linenos">4681</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4682"><a href="#L-4682"><span class="linenos">4682</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</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">"""Gracefully handle a possible string or expression.</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="sd"> Example:</span> +</span><span id="L-4686"><a href="#L-4686"><span class="linenos">4686</span></a><span class="sd"> >>> maybe_parse("1")</span> +</span><span id="L-4687"><a href="#L-4687"><span class="linenos">4687</span></a><span class="sd"> (LITERAL this: 1, is_string: False)</span> +</span><span id="L-4688"><a href="#L-4688"><span class="linenos">4688</span></a><span class="sd"> >>> maybe_parse(to_identifier("x"))</span> +</span><span id="L-4689"><a href="#L-4689"><span class="linenos">4689</span></a><span class="sd"> (IDENTIFIER this: x, quoted: False)</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"> Args:</span> +</span><span id="L-4692"><a href="#L-4692"><span class="linenos">4692</span></a><span class="sd"> sql_or_expression: the SQL code string or an expression</span> +</span><span id="L-4693"><a href="#L-4693"><span class="linenos">4693</span></a><span class="sd"> into: the SQLGlot Expression to parse into</span> +</span><span id="L-4694"><a href="#L-4694"><span class="linenos">4694</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> +</span><span id="L-4695"><a href="#L-4695"><span class="linenos">4695</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="L-4696"><a href="#L-4696"><span class="linenos">4696</span></a><span class="sd"> prefix: a string to prefix the sql with before it gets parsed</span> +</span><span id="L-4697"><a href="#L-4697"><span class="linenos">4697</span></a><span class="sd"> (automatically includes a space)</span> +</span><span id="L-4698"><a href="#L-4698"><span class="linenos">4698</span></a><span class="sd"> copy: whether or not to copy the expression.</span> +</span><span id="L-4699"><a href="#L-4699"><span class="linenos">4699</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="L-4700"><a href="#L-4700"><span class="linenos">4700</span></a><span class="sd"> that an input expression is a SQL string).</span> +</span><span id="L-4701"><a href="#L-4701"><span class="linenos">4701</span></a> +</span><span id="L-4702"><a href="#L-4702"><span class="linenos">4702</span></a><span class="sd"> Returns:</span> +</span><span id="L-4703"><a href="#L-4703"><span class="linenos">4703</span></a><span class="sd"> Expression: the parsed or given expression.</span> +</span><span id="L-4704"><a href="#L-4704"><span class="linenos">4704</span></a><span class="sd"> """</span> +</span><span id="L-4705"><a href="#L-4705"><span class="linenos">4705</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-4706"><a href="#L-4706"><span class="linenos">4706</span></a> <span class="k">if</span> <span class="n">copy</span><span class="p">:</span> +</span><span id="L-4707"><a href="#L-4707"><span class="linenos">4707</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-4708"><a href="#L-4708"><span class="linenos">4708</span></a> <span class="k">return</span> <span class="n">sql_or_expression</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 class="kn">import</span> <span class="nn">sqlglot</span> -</span><span id="L-4711"><a href="#L-4711"><span class="linenos">4711</span></a> -</span><span id="L-4712"><a href="#L-4712"><span class="linenos">4712</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-4713"><a href="#L-4713"><span class="linenos">4713</span></a> <span class="k">if</span> <span class="n">prefix</span><span class="p">:</span> -</span><span id="L-4714"><a href="#L-4714"><span class="linenos">4714</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-4715"><a href="#L-4715"><span class="linenos">4715</span></a> -</span><span id="L-4716"><a href="#L-4716"><span class="linenos">4716</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-4717"><a href="#L-4717"><span class="linenos">4717</span></a> +</span><span id="L-4710"><a href="#L-4710"><span class="linenos">4710</span></a> <span class="k">if</span> <span class="n">sql_or_expression</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-4711"><a href="#L-4711"><span class="linenos">4711</span></a> <span class="k">raise</span> <span class="n">ParseError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"SQL cannot be None"</span><span class="p">)</span> +</span><span id="L-4712"><a href="#L-4712"><span class="linenos">4712</span></a> +</span><span id="L-4713"><a href="#L-4713"><span class="linenos">4713</span></a> <span class="kn">import</span> <span class="nn">sqlglot</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="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-4716"><a href="#L-4716"><span class="linenos">4716</span></a> <span class="k">if</span> <span class="n">prefix</span><span class="p">:</span> +</span><span id="L-4717"><a href="#L-4717"><span class="linenos">4717</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-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="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">E</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">E</span><span class="p">:</span> -</span><span id="L-4720"><a href="#L-4720"><span class="linenos">4720</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-4719"><a href="#L-4719"><span class="linenos">4719</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-4720"><a href="#L-4720"><span class="linenos">4720</span></a> </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><span id="L-4723"><a href="#L-4723"><span class="linenos">4723</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-4724"><a href="#L-4724"><span class="linenos">4724</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-4722"><a href="#L-4722"><span class="linenos">4722</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">E</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">E</span><span class="p">:</span> +</span><span id="L-4723"><a href="#L-4723"><span class="linenos">4723</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-4724"><a href="#L-4724"><span class="linenos">4724</span></a> </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><span id="L-4727"><a href="#L-4727"><span class="linenos">4727</span></a><span class="k">def</span> <span class="nf">_apply_builder</span><span class="p">(</span> -</span><span id="L-4728"><a href="#L-4728"><span class="linenos">4728</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="L-4729"><a href="#L-4729"><span class="linenos">4729</span></a> <span class="n">instance</span><span class="p">,</span> -</span><span id="L-4730"><a href="#L-4730"><span class="linenos">4730</span></a> <span class="n">arg</span><span class="p">,</span> -</span><span id="L-4731"><a href="#L-4731"><span class="linenos">4731</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-4732"><a href="#L-4732"><span class="linenos">4732</span></a> <span class="n">prefix</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-4733"><a href="#L-4733"><span class="linenos">4733</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-4734"><a href="#L-4734"><span class="linenos">4734</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-4735"><a href="#L-4735"><span class="linenos">4735</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4736"><a href="#L-4736"><span class="linenos">4736</span></a><span class="p">):</span> -</span><span id="L-4737"><a href="#L-4737"><span class="linenos">4737</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-4738"><a href="#L-4738"><span class="linenos">4738</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-4739"><a href="#L-4739"><span class="linenos">4739</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-4740"><a href="#L-4740"><span class="linenos">4740</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-4741"><a href="#L-4741"><span class="linenos">4741</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-4742"><a href="#L-4742"><span class="linenos">4742</span></a> <span class="n">prefix</span><span class="o">=</span><span class="n">prefix</span><span class="p">,</span> -</span><span id="L-4743"><a href="#L-4743"><span class="linenos">4743</span></a> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> -</span><span id="L-4744"><a href="#L-4744"><span class="linenos">4744</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-4745"><a href="#L-4745"><span class="linenos">4745</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4746"><a href="#L-4746"><span class="linenos">4746</span></a> <span class="p">)</span> -</span><span id="L-4747"><a href="#L-4747"><span class="linenos">4747</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-4748"><a href="#L-4748"><span class="linenos">4748</span></a> <span class="k">return</span> <span class="n">instance</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><span id="L-4751"><a href="#L-4751"><span class="linenos">4751</span></a><span class="k">def</span> <span class="nf">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-4752"><a href="#L-4752"><span class="linenos">4752</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-4753"><a href="#L-4753"><span class="linenos">4753</span></a> <span class="n">instance</span><span class="p">,</span> -</span><span id="L-4754"><a href="#L-4754"><span class="linenos">4754</span></a> <span class="n">arg</span><span class="p">,</span> -</span><span id="L-4755"><a href="#L-4755"><span class="linenos">4755</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-4756"><a href="#L-4756"><span class="linenos">4756</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-4757"><a href="#L-4757"><span class="linenos">4757</span></a> <span class="n">prefix</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-4758"><a href="#L-4758"><span class="linenos">4758</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-4759"><a href="#L-4759"><span class="linenos">4759</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-4760"><a href="#L-4760"><span class="linenos">4760</span></a> <span class="n">properties</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-4761"><a href="#L-4761"><span class="linenos">4761</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4762"><a href="#L-4762"><span class="linenos">4762</span></a><span class="p">):</span> -</span><span id="L-4763"><a href="#L-4763"><span class="linenos">4763</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-4764"><a href="#L-4764"><span class="linenos">4764</span></a> <span class="n">parsed</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="L-4765"><a href="#L-4765"><span class="linenos">4765</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-4766"><a href="#L-4766"><span class="linenos">4766</span></a> <span class="k">if</span> <span class="n">expression</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</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">_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-4768"><a href="#L-4768"><span class="linenos">4768</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-4769"><a href="#L-4769"><span class="linenos">4769</span></a> -</span><span id="L-4770"><a href="#L-4770"><span class="linenos">4770</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-4771"><a href="#L-4771"><span class="linenos">4771</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="L-4772"><a href="#L-4772"><span class="linenos">4772</span></a> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> -</span><span id="L-4773"><a href="#L-4773"><span class="linenos">4773</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-4774"><a href="#L-4774"><span class="linenos">4774</span></a> <span class="n">prefix</span><span class="o">=</span><span class="n">prefix</span><span class="p">,</span> -</span><span id="L-4775"><a href="#L-4775"><span class="linenos">4775</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4776"><a href="#L-4776"><span class="linenos">4776</span></a> <span class="p">)</span> -</span><span id="L-4777"><a href="#L-4777"><span class="linenos">4777</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-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="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-4780"><a href="#L-4780"><span class="linenos">4780</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-4781"><a href="#L-4781"><span class="linenos">4781</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-4782"><a href="#L-4782"><span class="linenos">4782</span></a> -</span><span id="L-4783"><a href="#L-4783"><span class="linenos">4783</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-4784"><a href="#L-4784"><span class="linenos">4784</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-4785"><a href="#L-4785"><span class="linenos">4785</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-4786"><a href="#L-4786"><span class="linenos">4786</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-4787"><a href="#L-4787"><span class="linenos">4787</span></a> -</span><span id="L-4788"><a href="#L-4788"><span class="linenos">4788</span></a> <span class="k">return</span> <span class="n">instance</span> -</span><span id="L-4789"><a href="#L-4789"><span class="linenos">4789</span></a> +</span><span id="L-4726"><a href="#L-4726"><span class="linenos">4726</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-4727"><a href="#L-4727"><span class="linenos">4727</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-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><span id="L-4730"><a href="#L-4730"><span class="linenos">4730</span></a><span class="k">def</span> <span class="nf">_apply_builder</span><span class="p">(</span> +</span><span id="L-4731"><a href="#L-4731"><span class="linenos">4731</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="L-4732"><a href="#L-4732"><span class="linenos">4732</span></a> <span class="n">instance</span><span class="p">,</span> +</span><span id="L-4733"><a href="#L-4733"><span class="linenos">4733</span></a> <span class="n">arg</span><span class="p">,</span> +</span><span id="L-4734"><a href="#L-4734"><span class="linenos">4734</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-4735"><a href="#L-4735"><span class="linenos">4735</span></a> <span class="n">prefix</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-4736"><a href="#L-4736"><span class="linenos">4736</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-4737"><a href="#L-4737"><span class="linenos">4737</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-4738"><a href="#L-4738"><span class="linenos">4738</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4739"><a href="#L-4739"><span class="linenos">4739</span></a><span class="p">):</span> +</span><span id="L-4740"><a href="#L-4740"><span class="linenos">4740</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-4741"><a href="#L-4741"><span class="linenos">4741</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-4742"><a href="#L-4742"><span class="linenos">4742</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-4743"><a href="#L-4743"><span class="linenos">4743</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-4744"><a href="#L-4744"><span class="linenos">4744</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-4745"><a href="#L-4745"><span class="linenos">4745</span></a> <span class="n">prefix</span><span class="o">=</span><span class="n">prefix</span><span class="p">,</span> +</span><span id="L-4746"><a href="#L-4746"><span class="linenos">4746</span></a> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> +</span><span id="L-4747"><a href="#L-4747"><span class="linenos">4747</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-4748"><a href="#L-4748"><span class="linenos">4748</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4749"><a href="#L-4749"><span class="linenos">4749</span></a> <span class="p">)</span> +</span><span id="L-4750"><a href="#L-4750"><span class="linenos">4750</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-4751"><a href="#L-4751"><span class="linenos">4751</span></a> <span class="k">return</span> <span class="n">instance</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><span id="L-4754"><a href="#L-4754"><span class="linenos">4754</span></a><span class="k">def</span> <span class="nf">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-4755"><a href="#L-4755"><span class="linenos">4755</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-4756"><a href="#L-4756"><span class="linenos">4756</span></a> <span class="n">instance</span><span class="p">,</span> +</span><span id="L-4757"><a href="#L-4757"><span class="linenos">4757</span></a> <span class="n">arg</span><span class="p">,</span> +</span><span id="L-4758"><a href="#L-4758"><span class="linenos">4758</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-4759"><a href="#L-4759"><span class="linenos">4759</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-4760"><a href="#L-4760"><span class="linenos">4760</span></a> <span class="n">prefix</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-4761"><a href="#L-4761"><span class="linenos">4761</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-4762"><a href="#L-4762"><span class="linenos">4762</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-4763"><a href="#L-4763"><span class="linenos">4763</span></a> <span class="n">properties</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-4764"><a href="#L-4764"><span class="linenos">4764</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4765"><a href="#L-4765"><span class="linenos">4765</span></a><span class="p">):</span> +</span><span id="L-4766"><a href="#L-4766"><span class="linenos">4766</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-4767"><a href="#L-4767"><span class="linenos">4767</span></a> <span class="n">parsed</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="L-4768"><a href="#L-4768"><span class="linenos">4768</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-4769"><a href="#L-4769"><span class="linenos">4769</span></a> <span class="k">if</span> <span class="n">expression</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-4770"><a href="#L-4770"><span class="linenos">4770</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-4771"><a href="#L-4771"><span class="linenos">4771</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-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="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="L-4774"><a href="#L-4774"><span class="linenos">4774</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="L-4775"><a href="#L-4775"><span class="linenos">4775</span></a> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> +</span><span id="L-4776"><a href="#L-4776"><span class="linenos">4776</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-4777"><a href="#L-4777"><span class="linenos">4777</span></a> <span class="n">prefix</span><span class="o">=</span><span class="n">prefix</span><span class="p">,</span> +</span><span id="L-4778"><a href="#L-4778"><span class="linenos">4778</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4779"><a href="#L-4779"><span class="linenos">4779</span></a> <span class="p">)</span> +</span><span id="L-4780"><a href="#L-4780"><span class="linenos">4780</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-4781"><a href="#L-4781"><span class="linenos">4781</span></a> +</span><span id="L-4782"><a href="#L-4782"><span class="linenos">4782</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-4783"><a href="#L-4783"><span class="linenos">4783</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-4784"><a href="#L-4784"><span class="linenos">4784</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-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="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-4787"><a href="#L-4787"><span class="linenos">4787</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-4788"><a href="#L-4788"><span class="linenos">4788</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-4789"><a href="#L-4789"><span class="linenos">4789</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-4790"><a href="#L-4790"><span class="linenos">4790</span></a> -</span><span id="L-4791"><a href="#L-4791"><span class="linenos">4791</span></a><span class="k">def</span> <span class="nf">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-4792"><a href="#L-4792"><span class="linenos">4792</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-4793"><a href="#L-4793"><span class="linenos">4793</span></a> <span class="n">instance</span><span class="p">,</span> -</span><span id="L-4794"><a href="#L-4794"><span class="linenos">4794</span></a> <span class="n">arg</span><span class="p">,</span> -</span><span id="L-4795"><a href="#L-4795"><span class="linenos">4795</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-4796"><a href="#L-4796"><span class="linenos">4796</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-4797"><a href="#L-4797"><span class="linenos">4797</span></a> <span class="n">prefix</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-4798"><a href="#L-4798"><span class="linenos">4798</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-4799"><a href="#L-4799"><span class="linenos">4799</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-4800"><a href="#L-4800"><span class="linenos">4800</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4801"><a href="#L-4801"><span class="linenos">4801</span></a><span class="p">):</span> -</span><span id="L-4802"><a href="#L-4802"><span class="linenos">4802</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-4803"><a href="#L-4803"><span class="linenos">4803</span></a> -</span><span id="L-4804"><a href="#L-4804"><span class="linenos">4804</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span> -</span><span id="L-4805"><a href="#L-4805"><span class="linenos">4805</span></a> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="L-4806"><a href="#L-4806"><span class="linenos">4806</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-4807"><a href="#L-4807"><span class="linenos">4807</span></a> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> -</span><span id="L-4808"><a href="#L-4808"><span class="linenos">4808</span></a> <span class="n">prefix</span><span class="o">=</span><span class="n">prefix</span><span class="p">,</span> -</span><span id="L-4809"><a href="#L-4809"><span class="linenos">4809</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-4810"><a href="#L-4810"><span class="linenos">4810</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4811"><a href="#L-4811"><span class="linenos">4811</span></a> <span class="p">)</span> -</span><span id="L-4812"><a href="#L-4812"><span class="linenos">4812</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-4813"><a href="#L-4813"><span class="linenos">4813</span></a> <span class="k">if</span> <span class="n">expression</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> -</span><span id="L-4814"><a href="#L-4814"><span class="linenos">4814</span></a> <span class="p">]</span> -</span><span id="L-4815"><a href="#L-4815"><span class="linenos">4815</span></a> -</span><span id="L-4816"><a href="#L-4816"><span class="linenos">4816</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-4817"><a href="#L-4817"><span class="linenos">4817</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-4818"><a href="#L-4818"><span class="linenos">4818</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-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="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-4821"><a href="#L-4821"><span class="linenos">4821</span></a> <span class="k">return</span> <span class="n">inst</span> +</span><span id="L-4791"><a href="#L-4791"><span class="linenos">4791</span></a> <span class="k">return</span> <span class="n">instance</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><span id="L-4794"><a href="#L-4794"><span class="linenos">4794</span></a><span class="k">def</span> <span class="nf">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-4795"><a href="#L-4795"><span class="linenos">4795</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-4796"><a href="#L-4796"><span class="linenos">4796</span></a> <span class="n">instance</span><span class="p">,</span> +</span><span id="L-4797"><a href="#L-4797"><span class="linenos">4797</span></a> <span class="n">arg</span><span class="p">,</span> +</span><span id="L-4798"><a href="#L-4798"><span class="linenos">4798</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-4799"><a href="#L-4799"><span class="linenos">4799</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-4800"><a href="#L-4800"><span class="linenos">4800</span></a> <span class="n">prefix</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-4801"><a href="#L-4801"><span class="linenos">4801</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-4802"><a href="#L-4802"><span class="linenos">4802</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-4803"><a href="#L-4803"><span class="linenos">4803</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4804"><a href="#L-4804"><span class="linenos">4804</span></a><span class="p">):</span> +</span><span id="L-4805"><a href="#L-4805"><span class="linenos">4805</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-4806"><a href="#L-4806"><span class="linenos">4806</span></a> +</span><span id="L-4807"><a href="#L-4807"><span class="linenos">4807</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span> +</span><span id="L-4808"><a href="#L-4808"><span class="linenos">4808</span></a> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="L-4809"><a href="#L-4809"><span class="linenos">4809</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-4810"><a href="#L-4810"><span class="linenos">4810</span></a> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> +</span><span id="L-4811"><a href="#L-4811"><span class="linenos">4811</span></a> <span class="n">prefix</span><span class="o">=</span><span class="n">prefix</span><span class="p">,</span> +</span><span id="L-4812"><a href="#L-4812"><span class="linenos">4812</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-4813"><a href="#L-4813"><span class="linenos">4813</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4814"><a href="#L-4814"><span class="linenos">4814</span></a> <span class="p">)</span> +</span><span id="L-4815"><a href="#L-4815"><span class="linenos">4815</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-4816"><a href="#L-4816"><span class="linenos">4816</span></a> <span class="k">if</span> <span class="n">expression</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> +</span><span id="L-4817"><a href="#L-4817"><span class="linenos">4817</span></a> <span class="p">]</span> +</span><span id="L-4818"><a href="#L-4818"><span class="linenos">4818</span></a> +</span><span id="L-4819"><a href="#L-4819"><span class="linenos">4819</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-4820"><a href="#L-4820"><span class="linenos">4820</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-4821"><a href="#L-4821"><span class="linenos">4821</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-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><span id="L-4824"><a href="#L-4824"><span class="linenos">4824</span></a><span class="k">def</span> <span class="nf">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="L-4825"><a href="#L-4825"><span class="linenos">4825</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-4826"><a href="#L-4826"><span class="linenos">4826</span></a> <span class="n">instance</span><span class="p">,</span> -</span><span id="L-4827"><a href="#L-4827"><span class="linenos">4827</span></a> <span class="n">arg</span><span class="p">,</span> -</span><span id="L-4828"><a href="#L-4828"><span class="linenos">4828</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-4829"><a href="#L-4829"><span class="linenos">4829</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-4830"><a href="#L-4830"><span class="linenos">4830</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-4831"><a href="#L-4831"><span class="linenos">4831</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-4832"><a href="#L-4832"><span class="linenos">4832</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4833"><a href="#L-4833"><span class="linenos">4833</span></a><span class="p">):</span> -</span><span id="L-4834"><a href="#L-4834"><span class="linenos">4834</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-4835"><a href="#L-4835"><span class="linenos">4835</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-4836"><a href="#L-4836"><span class="linenos">4836</span></a> <span class="k">return</span> <span class="n">instance</span> -</span><span id="L-4837"><a href="#L-4837"><span class="linenos">4837</span></a> -</span><span id="L-4838"><a href="#L-4838"><span class="linenos">4838</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-4839"><a href="#L-4839"><span class="linenos">4839</span></a> -</span><span id="L-4840"><a href="#L-4840"><span class="linenos">4840</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-4841"><a href="#L-4841"><span class="linenos">4841</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-4842"><a href="#L-4842"><span class="linenos">4842</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-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="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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-4845"><a href="#L-4845"><span class="linenos">4845</span></a> -</span><span id="L-4846"><a href="#L-4846"><span class="linenos">4846</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-4847"><a href="#L-4847"><span class="linenos">4847</span></a> <span class="k">return</span> <span class="n">inst</span> +</span><span id="L-4823"><a href="#L-4823"><span class="linenos">4823</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-4824"><a href="#L-4824"><span class="linenos">4824</span></a> <span class="k">return</span> <span class="n">inst</span> +</span><span id="L-4825"><a href="#L-4825"><span class="linenos">4825</span></a> +</span><span id="L-4826"><a href="#L-4826"><span class="linenos">4826</span></a> +</span><span id="L-4827"><a href="#L-4827"><span class="linenos">4827</span></a><span class="k">def</span> <span class="nf">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="L-4828"><a href="#L-4828"><span class="linenos">4828</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-4829"><a href="#L-4829"><span class="linenos">4829</span></a> <span class="n">instance</span><span class="p">,</span> +</span><span id="L-4830"><a href="#L-4830"><span class="linenos">4830</span></a> <span class="n">arg</span><span class="p">,</span> +</span><span id="L-4831"><a href="#L-4831"><span class="linenos">4831</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-4832"><a href="#L-4832"><span class="linenos">4832</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-4833"><a href="#L-4833"><span class="linenos">4833</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-4834"><a href="#L-4834"><span class="linenos">4834</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-4835"><a href="#L-4835"><span class="linenos">4835</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4836"><a href="#L-4836"><span class="linenos">4836</span></a><span class="p">):</span> +</span><span id="L-4837"><a href="#L-4837"><span class="linenos">4837</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-4838"><a href="#L-4838"><span class="linenos">4838</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-4839"><a href="#L-4839"><span class="linenos">4839</span></a> <span class="k">return</span> <span class="n">instance</span> +</span><span id="L-4840"><a href="#L-4840"><span class="linenos">4840</span></a> +</span><span id="L-4841"><a href="#L-4841"><span class="linenos">4841</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-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 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-4844"><a href="#L-4844"><span class="linenos">4844</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-4845"><a href="#L-4845"><span class="linenos">4845</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-4846"><a href="#L-4846"><span class="linenos">4846</span></a> +</span><span id="L-4847"><a href="#L-4847"><span class="linenos">4847</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span><span id="L-4848"><a href="#L-4848"><span class="linenos">4848</span></a> -</span><span id="L-4849"><a href="#L-4849"><span class="linenos">4849</span></a> -</span><span id="L-4850"><a href="#L-4850"><span class="linenos">4850</span></a><span class="k">def</span> <span class="nf">_apply_cte_builder</span><span class="p">(</span> -</span><span id="L-4851"><a href="#L-4851"><span class="linenos">4851</span></a> <span class="n">instance</span><span class="p">:</span> <span class="n">E</span><span class="p">,</span> -</span><span id="L-4852"><a href="#L-4852"><span class="linenos">4852</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-4853"><a href="#L-4853"><span class="linenos">4853</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-4854"><a href="#L-4854"><span class="linenos">4854</span></a> <span class="n">recursive</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-4855"><a href="#L-4855"><span class="linenos">4855</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-4856"><a href="#L-4856"><span class="linenos">4856</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-4857"><a href="#L-4857"><span class="linenos">4857</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-4858"><a href="#L-4858"><span class="linenos">4858</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4859"><a href="#L-4859"><span class="linenos">4859</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> -</span><span id="L-4860"><a href="#L-4860"><span class="linenos">4860</span></a> <span class="n">alias_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">alias</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">into</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-4861"><a href="#L-4861"><span class="linenos">4861</span></a> <span class="n">as_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">as_</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-4862"><a href="#L-4862"><span class="linenos">4862</span></a> <span class="n">cte</span> <span class="o">=</span> <span class="n">CTE</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">as_expression</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="n">alias_expression</span><span class="p">)</span> -</span><span id="L-4863"><a href="#L-4863"><span class="linenos">4863</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-4864"><a href="#L-4864"><span class="linenos">4864</span></a> <span class="n">cte</span><span class="p">,</span> -</span><span id="L-4865"><a href="#L-4865"><span class="linenos">4865</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> -</span><span id="L-4866"><a href="#L-4866"><span class="linenos">4866</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"with"</span><span class="p">,</span> -</span><span id="L-4867"><a href="#L-4867"><span class="linenos">4867</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-4868"><a href="#L-4868"><span class="linenos">4868</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-4869"><a href="#L-4869"><span class="linenos">4869</span></a> <span class="n">into</span><span class="o">=</span><span class="n">With</span><span class="p">,</span> -</span><span id="L-4870"><a href="#L-4870"><span class="linenos">4870</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-4871"><a href="#L-4871"><span class="linenos">4871</span></a> <span class="p">)</span> -</span><span id="L-4872"><a href="#L-4872"><span class="linenos">4872</span></a> -</span><span id="L-4873"><a href="#L-4873"><span class="linenos">4873</span></a> -</span><span id="L-4874"><a href="#L-4874"><span class="linenos">4874</span></a><span class="k">def</span> <span class="nf">_combine</span><span class="p">(</span> -</span><span id="L-4875"><a href="#L-4875"><span class="linenos">4875</span></a> <span class="n">expressions</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="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]],</span> -</span><span id="L-4876"><a href="#L-4876"><span class="linenos">4876</span></a> <span class="n">operator</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">Connector</span><span class="p">],</span> -</span><span id="L-4877"><a href="#L-4877"><span class="linenos">4877</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-4878"><a href="#L-4878"><span class="linenos">4878</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-4879"><a href="#L-4879"><span class="linenos">4879</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4880"><a href="#L-4880"><span class="linenos">4880</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="L-4881"><a href="#L-4881"><span class="linenos">4881</span></a> <span class="n">conditions</span> <span class="o">=</span> <span class="p">[</span> -</span><span id="L-4882"><a href="#L-4882"><span class="linenos">4882</span></a> <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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-4883"><a href="#L-4883"><span class="linenos">4883</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-4884"><a href="#L-4884"><span class="linenos">4884</span></a> <span class="k">if</span> <span class="n">expression</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> -</span><span id="L-4885"><a href="#L-4885"><span class="linenos">4885</span></a> <span class="p">]</span> -</span><span id="L-4886"><a href="#L-4886"><span class="linenos">4886</span></a> -</span><span id="L-4887"><a href="#L-4887"><span class="linenos">4887</span></a> <span class="n">this</span><span class="p">,</span> <span class="o">*</span><span class="n">rest</span> <span class="o">=</span> <span class="n">conditions</span> -</span><span id="L-4888"><a href="#L-4888"><span class="linenos">4888</span></a> <span class="k">if</span> <span class="n">rest</span><span class="p">:</span> -</span><span id="L-4889"><a href="#L-4889"><span class="linenos">4889</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">_wrap</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">Connector</span><span class="p">)</span> -</span><span id="L-4890"><a href="#L-4890"><span class="linenos">4890</span></a> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="n">rest</span><span class="p">:</span> -</span><span id="L-4891"><a href="#L-4891"><span class="linenos">4891</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</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Connector</span><span class="p">))</span> -</span><span id="L-4892"><a href="#L-4892"><span class="linenos">4892</span></a> -</span><span id="L-4893"><a href="#L-4893"><span class="linenos">4893</span></a> <span class="k">return</span> <span class="n">this</span> -</span><span id="L-4894"><a href="#L-4894"><span class="linenos">4894</span></a> +</span><span id="L-4849"><a href="#L-4849"><span class="linenos">4849</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-4850"><a href="#L-4850"><span class="linenos">4850</span></a> <span class="k">return</span> <span class="n">inst</span> +</span><span id="L-4851"><a href="#L-4851"><span class="linenos">4851</span></a> +</span><span id="L-4852"><a href="#L-4852"><span class="linenos">4852</span></a> +</span><span id="L-4853"><a href="#L-4853"><span class="linenos">4853</span></a><span class="k">def</span> <span class="nf">_apply_cte_builder</span><span class="p">(</span> +</span><span id="L-4854"><a href="#L-4854"><span class="linenos">4854</span></a> <span class="n">instance</span><span class="p">:</span> <span class="n">E</span><span class="p">,</span> +</span><span id="L-4855"><a href="#L-4855"><span class="linenos">4855</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-4856"><a href="#L-4856"><span class="linenos">4856</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-4857"><a href="#L-4857"><span class="linenos">4857</span></a> <span class="n">recursive</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-4858"><a href="#L-4858"><span class="linenos">4858</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-4859"><a href="#L-4859"><span class="linenos">4859</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-4860"><a href="#L-4860"><span class="linenos">4860</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-4861"><a href="#L-4861"><span class="linenos">4861</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4862"><a href="#L-4862"><span class="linenos">4862</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="L-4863"><a href="#L-4863"><span class="linenos">4863</span></a> <span class="n">alias_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">alias</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">into</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-4864"><a href="#L-4864"><span class="linenos">4864</span></a> <span class="n">as_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">as_</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-4865"><a href="#L-4865"><span class="linenos">4865</span></a> <span class="n">cte</span> <span class="o">=</span> <span class="n">CTE</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">as_expression</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="n">alias_expression</span><span class="p">)</span> +</span><span id="L-4866"><a href="#L-4866"><span class="linenos">4866</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-4867"><a href="#L-4867"><span class="linenos">4867</span></a> <span class="n">cte</span><span class="p">,</span> +</span><span id="L-4868"><a href="#L-4868"><span class="linenos">4868</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> +</span><span id="L-4869"><a href="#L-4869"><span class="linenos">4869</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"with"</span><span class="p">,</span> +</span><span id="L-4870"><a href="#L-4870"><span class="linenos">4870</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-4871"><a href="#L-4871"><span class="linenos">4871</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-4872"><a href="#L-4872"><span class="linenos">4872</span></a> <span class="n">into</span><span class="o">=</span><span class="n">With</span><span class="p">,</span> +</span><span id="L-4873"><a href="#L-4873"><span class="linenos">4873</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-4874"><a href="#L-4874"><span class="linenos">4874</span></a> <span class="p">)</span> +</span><span id="L-4875"><a href="#L-4875"><span class="linenos">4875</span></a> +</span><span id="L-4876"><a href="#L-4876"><span class="linenos">4876</span></a> +</span><span id="L-4877"><a href="#L-4877"><span class="linenos">4877</span></a><span class="k">def</span> <span class="nf">_combine</span><span class="p">(</span> +</span><span id="L-4878"><a href="#L-4878"><span class="linenos">4878</span></a> <span class="n">expressions</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="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]],</span> +</span><span id="L-4879"><a href="#L-4879"><span class="linenos">4879</span></a> <span class="n">operator</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">Connector</span><span class="p">],</span> +</span><span id="L-4880"><a href="#L-4880"><span class="linenos">4880</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-4881"><a href="#L-4881"><span class="linenos">4881</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-4882"><a href="#L-4882"><span class="linenos">4882</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4883"><a href="#L-4883"><span class="linenos">4883</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="L-4884"><a href="#L-4884"><span class="linenos">4884</span></a> <span class="n">conditions</span> <span class="o">=</span> <span class="p">[</span> +</span><span id="L-4885"><a href="#L-4885"><span class="linenos">4885</span></a> <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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-4886"><a href="#L-4886"><span class="linenos">4886</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-4887"><a href="#L-4887"><span class="linenos">4887</span></a> <span class="k">if</span> <span class="n">expression</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> +</span><span id="L-4888"><a href="#L-4888"><span class="linenos">4888</span></a> <span class="p">]</span> +</span><span id="L-4889"><a href="#L-4889"><span class="linenos">4889</span></a> +</span><span id="L-4890"><a href="#L-4890"><span class="linenos">4890</span></a> <span class="n">this</span><span class="p">,</span> <span class="o">*</span><span class="n">rest</span> <span class="o">=</span> <span class="n">conditions</span> +</span><span id="L-4891"><a href="#L-4891"><span class="linenos">4891</span></a> <span class="k">if</span> <span class="n">rest</span><span class="p">:</span> +</span><span id="L-4892"><a href="#L-4892"><span class="linenos">4892</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">_wrap</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">Connector</span><span class="p">)</span> +</span><span id="L-4893"><a href="#L-4893"><span class="linenos">4893</span></a> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="n">rest</span><span class="p">:</span> +</span><span id="L-4894"><a href="#L-4894"><span class="linenos">4894</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</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Connector</span><span class="p">))</span> </span><span id="L-4895"><a href="#L-4895"><span class="linenos">4895</span></a> -</span><span id="L-4896"><a href="#L-4896"><span class="linenos">4896</span></a><span class="k">def</span> <span class="nf">_wrap</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="n">E</span><span class="p">,</span> <span class="n">kind</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 class="o">-></span> <span class="n">E</span> <span class="o">|</span> <span class="n">Paren</span><span class="p">:</span> -</span><span id="L-4897"><a href="#L-4897"><span class="linenos">4897</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 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">kind</span><span class="p">)</span> <span class="k">else</span> <span class="n">expression</span> +</span><span id="L-4896"><a href="#L-4896"><span class="linenos">4896</span></a> <span class="k">return</span> <span class="n">this</span> +</span><span id="L-4897"><a href="#L-4897"><span class="linenos">4897</span></a> </span><span id="L-4898"><a href="#L-4898"><span class="linenos">4898</span></a> -</span><span id="L-4899"><a href="#L-4899"><span class="linenos">4899</span></a> -</span><span id="L-4900"><a href="#L-4900"><span class="linenos">4900</span></a><span class="k">def</span> <span class="nf">union</span><span class="p">(</span> -</span><span id="L-4901"><a href="#L-4901"><span class="linenos">4901</span></a> <span class="n">left</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">right</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="L-4902"><a href="#L-4902"><span class="linenos">4902</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> -</span><span id="L-4903"><a href="#L-4903"><span class="linenos">4903</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4904"><a href="#L-4904"><span class="linenos">4904</span></a><span class="sd"> Initializes a syntax tree from one UNION expression.</span> -</span><span id="L-4905"><a href="#L-4905"><span class="linenos">4905</span></a> -</span><span id="L-4906"><a href="#L-4906"><span class="linenos">4906</span></a><span class="sd"> Example:</span> -</span><span id="L-4907"><a href="#L-4907"><span class="linenos">4907</span></a><span class="sd"> >>> union("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> -</span><span id="L-4908"><a href="#L-4908"><span class="linenos">4908</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> -</span><span id="L-4909"><a href="#L-4909"><span class="linenos">4909</span></a> -</span><span id="L-4910"><a href="#L-4910"><span class="linenos">4910</span></a><span class="sd"> Args:</span> -</span><span id="L-4911"><a href="#L-4911"><span class="linenos">4911</span></a><span class="sd"> left: the SQL code string corresponding to the left-hand side.</span> -</span><span id="L-4912"><a href="#L-4912"><span class="linenos">4912</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-4913"><a href="#L-4913"><span class="linenos">4913</span></a><span class="sd"> right: the SQL code string corresponding to the right-hand side.</span> -</span><span id="L-4914"><a href="#L-4914"><span class="linenos">4914</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-4915"><a href="#L-4915"><span class="linenos">4915</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="L-4916"><a href="#L-4916"><span class="linenos">4916</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-4917"><a href="#L-4917"><span class="linenos">4917</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-4918"><a href="#L-4918"><span class="linenos">4918</span></a> -</span><span id="L-4919"><a href="#L-4919"><span class="linenos">4919</span></a><span class="sd"> Returns:</span> -</span><span id="L-4920"><a href="#L-4920"><span class="linenos">4920</span></a><span class="sd"> The new Union instance.</span> -</span><span id="L-4921"><a href="#L-4921"><span class="linenos">4921</span></a><span class="sd"> """</span> -</span><span id="L-4922"><a href="#L-4922"><span class="linenos">4922</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-4923"><a href="#L-4923"><span class="linenos">4923</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-4924"><a href="#L-4924"><span class="linenos">4924</span></a> -</span><span id="L-4925"><a href="#L-4925"><span class="linenos">4925</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-4926"><a href="#L-4926"><span class="linenos">4926</span></a> +</span><span id="L-4899"><a href="#L-4899"><span class="linenos">4899</span></a><span class="k">def</span> <span class="nf">_wrap</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="n">E</span><span class="p">,</span> <span class="n">kind</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 class="o">-></span> <span class="n">E</span> <span class="o">|</span> <span class="n">Paren</span><span class="p">:</span> +</span><span id="L-4900"><a href="#L-4900"><span class="linenos">4900</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 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">kind</span><span class="p">)</span> <span class="k">else</span> <span class="n">expression</span> +</span><span id="L-4901"><a href="#L-4901"><span class="linenos">4901</span></a> +</span><span id="L-4902"><a href="#L-4902"><span class="linenos">4902</span></a> +</span><span id="L-4903"><a href="#L-4903"><span class="linenos">4903</span></a><span class="k">def</span> <span class="nf">union</span><span class="p">(</span> +</span><span id="L-4904"><a href="#L-4904"><span class="linenos">4904</span></a> <span class="n">left</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">right</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="L-4905"><a href="#L-4905"><span class="linenos">4905</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> +</span><span id="L-4906"><a href="#L-4906"><span class="linenos">4906</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4907"><a href="#L-4907"><span class="linenos">4907</span></a><span class="sd"> Initializes a syntax tree from one UNION expression.</span> +</span><span id="L-4908"><a href="#L-4908"><span class="linenos">4908</span></a> +</span><span id="L-4909"><a href="#L-4909"><span class="linenos">4909</span></a><span class="sd"> Example:</span> +</span><span id="L-4910"><a href="#L-4910"><span class="linenos">4910</span></a><span class="sd"> >>> union("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> +</span><span id="L-4911"><a href="#L-4911"><span class="linenos">4911</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> +</span><span id="L-4912"><a href="#L-4912"><span class="linenos">4912</span></a> +</span><span id="L-4913"><a href="#L-4913"><span class="linenos">4913</span></a><span class="sd"> Args:</span> +</span><span id="L-4914"><a href="#L-4914"><span class="linenos">4914</span></a><span class="sd"> left: the SQL code string corresponding to the left-hand side.</span> +</span><span id="L-4915"><a href="#L-4915"><span class="linenos">4915</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-4916"><a href="#L-4916"><span class="linenos">4916</span></a><span class="sd"> right: the SQL code string corresponding to the right-hand side.</span> +</span><span id="L-4917"><a href="#L-4917"><span class="linenos">4917</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-4918"><a href="#L-4918"><span class="linenos">4918</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="L-4919"><a href="#L-4919"><span class="linenos">4919</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-4920"><a href="#L-4920"><span class="linenos">4920</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-4921"><a href="#L-4921"><span class="linenos">4921</span></a> +</span><span id="L-4922"><a href="#L-4922"><span class="linenos">4922</span></a><span class="sd"> Returns:</span> +</span><span id="L-4923"><a href="#L-4923"><span class="linenos">4923</span></a><span class="sd"> The new Union instance.</span> +</span><span id="L-4924"><a href="#L-4924"><span class="linenos">4924</span></a><span class="sd"> """</span> +</span><span id="L-4925"><a href="#L-4925"><span class="linenos">4925</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-4926"><a href="#L-4926"><span class="linenos">4926</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-4927"><a href="#L-4927"><span class="linenos">4927</span></a> -</span><span id="L-4928"><a href="#L-4928"><span class="linenos">4928</span></a><span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span> -</span><span id="L-4929"><a href="#L-4929"><span class="linenos">4929</span></a> <span class="n">left</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">right</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="L-4930"><a href="#L-4930"><span class="linenos">4930</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Intersect</span><span class="p">:</span> -</span><span id="L-4931"><a href="#L-4931"><span class="linenos">4931</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4932"><a href="#L-4932"><span class="linenos">4932</span></a><span class="sd"> Initializes a syntax tree from one INTERSECT expression.</span> -</span><span id="L-4933"><a href="#L-4933"><span class="linenos">4933</span></a> -</span><span id="L-4934"><a href="#L-4934"><span class="linenos">4934</span></a><span class="sd"> Example:</span> -</span><span id="L-4935"><a href="#L-4935"><span class="linenos">4935</span></a><span class="sd"> >>> intersect("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> -</span><span id="L-4936"><a href="#L-4936"><span class="linenos">4936</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> -</span><span id="L-4937"><a href="#L-4937"><span class="linenos">4937</span></a> -</span><span id="L-4938"><a href="#L-4938"><span class="linenos">4938</span></a><span class="sd"> Args:</span> -</span><span id="L-4939"><a href="#L-4939"><span class="linenos">4939</span></a><span class="sd"> left: the SQL code string corresponding to the left-hand side.</span> -</span><span id="L-4940"><a href="#L-4940"><span class="linenos">4940</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-4941"><a href="#L-4941"><span class="linenos">4941</span></a><span class="sd"> right: the SQL code string corresponding to the right-hand side.</span> -</span><span id="L-4942"><a href="#L-4942"><span class="linenos">4942</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-4943"><a href="#L-4943"><span class="linenos">4943</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="L-4944"><a href="#L-4944"><span class="linenos">4944</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-4945"><a href="#L-4945"><span class="linenos">4945</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-4946"><a href="#L-4946"><span class="linenos">4946</span></a> -</span><span id="L-4947"><a href="#L-4947"><span class="linenos">4947</span></a><span class="sd"> Returns:</span> -</span><span id="L-4948"><a href="#L-4948"><span class="linenos">4948</span></a><span class="sd"> The new Intersect instance.</span> -</span><span id="L-4949"><a href="#L-4949"><span class="linenos">4949</span></a><span class="sd"> """</span> -</span><span id="L-4950"><a href="#L-4950"><span class="linenos">4950</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-4951"><a href="#L-4951"><span class="linenos">4951</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-4952"><a href="#L-4952"><span class="linenos">4952</span></a> -</span><span id="L-4953"><a href="#L-4953"><span class="linenos">4953</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-4954"><a href="#L-4954"><span class="linenos">4954</span></a> +</span><span id="L-4928"><a href="#L-4928"><span class="linenos">4928</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-4929"><a href="#L-4929"><span class="linenos">4929</span></a> +</span><span id="L-4930"><a href="#L-4930"><span class="linenos">4930</span></a> +</span><span id="L-4931"><a href="#L-4931"><span class="linenos">4931</span></a><span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span> +</span><span id="L-4932"><a href="#L-4932"><span class="linenos">4932</span></a> <span class="n">left</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">right</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="L-4933"><a href="#L-4933"><span class="linenos">4933</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Intersect</span><span class="p">:</span> +</span><span id="L-4934"><a href="#L-4934"><span class="linenos">4934</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4935"><a href="#L-4935"><span class="linenos">4935</span></a><span class="sd"> Initializes a syntax tree from one INTERSECT expression.</span> +</span><span id="L-4936"><a href="#L-4936"><span class="linenos">4936</span></a> +</span><span id="L-4937"><a href="#L-4937"><span class="linenos">4937</span></a><span class="sd"> Example:</span> +</span><span id="L-4938"><a href="#L-4938"><span class="linenos">4938</span></a><span class="sd"> >>> intersect("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> +</span><span id="L-4939"><a href="#L-4939"><span class="linenos">4939</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> +</span><span id="L-4940"><a href="#L-4940"><span class="linenos">4940</span></a> +</span><span id="L-4941"><a href="#L-4941"><span class="linenos">4941</span></a><span class="sd"> Args:</span> +</span><span id="L-4942"><a href="#L-4942"><span class="linenos">4942</span></a><span class="sd"> left: the SQL code string corresponding to the left-hand side.</span> +</span><span id="L-4943"><a href="#L-4943"><span class="linenos">4943</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-4944"><a href="#L-4944"><span class="linenos">4944</span></a><span class="sd"> right: the SQL code string corresponding to the right-hand side.</span> +</span><span id="L-4945"><a href="#L-4945"><span class="linenos">4945</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-4946"><a href="#L-4946"><span class="linenos">4946</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="L-4947"><a href="#L-4947"><span class="linenos">4947</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-4948"><a href="#L-4948"><span class="linenos">4948</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-4949"><a href="#L-4949"><span class="linenos">4949</span></a> +</span><span id="L-4950"><a href="#L-4950"><span class="linenos">4950</span></a><span class="sd"> Returns:</span> +</span><span id="L-4951"><a href="#L-4951"><span class="linenos">4951</span></a><span class="sd"> The new Intersect instance.</span> +</span><span id="L-4952"><a href="#L-4952"><span class="linenos">4952</span></a><span class="sd"> """</span> +</span><span id="L-4953"><a href="#L-4953"><span class="linenos">4953</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-4954"><a href="#L-4954"><span class="linenos">4954</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-4955"><a href="#L-4955"><span class="linenos">4955</span></a> -</span><span id="L-4956"><a href="#L-4956"><span class="linenos">4956</span></a><span class="k">def</span> <span class="nf">except_</span><span class="p">(</span> -</span><span id="L-4957"><a href="#L-4957"><span class="linenos">4957</span></a> <span class="n">left</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">right</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="L-4958"><a href="#L-4958"><span class="linenos">4958</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Except</span><span class="p">:</span> -</span><span id="L-4959"><a href="#L-4959"><span class="linenos">4959</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4960"><a href="#L-4960"><span class="linenos">4960</span></a><span class="sd"> Initializes a syntax tree from one EXCEPT expression.</span> -</span><span id="L-4961"><a href="#L-4961"><span class="linenos">4961</span></a> -</span><span id="L-4962"><a href="#L-4962"><span class="linenos">4962</span></a><span class="sd"> Example:</span> -</span><span id="L-4963"><a href="#L-4963"><span class="linenos">4963</span></a><span class="sd"> >>> except_("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> -</span><span id="L-4964"><a href="#L-4964"><span class="linenos">4964</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> -</span><span id="L-4965"><a href="#L-4965"><span class="linenos">4965</span></a> -</span><span id="L-4966"><a href="#L-4966"><span class="linenos">4966</span></a><span class="sd"> Args:</span> -</span><span id="L-4967"><a href="#L-4967"><span class="linenos">4967</span></a><span class="sd"> left: the SQL code string corresponding to the left-hand side.</span> -</span><span id="L-4968"><a href="#L-4968"><span class="linenos">4968</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-4969"><a href="#L-4969"><span class="linenos">4969</span></a><span class="sd"> right: the SQL code string corresponding to the right-hand side.</span> -</span><span id="L-4970"><a href="#L-4970"><span class="linenos">4970</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-4971"><a href="#L-4971"><span class="linenos">4971</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="L-4972"><a href="#L-4972"><span class="linenos">4972</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-4973"><a href="#L-4973"><span class="linenos">4973</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-4974"><a href="#L-4974"><span class="linenos">4974</span></a> -</span><span id="L-4975"><a href="#L-4975"><span class="linenos">4975</span></a><span class="sd"> Returns:</span> -</span><span id="L-4976"><a href="#L-4976"><span class="linenos">4976</span></a><span class="sd"> The new Except instance.</span> -</span><span id="L-4977"><a href="#L-4977"><span class="linenos">4977</span></a><span class="sd"> """</span> -</span><span id="L-4978"><a href="#L-4978"><span class="linenos">4978</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-4979"><a href="#L-4979"><span class="linenos">4979</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-4980"><a href="#L-4980"><span class="linenos">4980</span></a> -</span><span id="L-4981"><a href="#L-4981"><span class="linenos">4981</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-4982"><a href="#L-4982"><span class="linenos">4982</span></a> +</span><span id="L-4956"><a href="#L-4956"><span class="linenos">4956</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-4957"><a href="#L-4957"><span class="linenos">4957</span></a> +</span><span id="L-4958"><a href="#L-4958"><span class="linenos">4958</span></a> +</span><span id="L-4959"><a href="#L-4959"><span class="linenos">4959</span></a><span class="k">def</span> <span class="nf">except_</span><span class="p">(</span> +</span><span id="L-4960"><a href="#L-4960"><span class="linenos">4960</span></a> <span class="n">left</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">right</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="L-4961"><a href="#L-4961"><span class="linenos">4961</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Except</span><span class="p">:</span> +</span><span id="L-4962"><a href="#L-4962"><span class="linenos">4962</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4963"><a href="#L-4963"><span class="linenos">4963</span></a><span class="sd"> Initializes a syntax tree from one EXCEPT expression.</span> +</span><span id="L-4964"><a href="#L-4964"><span class="linenos">4964</span></a> +</span><span id="L-4965"><a href="#L-4965"><span class="linenos">4965</span></a><span class="sd"> Example:</span> +</span><span id="L-4966"><a href="#L-4966"><span class="linenos">4966</span></a><span class="sd"> >>> except_("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> +</span><span id="L-4967"><a href="#L-4967"><span class="linenos">4967</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> +</span><span id="L-4968"><a href="#L-4968"><span class="linenos">4968</span></a> +</span><span id="L-4969"><a href="#L-4969"><span class="linenos">4969</span></a><span class="sd"> Args:</span> +</span><span id="L-4970"><a href="#L-4970"><span class="linenos">4970</span></a><span class="sd"> left: the SQL code string corresponding to the left-hand side.</span> +</span><span id="L-4971"><a href="#L-4971"><span class="linenos">4971</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-4972"><a href="#L-4972"><span class="linenos">4972</span></a><span class="sd"> right: the SQL code string corresponding to the right-hand side.</span> +</span><span id="L-4973"><a href="#L-4973"><span class="linenos">4973</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-4974"><a href="#L-4974"><span class="linenos">4974</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="L-4975"><a href="#L-4975"><span class="linenos">4975</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-4976"><a href="#L-4976"><span class="linenos">4976</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-4977"><a href="#L-4977"><span class="linenos">4977</span></a> +</span><span id="L-4978"><a href="#L-4978"><span class="linenos">4978</span></a><span class="sd"> Returns:</span> +</span><span id="L-4979"><a href="#L-4979"><span class="linenos">4979</span></a><span class="sd"> The new Except instance.</span> +</span><span id="L-4980"><a href="#L-4980"><span class="linenos">4980</span></a><span class="sd"> """</span> +</span><span id="L-4981"><a href="#L-4981"><span class="linenos">4981</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-4982"><a href="#L-4982"><span class="linenos">4982</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-4983"><a href="#L-4983"><span class="linenos">4983</span></a> -</span><span id="L-4984"><a href="#L-4984"><span class="linenos">4984</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="n">ExpOrStr</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-4985"><a href="#L-4985"><span class="linenos">4985</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4986"><a href="#L-4986"><span class="linenos">4986</span></a><span class="sd"> Initializes a syntax tree from one or multiple SELECT expressions.</span> -</span><span id="L-4987"><a href="#L-4987"><span class="linenos">4987</span></a> -</span><span id="L-4988"><a href="#L-4988"><span class="linenos">4988</span></a><span class="sd"> Example:</span> -</span><span id="L-4989"><a href="#L-4989"><span class="linenos">4989</span></a><span class="sd"> >>> select("col1", "col2").from_("tbl").sql()</span> -</span><span id="L-4990"><a href="#L-4990"><span class="linenos">4990</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> -</span><span id="L-4991"><a href="#L-4991"><span class="linenos">4991</span></a> -</span><span id="L-4992"><a href="#L-4992"><span class="linenos">4992</span></a><span class="sd"> Args:</span> -</span><span id="L-4993"><a href="#L-4993"><span class="linenos">4993</span></a><span class="sd"> *expressions: the SQL code string to parse as the expressions of a</span> -</span><span id="L-4994"><a href="#L-4994"><span class="linenos">4994</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-4995"><a href="#L-4995"><span class="linenos">4995</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> -</span><span id="L-4996"><a href="#L-4996"><span class="linenos">4996</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="L-4997"><a href="#L-4997"><span class="linenos">4997</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="L-4998"><a href="#L-4998"><span class="linenos">4998</span></a><span class="sd"> that an input expression is a SQL string).</span> -</span><span id="L-4999"><a href="#L-4999"><span class="linenos">4999</span></a> -</span><span id="L-5000"><a href="#L-5000"><span class="linenos">5000</span></a><span class="sd"> Returns:</span> -</span><span id="L-5001"><a href="#L-5001"><span class="linenos">5001</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> -</span><span id="L-5002"><a href="#L-5002"><span class="linenos">5002</span></a><span class="sd"> """</span> -</span><span id="L-5003"><a href="#L-5003"><span class="linenos">5003</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-5004"><a href="#L-5004"><span class="linenos">5004</span></a> -</span><span id="L-5005"><a href="#L-5005"><span class="linenos">5005</span></a> -</span><span id="L-5006"><a href="#L-5006"><span class="linenos">5006</span></a><span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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-5007"><a href="#L-5007"><span class="linenos">5007</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5008"><a href="#L-5008"><span class="linenos">5008</span></a><span class="sd"> Initializes a syntax tree from a FROM expression.</span> -</span><span id="L-5009"><a href="#L-5009"><span class="linenos">5009</span></a> -</span><span id="L-5010"><a href="#L-5010"><span class="linenos">5010</span></a><span class="sd"> Example:</span> -</span><span id="L-5011"><a href="#L-5011"><span class="linenos">5011</span></a><span class="sd"> >>> from_("tbl").select("col1", "col2").sql()</span> -</span><span id="L-5012"><a href="#L-5012"><span class="linenos">5012</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> -</span><span id="L-5013"><a href="#L-5013"><span class="linenos">5013</span></a> -</span><span id="L-5014"><a href="#L-5014"><span class="linenos">5014</span></a><span class="sd"> Args:</span> -</span><span id="L-5015"><a href="#L-5015"><span class="linenos">5015</span></a><span class="sd"> *expression: the SQL code string to parse as the FROM expressions of a</span> -</span><span id="L-5016"><a href="#L-5016"><span class="linenos">5016</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-5017"><a href="#L-5017"><span class="linenos">5017</span></a><span class="sd"> dialect: the dialect used to parse the input expression (in the case that the</span> -</span><span id="L-5018"><a href="#L-5018"><span class="linenos">5018</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="L-5019"><a href="#L-5019"><span class="linenos">5019</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="L-5020"><a href="#L-5020"><span class="linenos">5020</span></a><span class="sd"> that the input expression is a SQL string).</span> -</span><span id="L-5021"><a href="#L-5021"><span class="linenos">5021</span></a> -</span><span id="L-5022"><a href="#L-5022"><span class="linenos">5022</span></a><span class="sd"> Returns:</span> -</span><span id="L-5023"><a href="#L-5023"><span class="linenos">5023</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> -</span><span id="L-5024"><a href="#L-5024"><span class="linenos">5024</span></a><span class="sd"> """</span> -</span><span id="L-5025"><a href="#L-5025"><span class="linenos">5025</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-5026"><a href="#L-5026"><span class="linenos">5026</span></a> -</span><span id="L-5027"><a href="#L-5027"><span class="linenos">5027</span></a> -</span><span id="L-5028"><a href="#L-5028"><span class="linenos">5028</span></a><span class="k">def</span> <span class="nf">update</span><span class="p">(</span> -</span><span id="L-5029"><a href="#L-5029"><span class="linenos">5029</span></a> <span class="n">table</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">,</span> -</span><span id="L-5030"><a href="#L-5030"><span class="linenos">5030</span></a> <span class="n">properties</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> -</span><span id="L-5031"><a href="#L-5031"><span class="linenos">5031</span></a> <span class="n">where</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-5032"><a href="#L-5032"><span class="linenos">5032</span></a> <span class="n">from_</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-5033"><a href="#L-5033"><span class="linenos">5033</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-5034"><a href="#L-5034"><span class="linenos">5034</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-5035"><a href="#L-5035"><span class="linenos">5035</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Update</span><span class="p">:</span> -</span><span id="L-5036"><a href="#L-5036"><span class="linenos">5036</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5037"><a href="#L-5037"><span class="linenos">5037</span></a><span class="sd"> Creates an update statement.</span> -</span><span id="L-5038"><a href="#L-5038"><span class="linenos">5038</span></a> -</span><span id="L-5039"><a href="#L-5039"><span class="linenos">5039</span></a><span class="sd"> Example:</span> -</span><span id="L-5040"><a href="#L-5040"><span class="linenos">5040</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-5041"><a href="#L-5041"><span class="linenos">5041</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-5042"><a href="#L-5042"><span class="linenos">5042</span></a> -</span><span id="L-5043"><a href="#L-5043"><span class="linenos">5043</span></a><span class="sd"> Args:</span> -</span><span id="L-5044"><a href="#L-5044"><span class="linenos">5044</span></a><span class="sd"> *properties: dictionary of properties to set which are</span> -</span><span id="L-5045"><a href="#L-5045"><span class="linenos">5045</span></a><span class="sd"> auto converted to sql objects eg None -> NULL</span> -</span><span id="L-5046"><a href="#L-5046"><span class="linenos">5046</span></a><span class="sd"> where: sql conditional parsed into a WHERE statement</span> -</span><span id="L-5047"><a href="#L-5047"><span class="linenos">5047</span></a><span class="sd"> from_: sql statement parsed into a FROM statement</span> -</span><span id="L-5048"><a href="#L-5048"><span class="linenos">5048</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-5049"><a href="#L-5049"><span class="linenos">5049</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-5050"><a href="#L-5050"><span class="linenos">5050</span></a> -</span><span id="L-5051"><a href="#L-5051"><span class="linenos">5051</span></a><span class="sd"> Returns:</span> -</span><span id="L-5052"><a href="#L-5052"><span class="linenos">5052</span></a><span class="sd"> Update: the syntax tree for the UPDATE statement.</span> -</span><span id="L-5053"><a href="#L-5053"><span class="linenos">5053</span></a><span class="sd"> """</span> -</span><span id="L-5054"><a href="#L-5054"><span class="linenos">5054</span></a> <span class="n">update_expr</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-5055"><a href="#L-5055"><span class="linenos">5055</span></a> <span class="n">update_expr</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="L-5056"><a href="#L-5056"><span class="linenos">5056</span></a> <span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="L-5057"><a href="#L-5057"><span class="linenos">5057</span></a> <span class="p">[</span> -</span><span id="L-5058"><a href="#L-5058"><span class="linenos">5058</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-5059"><a href="#L-5059"><span class="linenos">5059</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-5060"><a href="#L-5060"><span class="linenos">5060</span></a> <span class="p">],</span> -</span><span id="L-5061"><a href="#L-5061"><span class="linenos">5061</span></a> <span class="p">)</span> -</span><span id="L-5062"><a href="#L-5062"><span class="linenos">5062</span></a> <span class="k">if</span> <span class="n">from_</span><span class="p">:</span> -</span><span id="L-5063"><a href="#L-5063"><span class="linenos">5063</span></a> <span class="n">update_expr</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="L-5064"><a href="#L-5064"><span class="linenos">5064</span></a> <span class="s2">"from"</span><span class="p">,</span> -</span><span id="L-5065"><a href="#L-5065"><span class="linenos">5065</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-5066"><a href="#L-5066"><span class="linenos">5066</span></a> <span class="p">)</span> -</span><span id="L-5067"><a href="#L-5067"><span class="linenos">5067</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-5068"><a href="#L-5068"><span class="linenos">5068</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-5069"><a href="#L-5069"><span class="linenos">5069</span></a> <span class="k">if</span> <span class="n">where</span><span class="p">:</span> -</span><span id="L-5070"><a href="#L-5070"><span class="linenos">5070</span></a> <span class="n">update_expr</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="L-5071"><a href="#L-5071"><span class="linenos">5071</span></a> <span class="s2">"where"</span><span class="p">,</span> -</span><span id="L-5072"><a href="#L-5072"><span class="linenos">5072</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-5073"><a href="#L-5073"><span class="linenos">5073</span></a> <span class="p">)</span> -</span><span id="L-5074"><a href="#L-5074"><span class="linenos">5074</span></a> <span class="k">return</span> <span class="n">update_expr</span> -</span><span id="L-5075"><a href="#L-5075"><span class="linenos">5075</span></a> -</span><span id="L-5076"><a href="#L-5076"><span class="linenos">5076</span></a> -</span><span id="L-5077"><a href="#L-5077"><span class="linenos">5077</span></a><span class="k">def</span> <span class="nf">delete</span><span class="p">(</span> -</span><span id="L-5078"><a href="#L-5078"><span class="linenos">5078</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-5079"><a href="#L-5079"><span class="linenos">5079</span></a> <span class="n">where</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-5080"><a href="#L-5080"><span class="linenos">5080</span></a> <span class="n">returning</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-5081"><a href="#L-5081"><span class="linenos">5081</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-5082"><a href="#L-5082"><span class="linenos">5082</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-5083"><a href="#L-5083"><span class="linenos">5083</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="L-5084"><a href="#L-5084"><span class="linenos">5084</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5085"><a href="#L-5085"><span class="linenos">5085</span></a><span class="sd"> Builds a delete statement.</span> -</span><span id="L-5086"><a href="#L-5086"><span class="linenos">5086</span></a> -</span><span id="L-5087"><a href="#L-5087"><span class="linenos">5087</span></a><span class="sd"> Example:</span> -</span><span id="L-5088"><a href="#L-5088"><span class="linenos">5088</span></a><span class="sd"> >>> delete("my_table", where="id > 1").sql()</span> -</span><span id="L-5089"><a href="#L-5089"><span class="linenos">5089</span></a><span class="sd"> 'DELETE FROM my_table WHERE id > 1'</span> -</span><span id="L-5090"><a href="#L-5090"><span class="linenos">5090</span></a> -</span><span id="L-5091"><a href="#L-5091"><span class="linenos">5091</span></a><span class="sd"> Args:</span> -</span><span id="L-5092"><a href="#L-5092"><span class="linenos">5092</span></a><span class="sd"> where: sql conditional parsed into a WHERE statement</span> -</span><span id="L-5093"><a href="#L-5093"><span class="linenos">5093</span></a><span class="sd"> returning: sql conditional parsed into a RETURNING statement</span> -</span><span id="L-5094"><a href="#L-5094"><span class="linenos">5094</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-5095"><a href="#L-5095"><span class="linenos">5095</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-5096"><a href="#L-5096"><span class="linenos">5096</span></a> -</span><span id="L-5097"><a href="#L-5097"><span class="linenos">5097</span></a><span class="sd"> Returns:</span> -</span><span id="L-5098"><a href="#L-5098"><span class="linenos">5098</span></a><span class="sd"> Delete: the syntax tree for the DELETE statement.</span> -</span><span id="L-5099"><a href="#L-5099"><span class="linenos">5099</span></a><span class="sd"> """</span> -</span><span id="L-5100"><a href="#L-5100"><span class="linenos">5100</span></a> <span class="n">delete_expr</span> <span class="o">=</span> <span class="n">Delete</span><span class="p">()</span><span class="o">.</span><span class="n">delete</span><span class="p">(</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="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-5101"><a href="#L-5101"><span class="linenos">5101</span></a> <span class="k">if</span> <span class="n">where</span><span class="p">:</span> -</span><span id="L-5102"><a href="#L-5102"><span class="linenos">5102</span></a> <span class="n">delete_expr</span> <span class="o">=</span> <span class="n">delete_expr</span><span class="o">.</span><span class="n">where</span><span class="p">(</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">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-5103"><a href="#L-5103"><span class="linenos">5103</span></a> <span class="k">if</span> <span class="n">returning</span><span class="p">:</span> -</span><span id="L-5104"><a href="#L-5104"><span class="linenos">5104</span></a> <span class="n">delete_expr</span> <span class="o">=</span> <span class="n">delete_expr</span><span class="o">.</span><span class="n">returning</span><span class="p">(</span><span class="n">returning</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-5105"><a href="#L-5105"><span class="linenos">5105</span></a> <span class="k">return</span> <span class="n">delete_expr</span> -</span><span id="L-5106"><a href="#L-5106"><span class="linenos">5106</span></a> -</span><span id="L-5107"><a href="#L-5107"><span class="linenos">5107</span></a> -</span><span id="L-5108"><a href="#L-5108"><span class="linenos">5108</span></a><span class="k">def</span> <span class="nf">insert</span><span class="p">(</span> -</span><span id="L-5109"><a href="#L-5109"><span class="linenos">5109</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-5110"><a href="#L-5110"><span class="linenos">5110</span></a> <span class="n">into</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-5111"><a href="#L-5111"><span class="linenos">5111</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">Sequence</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-5112"><a href="#L-5112"><span class="linenos">5112</span></a> <span class="n">overwrite</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-5113"><a href="#L-5113"><span class="linenos">5113</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-5114"><a href="#L-5114"><span class="linenos">5114</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-5115"><a href="#L-5115"><span class="linenos">5115</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-5116"><a href="#L-5116"><span class="linenos">5116</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Insert</span><span class="p">:</span> -</span><span id="L-5117"><a href="#L-5117"><span class="linenos">5117</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5118"><a href="#L-5118"><span class="linenos">5118</span></a><span class="sd"> Builds an INSERT statement.</span> -</span><span id="L-5119"><a href="#L-5119"><span class="linenos">5119</span></a> -</span><span id="L-5120"><a href="#L-5120"><span class="linenos">5120</span></a><span class="sd"> Example:</span> -</span><span id="L-5121"><a href="#L-5121"><span class="linenos">5121</span></a><span class="sd"> >>> insert("VALUES (1, 2, 3)", "tbl").sql()</span> -</span><span id="L-5122"><a href="#L-5122"><span class="linenos">5122</span></a><span class="sd"> 'INSERT INTO tbl VALUES (1, 2, 3)'</span> -</span><span id="L-5123"><a href="#L-5123"><span class="linenos">5123</span></a> -</span><span id="L-5124"><a href="#L-5124"><span class="linenos">5124</span></a><span class="sd"> Args:</span> -</span><span id="L-5125"><a href="#L-5125"><span class="linenos">5125</span></a><span class="sd"> expression: the sql string or expression of the INSERT statement</span> -</span><span id="L-5126"><a href="#L-5126"><span class="linenos">5126</span></a><span class="sd"> into: the tbl to insert data to.</span> -</span><span id="L-5127"><a href="#L-5127"><span class="linenos">5127</span></a><span class="sd"> columns: optionally the table's column names.</span> -</span><span id="L-5128"><a href="#L-5128"><span class="linenos">5128</span></a><span class="sd"> overwrite: whether to INSERT OVERWRITE or not.</span> -</span><span id="L-5129"><a href="#L-5129"><span class="linenos">5129</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-5130"><a href="#L-5130"><span class="linenos">5130</span></a><span class="sd"> copy: whether or not to copy the expression.</span> -</span><span id="L-5131"><a href="#L-5131"><span class="linenos">5131</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-5132"><a href="#L-5132"><span class="linenos">5132</span></a> -</span><span id="L-5133"><a href="#L-5133"><span class="linenos">5133</span></a><span class="sd"> Returns:</span> -</span><span id="L-5134"><a href="#L-5134"><span class="linenos">5134</span></a><span class="sd"> Insert: the syntax tree for the INSERT statement.</span> -</span><span id="L-5135"><a href="#L-5135"><span class="linenos">5135</span></a><span class="sd"> """</span> -</span><span id="L-5136"><a href="#L-5136"><span class="linenos">5136</span></a> <span class="n">expr</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-5137"><a href="#L-5137"><span class="linenos">5137</span></a> <span class="n">this</span><span class="p">:</span> <span class="n">Table</span> <span class="o">|</span> <span class="n">Schema</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">into</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-5138"><a href="#L-5138"><span class="linenos">5138</span></a> -</span><span id="L-5139"><a href="#L-5139"><span class="linenos">5139</span></a> <span class="k">if</span> <span class="n">columns</span><span class="p">:</span> -</span><span id="L-5140"><a href="#L-5140"><span class="linenos">5140</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-5141"><a href="#L-5141"><span class="linenos">5141</span></a> <span class="o">*</span><span class="n">columns</span><span class="p">,</span> -</span><span id="L-5142"><a href="#L-5142"><span class="linenos">5142</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">Schema</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">),</span> -</span><span id="L-5143"><a href="#L-5143"><span class="linenos">5143</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="L-5144"><a href="#L-5144"><span class="linenos">5144</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Identifier</span><span class="p">,</span> -</span><span id="L-5145"><a href="#L-5145"><span class="linenos">5145</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> -</span><span id="L-5146"><a href="#L-5146"><span class="linenos">5146</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-5147"><a href="#L-5147"><span class="linenos">5147</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-5148"><a href="#L-5148"><span class="linenos">5148</span></a> <span class="p">)</span> -</span><span id="L-5149"><a href="#L-5149"><span class="linenos">5149</span></a> -</span><span id="L-5150"><a href="#L-5150"><span class="linenos">5150</span></a> <span class="k">return</span> <span class="n">Insert</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">expr</span><span class="p">,</span> <span class="n">overwrite</span><span class="o">=</span><span class="n">overwrite</span><span class="p">)</span> -</span><span id="L-5151"><a href="#L-5151"><span class="linenos">5151</span></a> +</span><span id="L-4984"><a href="#L-4984"><span class="linenos">4984</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-4985"><a href="#L-4985"><span class="linenos">4985</span></a> +</span><span id="L-4986"><a href="#L-4986"><span class="linenos">4986</span></a> +</span><span id="L-4987"><a href="#L-4987"><span class="linenos">4987</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="n">ExpOrStr</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-4988"><a href="#L-4988"><span class="linenos">4988</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4989"><a href="#L-4989"><span class="linenos">4989</span></a><span class="sd"> Initializes a syntax tree from one or multiple SELECT expressions.</span> +</span><span id="L-4990"><a href="#L-4990"><span class="linenos">4990</span></a> +</span><span id="L-4991"><a href="#L-4991"><span class="linenos">4991</span></a><span class="sd"> Example:</span> +</span><span id="L-4992"><a href="#L-4992"><span class="linenos">4992</span></a><span class="sd"> >>> select("col1", "col2").from_("tbl").sql()</span> +</span><span id="L-4993"><a href="#L-4993"><span class="linenos">4993</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> +</span><span id="L-4994"><a href="#L-4994"><span class="linenos">4994</span></a> +</span><span id="L-4995"><a href="#L-4995"><span class="linenos">4995</span></a><span class="sd"> Args:</span> +</span><span id="L-4996"><a href="#L-4996"><span class="linenos">4996</span></a><span class="sd"> *expressions: the SQL code string to parse as the expressions of a</span> +</span><span id="L-4997"><a href="#L-4997"><span class="linenos">4997</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-4998"><a href="#L-4998"><span class="linenos">4998</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> +</span><span id="L-4999"><a href="#L-4999"><span class="linenos">4999</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="L-5000"><a href="#L-5000"><span class="linenos">5000</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="L-5001"><a href="#L-5001"><span class="linenos">5001</span></a><span class="sd"> that an input expression is a SQL string).</span> +</span><span id="L-5002"><a href="#L-5002"><span class="linenos">5002</span></a> +</span><span id="L-5003"><a href="#L-5003"><span class="linenos">5003</span></a><span class="sd"> Returns:</span> +</span><span id="L-5004"><a href="#L-5004"><span class="linenos">5004</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> +</span><span id="L-5005"><a href="#L-5005"><span class="linenos">5005</span></a><span class="sd"> """</span> +</span><span id="L-5006"><a href="#L-5006"><span class="linenos">5006</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-5007"><a href="#L-5007"><span class="linenos">5007</span></a> +</span><span id="L-5008"><a href="#L-5008"><span class="linenos">5008</span></a> +</span><span id="L-5009"><a href="#L-5009"><span class="linenos">5009</span></a><span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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-5010"><a href="#L-5010"><span class="linenos">5010</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5011"><a href="#L-5011"><span class="linenos">5011</span></a><span class="sd"> Initializes a syntax tree from a FROM expression.</span> +</span><span id="L-5012"><a href="#L-5012"><span class="linenos">5012</span></a> +</span><span id="L-5013"><a href="#L-5013"><span class="linenos">5013</span></a><span class="sd"> Example:</span> +</span><span id="L-5014"><a href="#L-5014"><span class="linenos">5014</span></a><span class="sd"> >>> from_("tbl").select("col1", "col2").sql()</span> +</span><span id="L-5015"><a href="#L-5015"><span class="linenos">5015</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> +</span><span id="L-5016"><a href="#L-5016"><span class="linenos">5016</span></a> +</span><span id="L-5017"><a href="#L-5017"><span class="linenos">5017</span></a><span class="sd"> Args:</span> +</span><span id="L-5018"><a href="#L-5018"><span class="linenos">5018</span></a><span class="sd"> *expression: the SQL code string to parse as the FROM expressions of a</span> +</span><span id="L-5019"><a href="#L-5019"><span class="linenos">5019</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-5020"><a href="#L-5020"><span class="linenos">5020</span></a><span class="sd"> dialect: the dialect used to parse the input expression (in the case that the</span> +</span><span id="L-5021"><a href="#L-5021"><span class="linenos">5021</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="L-5022"><a href="#L-5022"><span class="linenos">5022</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="L-5023"><a href="#L-5023"><span class="linenos">5023</span></a><span class="sd"> that the input expression is a SQL string).</span> +</span><span id="L-5024"><a href="#L-5024"><span class="linenos">5024</span></a> +</span><span id="L-5025"><a href="#L-5025"><span class="linenos">5025</span></a><span class="sd"> Returns:</span> +</span><span id="L-5026"><a href="#L-5026"><span class="linenos">5026</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> +</span><span id="L-5027"><a href="#L-5027"><span class="linenos">5027</span></a><span class="sd"> """</span> +</span><span id="L-5028"><a href="#L-5028"><span class="linenos">5028</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-5029"><a href="#L-5029"><span class="linenos">5029</span></a> +</span><span id="L-5030"><a href="#L-5030"><span class="linenos">5030</span></a> +</span><span id="L-5031"><a href="#L-5031"><span class="linenos">5031</span></a><span class="k">def</span> <span class="nf">update</span><span class="p">(</span> +</span><span id="L-5032"><a href="#L-5032"><span class="linenos">5032</span></a> <span class="n">table</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">,</span> +</span><span id="L-5033"><a href="#L-5033"><span class="linenos">5033</span></a> <span class="n">properties</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> +</span><span id="L-5034"><a href="#L-5034"><span class="linenos">5034</span></a> <span class="n">where</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-5035"><a href="#L-5035"><span class="linenos">5035</span></a> <span class="n">from_</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-5036"><a href="#L-5036"><span class="linenos">5036</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-5037"><a href="#L-5037"><span class="linenos">5037</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-5038"><a href="#L-5038"><span class="linenos">5038</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Update</span><span class="p">:</span> +</span><span id="L-5039"><a href="#L-5039"><span class="linenos">5039</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5040"><a href="#L-5040"><span class="linenos">5040</span></a><span class="sd"> Creates an update statement.</span> +</span><span id="L-5041"><a href="#L-5041"><span class="linenos">5041</span></a> +</span><span id="L-5042"><a href="#L-5042"><span class="linenos">5042</span></a><span class="sd"> Example:</span> +</span><span id="L-5043"><a href="#L-5043"><span class="linenos">5043</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-5044"><a href="#L-5044"><span class="linenos">5044</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-5045"><a href="#L-5045"><span class="linenos">5045</span></a> +</span><span id="L-5046"><a href="#L-5046"><span class="linenos">5046</span></a><span class="sd"> Args:</span> +</span><span id="L-5047"><a href="#L-5047"><span class="linenos">5047</span></a><span class="sd"> *properties: dictionary of properties to set which are</span> +</span><span id="L-5048"><a href="#L-5048"><span class="linenos">5048</span></a><span class="sd"> auto converted to sql objects eg None -> NULL</span> +</span><span id="L-5049"><a href="#L-5049"><span class="linenos">5049</span></a><span class="sd"> where: sql conditional parsed into a WHERE statement</span> +</span><span id="L-5050"><a href="#L-5050"><span class="linenos">5050</span></a><span class="sd"> from_: sql statement parsed into a FROM statement</span> +</span><span id="L-5051"><a href="#L-5051"><span class="linenos">5051</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-5052"><a href="#L-5052"><span class="linenos">5052</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="L-5053"><a href="#L-5053"><span class="linenos">5053</span></a> +</span><span id="L-5054"><a href="#L-5054"><span class="linenos">5054</span></a><span class="sd"> Returns:</span> +</span><span id="L-5055"><a href="#L-5055"><span class="linenos">5055</span></a><span class="sd"> Update: the syntax tree for the UPDATE statement.</span> +</span><span id="L-5056"><a href="#L-5056"><span class="linenos">5056</span></a><span class="sd"> """</span> +</span><span id="L-5057"><a href="#L-5057"><span class="linenos">5057</span></a> <span class="n">update_expr</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-5058"><a href="#L-5058"><span class="linenos">5058</span></a> <span class="n">update_expr</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="L-5059"><a href="#L-5059"><span class="linenos">5059</span></a> <span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="L-5060"><a href="#L-5060"><span class="linenos">5060</span></a> <span class="p">[</span> +</span><span id="L-5061"><a href="#L-5061"><span class="linenos">5061</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-5062"><a href="#L-5062"><span class="linenos">5062</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-5063"><a href="#L-5063"><span class="linenos">5063</span></a> <span class="p">],</span> +</span><span id="L-5064"><a href="#L-5064"><span class="linenos">5064</span></a> <span class="p">)</span> +</span><span id="L-5065"><a href="#L-5065"><span class="linenos">5065</span></a> <span class="k">if</span> <span class="n">from_</span><span class="p">:</span> +</span><span id="L-5066"><a href="#L-5066"><span class="linenos">5066</span></a> <span class="n">update_expr</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="L-5067"><a href="#L-5067"><span class="linenos">5067</span></a> <span class="s2">"from"</span><span class="p">,</span> +</span><span id="L-5068"><a href="#L-5068"><span class="linenos">5068</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-5069"><a href="#L-5069"><span class="linenos">5069</span></a> <span class="p">)</span> +</span><span id="L-5070"><a href="#L-5070"><span class="linenos">5070</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-5071"><a href="#L-5071"><span class="linenos">5071</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-5072"><a href="#L-5072"><span class="linenos">5072</span></a> <span class="k">if</span> <span class="n">where</span><span class="p">:</span> +</span><span id="L-5073"><a href="#L-5073"><span class="linenos">5073</span></a> <span class="n">update_expr</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="L-5074"><a href="#L-5074"><span class="linenos">5074</span></a> <span class="s2">"where"</span><span class="p">,</span> +</span><span id="L-5075"><a href="#L-5075"><span class="linenos">5075</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-5076"><a href="#L-5076"><span class="linenos">5076</span></a> <span class="p">)</span> +</span><span id="L-5077"><a href="#L-5077"><span class="linenos">5077</span></a> <span class="k">return</span> <span class="n">update_expr</span> +</span><span id="L-5078"><a href="#L-5078"><span class="linenos">5078</span></a> +</span><span id="L-5079"><a href="#L-5079"><span class="linenos">5079</span></a> +</span><span id="L-5080"><a href="#L-5080"><span class="linenos">5080</span></a><span class="k">def</span> <span class="nf">delete</span><span class="p">(</span> +</span><span id="L-5081"><a href="#L-5081"><span class="linenos">5081</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-5082"><a href="#L-5082"><span class="linenos">5082</span></a> <span class="n">where</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-5083"><a href="#L-5083"><span class="linenos">5083</span></a> <span class="n">returning</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-5084"><a href="#L-5084"><span class="linenos">5084</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-5085"><a href="#L-5085"><span class="linenos">5085</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-5086"><a href="#L-5086"><span class="linenos">5086</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="L-5087"><a href="#L-5087"><span class="linenos">5087</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5088"><a href="#L-5088"><span class="linenos">5088</span></a><span class="sd"> Builds a delete statement.</span> +</span><span id="L-5089"><a href="#L-5089"><span class="linenos">5089</span></a> +</span><span id="L-5090"><a href="#L-5090"><span class="linenos">5090</span></a><span class="sd"> Example:</span> +</span><span id="L-5091"><a href="#L-5091"><span class="linenos">5091</span></a><span class="sd"> >>> delete("my_table", where="id > 1").sql()</span> +</span><span id="L-5092"><a href="#L-5092"><span class="linenos">5092</span></a><span class="sd"> 'DELETE FROM my_table WHERE id > 1'</span> +</span><span id="L-5093"><a href="#L-5093"><span class="linenos">5093</span></a> +</span><span id="L-5094"><a href="#L-5094"><span class="linenos">5094</span></a><span class="sd"> Args:</span> +</span><span id="L-5095"><a href="#L-5095"><span class="linenos">5095</span></a><span class="sd"> where: sql conditional parsed into a WHERE statement</span> +</span><span id="L-5096"><a href="#L-5096"><span class="linenos">5096</span></a><span class="sd"> returning: sql conditional parsed into a RETURNING statement</span> +</span><span id="L-5097"><a href="#L-5097"><span class="linenos">5097</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-5098"><a href="#L-5098"><span class="linenos">5098</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="L-5099"><a href="#L-5099"><span class="linenos">5099</span></a> +</span><span id="L-5100"><a href="#L-5100"><span class="linenos">5100</span></a><span class="sd"> Returns:</span> +</span><span id="L-5101"><a href="#L-5101"><span class="linenos">5101</span></a><span class="sd"> Delete: the syntax tree for the DELETE statement.</span> +</span><span id="L-5102"><a href="#L-5102"><span class="linenos">5102</span></a><span class="sd"> """</span> +</span><span id="L-5103"><a href="#L-5103"><span class="linenos">5103</span></a> <span class="n">delete_expr</span> <span class="o">=</span> <span class="n">Delete</span><span class="p">()</span><span class="o">.</span><span class="n">delete</span><span class="p">(</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="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-5104"><a href="#L-5104"><span class="linenos">5104</span></a> <span class="k">if</span> <span class="n">where</span><span class="p">:</span> +</span><span id="L-5105"><a href="#L-5105"><span class="linenos">5105</span></a> <span class="n">delete_expr</span> <span class="o">=</span> <span class="n">delete_expr</span><span class="o">.</span><span class="n">where</span><span class="p">(</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">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-5106"><a href="#L-5106"><span class="linenos">5106</span></a> <span class="k">if</span> <span class="n">returning</span><span class="p">:</span> +</span><span id="L-5107"><a href="#L-5107"><span class="linenos">5107</span></a> <span class="n">delete_expr</span> <span class="o">=</span> <span class="n">delete_expr</span><span class="o">.</span><span class="n">returning</span><span class="p">(</span><span class="n">returning</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-5108"><a href="#L-5108"><span class="linenos">5108</span></a> <span class="k">return</span> <span class="n">delete_expr</span> +</span><span id="L-5109"><a href="#L-5109"><span class="linenos">5109</span></a> +</span><span id="L-5110"><a href="#L-5110"><span class="linenos">5110</span></a> +</span><span id="L-5111"><a href="#L-5111"><span class="linenos">5111</span></a><span class="k">def</span> <span class="nf">insert</span><span class="p">(</span> +</span><span id="L-5112"><a href="#L-5112"><span class="linenos">5112</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-5113"><a href="#L-5113"><span class="linenos">5113</span></a> <span class="n">into</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-5114"><a href="#L-5114"><span class="linenos">5114</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">Sequence</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-5115"><a href="#L-5115"><span class="linenos">5115</span></a> <span class="n">overwrite</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-5116"><a href="#L-5116"><span class="linenos">5116</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-5117"><a href="#L-5117"><span class="linenos">5117</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-5118"><a href="#L-5118"><span class="linenos">5118</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-5119"><a href="#L-5119"><span class="linenos">5119</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Insert</span><span class="p">:</span> +</span><span id="L-5120"><a href="#L-5120"><span class="linenos">5120</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5121"><a href="#L-5121"><span class="linenos">5121</span></a><span class="sd"> Builds an INSERT statement.</span> +</span><span id="L-5122"><a href="#L-5122"><span class="linenos">5122</span></a> +</span><span id="L-5123"><a href="#L-5123"><span class="linenos">5123</span></a><span class="sd"> Example:</span> +</span><span id="L-5124"><a href="#L-5124"><span class="linenos">5124</span></a><span class="sd"> >>> insert("VALUES (1, 2, 3)", "tbl").sql()</span> +</span><span id="L-5125"><a href="#L-5125"><span class="linenos">5125</span></a><span class="sd"> 'INSERT INTO tbl VALUES (1, 2, 3)'</span> +</span><span id="L-5126"><a href="#L-5126"><span class="linenos">5126</span></a> +</span><span id="L-5127"><a href="#L-5127"><span class="linenos">5127</span></a><span class="sd"> Args:</span> +</span><span id="L-5128"><a href="#L-5128"><span class="linenos">5128</span></a><span class="sd"> expression: the sql string or expression of the INSERT statement</span> +</span><span id="L-5129"><a href="#L-5129"><span class="linenos">5129</span></a><span class="sd"> into: the tbl to insert data to.</span> +</span><span id="L-5130"><a href="#L-5130"><span class="linenos">5130</span></a><span class="sd"> columns: optionally the table's column names.</span> +</span><span id="L-5131"><a href="#L-5131"><span class="linenos">5131</span></a><span class="sd"> overwrite: whether to INSERT OVERWRITE or not.</span> +</span><span id="L-5132"><a href="#L-5132"><span class="linenos">5132</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-5133"><a href="#L-5133"><span class="linenos">5133</span></a><span class="sd"> copy: whether or not to copy the expression.</span> +</span><span id="L-5134"><a href="#L-5134"><span class="linenos">5134</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="L-5135"><a href="#L-5135"><span class="linenos">5135</span></a> +</span><span id="L-5136"><a href="#L-5136"><span class="linenos">5136</span></a><span class="sd"> Returns:</span> +</span><span id="L-5137"><a href="#L-5137"><span class="linenos">5137</span></a><span class="sd"> Insert: the syntax tree for the INSERT statement.</span> +</span><span id="L-5138"><a href="#L-5138"><span class="linenos">5138</span></a><span class="sd"> """</span> +</span><span id="L-5139"><a href="#L-5139"><span class="linenos">5139</span></a> <span class="n">expr</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-5140"><a href="#L-5140"><span class="linenos">5140</span></a> <span class="n">this</span><span class="p">:</span> <span class="n">Table</span> <span class="o">|</span> <span class="n">Schema</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">into</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-5141"><a href="#L-5141"><span class="linenos">5141</span></a> +</span><span id="L-5142"><a href="#L-5142"><span class="linenos">5142</span></a> <span class="k">if</span> <span class="n">columns</span><span class="p">:</span> +</span><span id="L-5143"><a href="#L-5143"><span class="linenos">5143</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-5144"><a href="#L-5144"><span class="linenos">5144</span></a> <span class="o">*</span><span class="n">columns</span><span class="p">,</span> +</span><span id="L-5145"><a href="#L-5145"><span class="linenos">5145</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">Schema</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">),</span> +</span><span id="L-5146"><a href="#L-5146"><span class="linenos">5146</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="L-5147"><a href="#L-5147"><span class="linenos">5147</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Identifier</span><span class="p">,</span> +</span><span id="L-5148"><a href="#L-5148"><span class="linenos">5148</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> +</span><span id="L-5149"><a href="#L-5149"><span class="linenos">5149</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-5150"><a href="#L-5150"><span class="linenos">5150</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-5151"><a href="#L-5151"><span class="linenos">5151</span></a> <span class="p">)</span> </span><span id="L-5152"><a href="#L-5152"><span class="linenos">5152</span></a> -</span><span id="L-5153"><a href="#L-5153"><span class="linenos">5153</span></a><span class="k">def</span> <span class="nf">condition</span><span class="p">(</span> -</span><span id="L-5154"><a href="#L-5154"><span class="linenos">5154</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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="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">opts</span> -</span><span id="L-5155"><a href="#L-5155"><span class="linenos">5155</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="L-5156"><a href="#L-5156"><span class="linenos">5156</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5157"><a href="#L-5157"><span class="linenos">5157</span></a><span class="sd"> Initialize a logical condition expression.</span> -</span><span id="L-5158"><a href="#L-5158"><span class="linenos">5158</span></a> -</span><span id="L-5159"><a href="#L-5159"><span class="linenos">5159</span></a><span class="sd"> Example:</span> -</span><span id="L-5160"><a href="#L-5160"><span class="linenos">5160</span></a><span class="sd"> >>> condition("x=1").sql()</span> -</span><span id="L-5161"><a href="#L-5161"><span class="linenos">5161</span></a><span class="sd"> 'x = 1'</span> -</span><span id="L-5162"><a href="#L-5162"><span class="linenos">5162</span></a> -</span><span id="L-5163"><a href="#L-5163"><span class="linenos">5163</span></a><span class="sd"> This is helpful for composing larger logical syntax trees:</span> -</span><span id="L-5164"><a href="#L-5164"><span class="linenos">5164</span></a><span class="sd"> >>> where = condition("x=1")</span> -</span><span id="L-5165"><a href="#L-5165"><span class="linenos">5165</span></a><span class="sd"> >>> where = where.and_("y=1")</span> -</span><span id="L-5166"><a href="#L-5166"><span class="linenos">5166</span></a><span class="sd"> >>> Select().from_("tbl").select("*").where(where).sql()</span> -</span><span id="L-5167"><a href="#L-5167"><span class="linenos">5167</span></a><span class="sd"> 'SELECT * FROM tbl WHERE x = 1 AND y = 1'</span> -</span><span id="L-5168"><a href="#L-5168"><span class="linenos">5168</span></a> -</span><span id="L-5169"><a href="#L-5169"><span class="linenos">5169</span></a><span class="sd"> Args:</span> -</span><span id="L-5170"><a href="#L-5170"><span class="linenos">5170</span></a><span class="sd"> *expression: the SQL code string to parse.</span> -</span><span id="L-5171"><a href="#L-5171"><span class="linenos">5171</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-5172"><a href="#L-5172"><span class="linenos">5172</span></a><span class="sd"> dialect: the dialect used to parse the input expression (in the case that the</span> -</span><span id="L-5173"><a href="#L-5173"><span class="linenos">5173</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="L-5174"><a href="#L-5174"><span class="linenos">5174</span></a><span class="sd"> copy: Whether or not to copy `expression` (only applies to expressions).</span> -</span><span id="L-5175"><a href="#L-5175"><span class="linenos">5175</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="L-5176"><a href="#L-5176"><span class="linenos">5176</span></a><span class="sd"> that the input expression is a SQL string).</span> -</span><span id="L-5177"><a href="#L-5177"><span class="linenos">5177</span></a> -</span><span id="L-5178"><a href="#L-5178"><span class="linenos">5178</span></a><span class="sd"> Returns:</span> -</span><span id="L-5179"><a href="#L-5179"><span class="linenos">5179</span></a><span class="sd"> The new Condition instance</span> -</span><span id="L-5180"><a href="#L-5180"><span class="linenos">5180</span></a><span class="sd"> """</span> -</span><span id="L-5181"><a href="#L-5181"><span class="linenos">5181</span></a> <span class="k">return</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="L-5182"><a href="#L-5182"><span class="linenos">5182</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="L-5183"><a href="#L-5183"><span class="linenos">5183</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Condition</span><span class="p">,</span> -</span><span id="L-5184"><a href="#L-5184"><span class="linenos">5184</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-5185"><a href="#L-5185"><span class="linenos">5185</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-5186"><a href="#L-5186"><span class="linenos">5186</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-5187"><a href="#L-5187"><span class="linenos">5187</span></a> <span class="p">)</span> -</span><span id="L-5188"><a href="#L-5188"><span class="linenos">5188</span></a> -</span><span id="L-5189"><a href="#L-5189"><span class="linenos">5189</span></a> -</span><span id="L-5190"><a href="#L-5190"><span class="linenos">5190</span></a><span class="k">def</span> <span class="nf">and_</span><span class="p">(</span> -</span><span id="L-5191"><a href="#L-5191"><span class="linenos">5191</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</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="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">opts</span> -</span><span id="L-5192"><a href="#L-5192"><span class="linenos">5192</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="L-5193"><a href="#L-5193"><span class="linenos">5193</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5194"><a href="#L-5194"><span class="linenos">5194</span></a><span class="sd"> Combine multiple conditions with an AND logical operator.</span> -</span><span id="L-5195"><a href="#L-5195"><span class="linenos">5195</span></a> -</span><span id="L-5196"><a href="#L-5196"><span class="linenos">5196</span></a><span class="sd"> Example:</span> -</span><span id="L-5197"><a href="#L-5197"><span class="linenos">5197</span></a><span class="sd"> >>> and_("x=1", and_("y=1", "z=1")).sql()</span> -</span><span id="L-5198"><a href="#L-5198"><span class="linenos">5198</span></a><span class="sd"> 'x = 1 AND (y = 1 AND z = 1)'</span> -</span><span id="L-5199"><a href="#L-5199"><span class="linenos">5199</span></a> -</span><span id="L-5200"><a href="#L-5200"><span class="linenos">5200</span></a><span class="sd"> Args:</span> -</span><span id="L-5201"><a href="#L-5201"><span class="linenos">5201</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-5202"><a href="#L-5202"><span class="linenos">5202</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-5203"><a href="#L-5203"><span class="linenos">5203</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-5204"><a href="#L-5204"><span class="linenos">5204</span></a><span class="sd"> copy: whether or not to copy `expressions` (only applies to Expressions).</span> -</span><span id="L-5205"><a href="#L-5205"><span class="linenos">5205</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-5206"><a href="#L-5206"><span class="linenos">5206</span></a> -</span><span id="L-5207"><a href="#L-5207"><span class="linenos">5207</span></a><span class="sd"> Returns:</span> -</span><span id="L-5208"><a href="#L-5208"><span class="linenos">5208</span></a><span class="sd"> And: the new condition</span> -</span><span id="L-5209"><a href="#L-5209"><span class="linenos">5209</span></a><span class="sd"> """</span> -</span><span id="L-5210"><a href="#L-5210"><span class="linenos">5210</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Condition</span><span class="p">,</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> -</span><span id="L-5211"><a href="#L-5211"><span class="linenos">5211</span></a> -</span><span id="L-5212"><a href="#L-5212"><span class="linenos">5212</span></a> -</span><span id="L-5213"><a href="#L-5213"><span class="linenos">5213</span></a><span class="k">def</span> <span class="nf">or_</span><span class="p">(</span> -</span><span id="L-5214"><a href="#L-5214"><span class="linenos">5214</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</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="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">opts</span> -</span><span id="L-5215"><a href="#L-5215"><span class="linenos">5215</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="L-5216"><a href="#L-5216"><span class="linenos">5216</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5217"><a href="#L-5217"><span class="linenos">5217</span></a><span class="sd"> Combine multiple conditions with an OR logical operator.</span> -</span><span id="L-5218"><a href="#L-5218"><span class="linenos">5218</span></a> -</span><span id="L-5219"><a href="#L-5219"><span class="linenos">5219</span></a><span class="sd"> Example:</span> -</span><span id="L-5220"><a href="#L-5220"><span class="linenos">5220</span></a><span class="sd"> >>> or_("x=1", or_("y=1", "z=1")).sql()</span> -</span><span id="L-5221"><a href="#L-5221"><span class="linenos">5221</span></a><span class="sd"> 'x = 1 OR (y = 1 OR z = 1)'</span> -</span><span id="L-5222"><a href="#L-5222"><span class="linenos">5222</span></a> -</span><span id="L-5223"><a href="#L-5223"><span class="linenos">5223</span></a><span class="sd"> Args:</span> -</span><span id="L-5224"><a href="#L-5224"><span class="linenos">5224</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-5225"><a href="#L-5225"><span class="linenos">5225</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-5226"><a href="#L-5226"><span class="linenos">5226</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-5227"><a href="#L-5227"><span class="linenos">5227</span></a><span class="sd"> copy: whether or not to copy `expressions` (only applies to Expressions).</span> -</span><span id="L-5228"><a href="#L-5228"><span class="linenos">5228</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-5229"><a href="#L-5229"><span class="linenos">5229</span></a> -</span><span id="L-5230"><a href="#L-5230"><span class="linenos">5230</span></a><span class="sd"> Returns:</span> -</span><span id="L-5231"><a href="#L-5231"><span class="linenos">5231</span></a><span class="sd"> Or: the new condition</span> -</span><span id="L-5232"><a href="#L-5232"><span class="linenos">5232</span></a><span class="sd"> """</span> -</span><span id="L-5233"><a href="#L-5233"><span class="linenos">5233</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Condition</span><span class="p">,</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> -</span><span id="L-5234"><a href="#L-5234"><span class="linenos">5234</span></a> -</span><span id="L-5235"><a href="#L-5235"><span class="linenos">5235</span></a> -</span><span id="L-5236"><a href="#L-5236"><span class="linenos">5236</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">ExpOrStr</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="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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Not</span><span class="p">:</span> -</span><span id="L-5237"><a href="#L-5237"><span class="linenos">5237</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5238"><a href="#L-5238"><span class="linenos">5238</span></a><span class="sd"> Wrap a condition with a NOT operator.</span> -</span><span id="L-5239"><a href="#L-5239"><span class="linenos">5239</span></a> -</span><span id="L-5240"><a href="#L-5240"><span class="linenos">5240</span></a><span class="sd"> Example:</span> -</span><span id="L-5241"><a href="#L-5241"><span class="linenos">5241</span></a><span class="sd"> >>> not_("this_suit='black'").sql()</span> -</span><span id="L-5242"><a href="#L-5242"><span class="linenos">5242</span></a><span class="sd"> "NOT this_suit = 'black'"</span> -</span><span id="L-5243"><a href="#L-5243"><span class="linenos">5243</span></a> -</span><span id="L-5244"><a href="#L-5244"><span class="linenos">5244</span></a><span class="sd"> Args:</span> -</span><span id="L-5245"><a href="#L-5245"><span class="linenos">5245</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="L-5246"><a href="#L-5246"><span class="linenos">5246</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-5247"><a href="#L-5247"><span class="linenos">5247</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-5248"><a href="#L-5248"><span class="linenos">5248</span></a><span class="sd"> copy: whether to copy the expression or not.</span> -</span><span id="L-5249"><a href="#L-5249"><span class="linenos">5249</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-5250"><a href="#L-5250"><span class="linenos">5250</span></a> -</span><span id="L-5251"><a href="#L-5251"><span class="linenos">5251</span></a><span class="sd"> Returns:</span> -</span><span id="L-5252"><a href="#L-5252"><span class="linenos">5252</span></a><span class="sd"> The new condition.</span> -</span><span id="L-5253"><a href="#L-5253"><span class="linenos">5253</span></a><span class="sd"> """</span> -</span><span id="L-5254"><a href="#L-5254"><span class="linenos">5254</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">condition</span><span class="p">(</span> -</span><span id="L-5255"><a href="#L-5255"><span class="linenos">5255</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="L-5256"><a href="#L-5256"><span class="linenos">5256</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-5257"><a href="#L-5257"><span class="linenos">5257</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-5258"><a href="#L-5258"><span class="linenos">5258</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-5259"><a href="#L-5259"><span class="linenos">5259</span></a> <span class="p">)</span> -</span><span id="L-5260"><a href="#L-5260"><span class="linenos">5260</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</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">Connector</span><span class="p">))</span> -</span><span id="L-5261"><a href="#L-5261"><span class="linenos">5261</span></a> -</span><span id="L-5262"><a href="#L-5262"><span class="linenos">5262</span></a> -</span><span id="L-5263"><a href="#L-5263"><span class="linenos">5263</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="n">ExpOrStr</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">Paren</span><span class="p">:</span> -</span><span id="L-5264"><a href="#L-5264"><span class="linenos">5264</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5265"><a href="#L-5265"><span class="linenos">5265</span></a><span class="sd"> Wrap an expression in parentheses.</span> -</span><span id="L-5266"><a href="#L-5266"><span class="linenos">5266</span></a> -</span><span id="L-5267"><a href="#L-5267"><span class="linenos">5267</span></a><span class="sd"> Example:</span> -</span><span id="L-5268"><a href="#L-5268"><span class="linenos">5268</span></a><span class="sd"> >>> paren("5 + 3").sql()</span> -</span><span id="L-5269"><a href="#L-5269"><span class="linenos">5269</span></a><span class="sd"> '(5 + 3)'</span> -</span><span id="L-5270"><a href="#L-5270"><span class="linenos">5270</span></a> -</span><span id="L-5271"><a href="#L-5271"><span class="linenos">5271</span></a><span class="sd"> Args:</span> -</span><span id="L-5272"><a href="#L-5272"><span class="linenos">5272</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="L-5273"><a href="#L-5273"><span class="linenos">5273</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-5274"><a href="#L-5274"><span class="linenos">5274</span></a><span class="sd"> copy: whether to copy the expression or not.</span> -</span><span id="L-5275"><a href="#L-5275"><span class="linenos">5275</span></a> -</span><span id="L-5276"><a href="#L-5276"><span class="linenos">5276</span></a><span class="sd"> Returns:</span> -</span><span id="L-5277"><a href="#L-5277"><span class="linenos">5277</span></a><span class="sd"> The wrapped expression.</span> -</span><span id="L-5278"><a href="#L-5278"><span class="linenos">5278</span></a><span class="sd"> """</span> -</span><span id="L-5279"><a href="#L-5279"><span class="linenos">5279</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">maybe_parse</span><span class="p">(</span><span class="n">expression</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-5280"><a href="#L-5280"><span class="linenos">5280</span></a> -</span><span id="L-5281"><a href="#L-5281"><span class="linenos">5281</span></a> -</span><span id="L-5282"><a href="#L-5282"><span class="linenos">5282</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-5153"><a href="#L-5153"><span class="linenos">5153</span></a> <span class="k">return</span> <span class="n">Insert</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">expr</span><span class="p">,</span> <span class="n">overwrite</span><span class="o">=</span><span class="n">overwrite</span><span class="p">)</span> +</span><span id="L-5154"><a href="#L-5154"><span class="linenos">5154</span></a> +</span><span id="L-5155"><a href="#L-5155"><span class="linenos">5155</span></a> +</span><span id="L-5156"><a href="#L-5156"><span class="linenos">5156</span></a><span class="k">def</span> <span class="nf">condition</span><span class="p">(</span> +</span><span id="L-5157"><a href="#L-5157"><span class="linenos">5157</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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="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">opts</span> +</span><span id="L-5158"><a href="#L-5158"><span class="linenos">5158</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="L-5159"><a href="#L-5159"><span class="linenos">5159</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5160"><a href="#L-5160"><span class="linenos">5160</span></a><span class="sd"> Initialize a logical condition expression.</span> +</span><span id="L-5161"><a href="#L-5161"><span class="linenos">5161</span></a> +</span><span id="L-5162"><a href="#L-5162"><span class="linenos">5162</span></a><span class="sd"> Example:</span> +</span><span id="L-5163"><a href="#L-5163"><span class="linenos">5163</span></a><span class="sd"> >>> condition("x=1").sql()</span> +</span><span id="L-5164"><a href="#L-5164"><span class="linenos">5164</span></a><span class="sd"> 'x = 1'</span> +</span><span id="L-5165"><a href="#L-5165"><span class="linenos">5165</span></a> +</span><span id="L-5166"><a href="#L-5166"><span class="linenos">5166</span></a><span class="sd"> This is helpful for composing larger logical syntax trees:</span> +</span><span id="L-5167"><a href="#L-5167"><span class="linenos">5167</span></a><span class="sd"> >>> where = condition("x=1")</span> +</span><span id="L-5168"><a href="#L-5168"><span class="linenos">5168</span></a><span class="sd"> >>> where = where.and_("y=1")</span> +</span><span id="L-5169"><a href="#L-5169"><span class="linenos">5169</span></a><span class="sd"> >>> Select().from_("tbl").select("*").where(where).sql()</span> +</span><span id="L-5170"><a href="#L-5170"><span class="linenos">5170</span></a><span class="sd"> 'SELECT * FROM tbl WHERE x = 1 AND y = 1'</span> +</span><span id="L-5171"><a href="#L-5171"><span class="linenos">5171</span></a> +</span><span id="L-5172"><a href="#L-5172"><span class="linenos">5172</span></a><span class="sd"> Args:</span> +</span><span id="L-5173"><a href="#L-5173"><span class="linenos">5173</span></a><span class="sd"> *expression: the SQL code string to parse.</span> +</span><span id="L-5174"><a href="#L-5174"><span class="linenos">5174</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-5175"><a href="#L-5175"><span class="linenos">5175</span></a><span class="sd"> dialect: the dialect used to parse the input expression (in the case that the</span> +</span><span id="L-5176"><a href="#L-5176"><span class="linenos">5176</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="L-5177"><a href="#L-5177"><span class="linenos">5177</span></a><span class="sd"> copy: Whether or not to copy `expression` (only applies to expressions).</span> +</span><span id="L-5178"><a href="#L-5178"><span class="linenos">5178</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="L-5179"><a href="#L-5179"><span class="linenos">5179</span></a><span class="sd"> that the input expression is a SQL string).</span> +</span><span id="L-5180"><a href="#L-5180"><span class="linenos">5180</span></a> +</span><span id="L-5181"><a href="#L-5181"><span class="linenos">5181</span></a><span class="sd"> Returns:</span> +</span><span id="L-5182"><a href="#L-5182"><span class="linenos">5182</span></a><span class="sd"> The new Condition instance</span> +</span><span id="L-5183"><a href="#L-5183"><span class="linenos">5183</span></a><span class="sd"> """</span> +</span><span id="L-5184"><a href="#L-5184"><span class="linenos">5184</span></a> <span class="k">return</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="L-5185"><a href="#L-5185"><span class="linenos">5185</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="L-5186"><a href="#L-5186"><span class="linenos">5186</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Condition</span><span class="p">,</span> +</span><span id="L-5187"><a href="#L-5187"><span class="linenos">5187</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-5188"><a href="#L-5188"><span class="linenos">5188</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-5189"><a href="#L-5189"><span class="linenos">5189</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-5190"><a href="#L-5190"><span class="linenos">5190</span></a> <span class="p">)</span> +</span><span id="L-5191"><a href="#L-5191"><span class="linenos">5191</span></a> +</span><span id="L-5192"><a href="#L-5192"><span class="linenos">5192</span></a> +</span><span id="L-5193"><a href="#L-5193"><span class="linenos">5193</span></a><span class="k">def</span> <span class="nf">and_</span><span class="p">(</span> +</span><span id="L-5194"><a href="#L-5194"><span class="linenos">5194</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</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="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">opts</span> +</span><span id="L-5195"><a href="#L-5195"><span class="linenos">5195</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="L-5196"><a href="#L-5196"><span class="linenos">5196</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5197"><a href="#L-5197"><span class="linenos">5197</span></a><span class="sd"> Combine multiple conditions with an AND logical operator.</span> +</span><span id="L-5198"><a href="#L-5198"><span class="linenos">5198</span></a> +</span><span id="L-5199"><a href="#L-5199"><span class="linenos">5199</span></a><span class="sd"> Example:</span> +</span><span id="L-5200"><a href="#L-5200"><span class="linenos">5200</span></a><span class="sd"> >>> and_("x=1", and_("y=1", "z=1")).sql()</span> +</span><span id="L-5201"><a href="#L-5201"><span class="linenos">5201</span></a><span class="sd"> 'x = 1 AND (y = 1 AND z = 1)'</span> +</span><span id="L-5202"><a href="#L-5202"><span class="linenos">5202</span></a> +</span><span id="L-5203"><a href="#L-5203"><span class="linenos">5203</span></a><span class="sd"> Args:</span> +</span><span id="L-5204"><a href="#L-5204"><span class="linenos">5204</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-5205"><a href="#L-5205"><span class="linenos">5205</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-5206"><a href="#L-5206"><span class="linenos">5206</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-5207"><a href="#L-5207"><span class="linenos">5207</span></a><span class="sd"> copy: whether or not to copy `expressions` (only applies to Expressions).</span> +</span><span id="L-5208"><a href="#L-5208"><span class="linenos">5208</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="L-5209"><a href="#L-5209"><span class="linenos">5209</span></a> +</span><span id="L-5210"><a href="#L-5210"><span class="linenos">5210</span></a><span class="sd"> Returns:</span> +</span><span id="L-5211"><a href="#L-5211"><span class="linenos">5211</span></a><span class="sd"> And: the new condition</span> +</span><span id="L-5212"><a href="#L-5212"><span class="linenos">5212</span></a><span class="sd"> """</span> +</span><span id="L-5213"><a href="#L-5213"><span class="linenos">5213</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Condition</span><span class="p">,</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> +</span><span id="L-5214"><a href="#L-5214"><span class="linenos">5214</span></a> +</span><span id="L-5215"><a href="#L-5215"><span class="linenos">5215</span></a> +</span><span id="L-5216"><a href="#L-5216"><span class="linenos">5216</span></a><span class="k">def</span> <span class="nf">or_</span><span class="p">(</span> +</span><span id="L-5217"><a href="#L-5217"><span class="linenos">5217</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</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="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">opts</span> +</span><span id="L-5218"><a href="#L-5218"><span class="linenos">5218</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="L-5219"><a href="#L-5219"><span class="linenos">5219</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5220"><a href="#L-5220"><span class="linenos">5220</span></a><span class="sd"> Combine multiple conditions with an OR logical operator.</span> +</span><span id="L-5221"><a href="#L-5221"><span class="linenos">5221</span></a> +</span><span id="L-5222"><a href="#L-5222"><span class="linenos">5222</span></a><span class="sd"> Example:</span> +</span><span id="L-5223"><a href="#L-5223"><span class="linenos">5223</span></a><span class="sd"> >>> or_("x=1", or_("y=1", "z=1")).sql()</span> +</span><span id="L-5224"><a href="#L-5224"><span class="linenos">5224</span></a><span class="sd"> 'x = 1 OR (y = 1 OR z = 1)'</span> +</span><span id="L-5225"><a href="#L-5225"><span class="linenos">5225</span></a> +</span><span id="L-5226"><a href="#L-5226"><span class="linenos">5226</span></a><span class="sd"> Args:</span> +</span><span id="L-5227"><a href="#L-5227"><span class="linenos">5227</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-5228"><a href="#L-5228"><span class="linenos">5228</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-5229"><a href="#L-5229"><span class="linenos">5229</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-5230"><a href="#L-5230"><span class="linenos">5230</span></a><span class="sd"> copy: whether or not to copy `expressions` (only applies to Expressions).</span> +</span><span id="L-5231"><a href="#L-5231"><span class="linenos">5231</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="L-5232"><a href="#L-5232"><span class="linenos">5232</span></a> +</span><span id="L-5233"><a href="#L-5233"><span class="linenos">5233</span></a><span class="sd"> Returns:</span> +</span><span id="L-5234"><a href="#L-5234"><span class="linenos">5234</span></a><span class="sd"> Or: the new condition</span> +</span><span id="L-5235"><a href="#L-5235"><span class="linenos">5235</span></a><span class="sd"> """</span> +</span><span id="L-5236"><a href="#L-5236"><span class="linenos">5236</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Condition</span><span class="p">,</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> +</span><span id="L-5237"><a href="#L-5237"><span class="linenos">5237</span></a> +</span><span id="L-5238"><a href="#L-5238"><span class="linenos">5238</span></a> +</span><span id="L-5239"><a href="#L-5239"><span class="linenos">5239</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">ExpOrStr</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="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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Not</span><span class="p">:</span> +</span><span id="L-5240"><a href="#L-5240"><span class="linenos">5240</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5241"><a href="#L-5241"><span class="linenos">5241</span></a><span class="sd"> Wrap a condition with a NOT operator.</span> +</span><span id="L-5242"><a href="#L-5242"><span class="linenos">5242</span></a> +</span><span id="L-5243"><a href="#L-5243"><span class="linenos">5243</span></a><span class="sd"> Example:</span> +</span><span id="L-5244"><a href="#L-5244"><span class="linenos">5244</span></a><span class="sd"> >>> not_("this_suit='black'").sql()</span> +</span><span id="L-5245"><a href="#L-5245"><span class="linenos">5245</span></a><span class="sd"> "NOT this_suit = 'black'"</span> +</span><span id="L-5246"><a href="#L-5246"><span class="linenos">5246</span></a> +</span><span id="L-5247"><a href="#L-5247"><span class="linenos">5247</span></a><span class="sd"> Args:</span> +</span><span id="L-5248"><a href="#L-5248"><span class="linenos">5248</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="L-5249"><a href="#L-5249"><span class="linenos">5249</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-5250"><a href="#L-5250"><span class="linenos">5250</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-5251"><a href="#L-5251"><span class="linenos">5251</span></a><span class="sd"> copy: whether to copy the expression or not.</span> +</span><span id="L-5252"><a href="#L-5252"><span class="linenos">5252</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="L-5253"><a href="#L-5253"><span class="linenos">5253</span></a> +</span><span id="L-5254"><a href="#L-5254"><span class="linenos">5254</span></a><span class="sd"> Returns:</span> +</span><span id="L-5255"><a href="#L-5255"><span class="linenos">5255</span></a><span class="sd"> The new condition.</span> +</span><span id="L-5256"><a href="#L-5256"><span class="linenos">5256</span></a><span class="sd"> """</span> +</span><span id="L-5257"><a href="#L-5257"><span class="linenos">5257</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">condition</span><span class="p">(</span> +</span><span id="L-5258"><a href="#L-5258"><span class="linenos">5258</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="L-5259"><a href="#L-5259"><span class="linenos">5259</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-5260"><a href="#L-5260"><span class="linenos">5260</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-5261"><a href="#L-5261"><span class="linenos">5261</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-5262"><a href="#L-5262"><span class="linenos">5262</span></a> <span class="p">)</span> +</span><span id="L-5263"><a href="#L-5263"><span class="linenos">5263</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</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">Connector</span><span class="p">))</span> +</span><span id="L-5264"><a href="#L-5264"><span class="linenos">5264</span></a> +</span><span id="L-5265"><a href="#L-5265"><span class="linenos">5265</span></a> +</span><span id="L-5266"><a href="#L-5266"><span class="linenos">5266</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="n">ExpOrStr</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">Paren</span><span class="p">:</span> +</span><span id="L-5267"><a href="#L-5267"><span class="linenos">5267</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5268"><a href="#L-5268"><span class="linenos">5268</span></a><span class="sd"> Wrap an expression in parentheses.</span> +</span><span id="L-5269"><a href="#L-5269"><span class="linenos">5269</span></a> +</span><span id="L-5270"><a href="#L-5270"><span class="linenos">5270</span></a><span class="sd"> Example:</span> +</span><span id="L-5271"><a href="#L-5271"><span class="linenos">5271</span></a><span class="sd"> >>> paren("5 + 3").sql()</span> +</span><span id="L-5272"><a href="#L-5272"><span class="linenos">5272</span></a><span class="sd"> '(5 + 3)'</span> +</span><span id="L-5273"><a href="#L-5273"><span class="linenos">5273</span></a> +</span><span id="L-5274"><a href="#L-5274"><span class="linenos">5274</span></a><span class="sd"> Args:</span> +</span><span id="L-5275"><a href="#L-5275"><span class="linenos">5275</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="L-5276"><a href="#L-5276"><span class="linenos">5276</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-5277"><a href="#L-5277"><span class="linenos">5277</span></a><span class="sd"> copy: whether to copy the expression or not.</span> +</span><span id="L-5278"><a href="#L-5278"><span class="linenos">5278</span></a> +</span><span id="L-5279"><a href="#L-5279"><span class="linenos">5279</span></a><span class="sd"> Returns:</span> +</span><span id="L-5280"><a href="#L-5280"><span class="linenos">5280</span></a><span class="sd"> The wrapped expression.</span> +</span><span id="L-5281"><a href="#L-5281"><span class="linenos">5281</span></a><span class="sd"> """</span> +</span><span id="L-5282"><a href="#L-5282"><span class="linenos">5282</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">maybe_parse</span><span class="p">(</span><span class="n">expression</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-5283"><a href="#L-5283"><span class="linenos">5283</span></a> </span><span id="L-5284"><a href="#L-5284"><span class="linenos">5284</span></a> -</span><span id="L-5285"><a href="#L-5285"><span class="linenos">5285</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="L-5286"><a href="#L-5286"><span class="linenos">5286</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="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="kc">None</span><span class="p">:</span> -</span><span id="L-5287"><a href="#L-5287"><span class="linenos">5287</span></a> <span class="o">...</span> -</span><span id="L-5288"><a href="#L-5288"><span class="linenos">5288</span></a> -</span><span id="L-5289"><a href="#L-5289"><span class="linenos">5289</span></a> -</span><span id="L-5290"><a href="#L-5290"><span class="linenos">5290</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="L-5291"><a href="#L-5291"><span class="linenos">5291</span></a><span class="k">def</span> <span class="nf">to_identifier</span><span class="p">(</span> -</span><span id="L-5292"><a href="#L-5292"><span class="linenos">5292</span></a> <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="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-5293"><a href="#L-5293"><span class="linenos">5293</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Identifier</span><span class="p">:</span> -</span><span id="L-5294"><a href="#L-5294"><span class="linenos">5294</span></a> <span class="o">...</span> -</span><span id="L-5295"><a href="#L-5295"><span class="linenos">5295</span></a> -</span><span id="L-5296"><a href="#L-5296"><span class="linenos">5296</span></a> -</span><span id="L-5297"><a href="#L-5297"><span class="linenos">5297</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 class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> -</span><span id="L-5298"><a href="#L-5298"><span class="linenos">5298</span></a><span class="w"> </span><span class="sd">"""Builds an identifier.</span> +</span><span id="L-5285"><a href="#L-5285"><span class="linenos">5285</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-5286"><a href="#L-5286"><span class="linenos">5286</span></a> +</span><span id="L-5287"><a href="#L-5287"><span class="linenos">5287</span></a> +</span><span id="L-5288"><a href="#L-5288"><span class="linenos">5288</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> +</span><span id="L-5289"><a href="#L-5289"><span class="linenos">5289</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="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="kc">None</span><span class="p">:</span> +</span><span id="L-5290"><a href="#L-5290"><span class="linenos">5290</span></a> <span class="o">...</span> +</span><span id="L-5291"><a href="#L-5291"><span class="linenos">5291</span></a> +</span><span id="L-5292"><a href="#L-5292"><span class="linenos">5292</span></a> +</span><span id="L-5293"><a href="#L-5293"><span class="linenos">5293</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> +</span><span id="L-5294"><a href="#L-5294"><span class="linenos">5294</span></a><span class="k">def</span> <span class="nf">to_identifier</span><span class="p">(</span> +</span><span id="L-5295"><a href="#L-5295"><span class="linenos">5295</span></a> <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="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-5296"><a href="#L-5296"><span class="linenos">5296</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Identifier</span><span class="p">:</span> +</span><span id="L-5297"><a href="#L-5297"><span class="linenos">5297</span></a> <span class="o">...</span> +</span><span id="L-5298"><a href="#L-5298"><span class="linenos">5298</span></a> </span><span id="L-5299"><a href="#L-5299"><span class="linenos">5299</span></a> -</span><span id="L-5300"><a href="#L-5300"><span class="linenos">5300</span></a><span class="sd"> Args:</span> -</span><span id="L-5301"><a href="#L-5301"><span class="linenos">5301</span></a><span class="sd"> name: The name to turn into an identifier.</span> -</span><span id="L-5302"><a href="#L-5302"><span class="linenos">5302</span></a><span class="sd"> quoted: Whether or not force quote the identifier.</span> -</span><span id="L-5303"><a href="#L-5303"><span class="linenos">5303</span></a><span class="sd"> copy: Whether or not to copy a passed in Identefier node.</span> -</span><span id="L-5304"><a href="#L-5304"><span class="linenos">5304</span></a> -</span><span id="L-5305"><a href="#L-5305"><span class="linenos">5305</span></a><span class="sd"> Returns:</span> -</span><span id="L-5306"><a href="#L-5306"><span class="linenos">5306</span></a><span class="sd"> The identifier ast node.</span> -</span><span id="L-5307"><a href="#L-5307"><span class="linenos">5307</span></a><span class="sd"> """</span> -</span><span id="L-5308"><a href="#L-5308"><span class="linenos">5308</span></a> -</span><span id="L-5309"><a href="#L-5309"><span class="linenos">5309</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-5310"><a href="#L-5310"><span class="linenos">5310</span></a> <span class="k">return</span> <span class="kc">None</span> +</span><span id="L-5300"><a href="#L-5300"><span class="linenos">5300</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 class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="L-5301"><a href="#L-5301"><span class="linenos">5301</span></a><span class="w"> </span><span class="sd">"""Builds an identifier.</span> +</span><span id="L-5302"><a href="#L-5302"><span class="linenos">5302</span></a> +</span><span id="L-5303"><a href="#L-5303"><span class="linenos">5303</span></a><span class="sd"> Args:</span> +</span><span id="L-5304"><a href="#L-5304"><span class="linenos">5304</span></a><span class="sd"> name: The name to turn into an identifier.</span> +</span><span id="L-5305"><a href="#L-5305"><span class="linenos">5305</span></a><span class="sd"> quoted: Whether or not force quote the identifier.</span> +</span><span id="L-5306"><a href="#L-5306"><span class="linenos">5306</span></a><span class="sd"> copy: Whether or not to copy a passed in Identefier node.</span> +</span><span id="L-5307"><a href="#L-5307"><span class="linenos">5307</span></a> +</span><span id="L-5308"><a href="#L-5308"><span class="linenos">5308</span></a><span class="sd"> Returns:</span> +</span><span id="L-5309"><a href="#L-5309"><span class="linenos">5309</span></a><span class="sd"> The identifier ast node.</span> +</span><span id="L-5310"><a href="#L-5310"><span class="linenos">5310</span></a><span class="sd"> """</span> </span><span id="L-5311"><a href="#L-5311"><span class="linenos">5311</span></a> -</span><span id="L-5312"><a href="#L-5312"><span class="linenos">5312</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-5313"><a href="#L-5313"><span class="linenos">5313</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="L-5314"><a href="#L-5314"><span class="linenos">5314</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-5315"><a href="#L-5315"><span class="linenos">5315</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">Identifier</span><span class="p">(</span> -</span><span id="L-5316"><a href="#L-5316"><span class="linenos">5316</span></a> <span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> -</span><span id="L-5317"><a href="#L-5317"><span class="linenos">5317</span></a> <span class="n">quoted</span><span class="o">=</span><span class="ow">not</span> <span class="n">SAFE_IDENTIFIER_RE</span><span class="o">.</span><span class="n">match</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-5318"><a href="#L-5318"><span class="linenos">5318</span></a> <span class="p">)</span> -</span><span id="L-5319"><a href="#L-5319"><span class="linenos">5319</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-5320"><a href="#L-5320"><span class="linenos">5320</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-5321"><a href="#L-5321"><span class="linenos">5321</span></a> <span class="k">return</span> <span class="n">identifier</span> -</span><span id="L-5322"><a href="#L-5322"><span class="linenos">5322</span></a> -</span><span id="L-5323"><a href="#L-5323"><span class="linenos">5323</span></a> -</span><span id="L-5324"><a href="#L-5324"><span class="linenos">5324</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-5312"><a href="#L-5312"><span class="linenos">5312</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-5313"><a href="#L-5313"><span class="linenos">5313</span></a> <span class="k">return</span> <span class="kc">None</span> +</span><span id="L-5314"><a href="#L-5314"><span class="linenos">5314</span></a> +</span><span id="L-5315"><a href="#L-5315"><span class="linenos">5315</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-5316"><a href="#L-5316"><span class="linenos">5316</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="L-5317"><a href="#L-5317"><span class="linenos">5317</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-5318"><a href="#L-5318"><span class="linenos">5318</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">Identifier</span><span class="p">(</span> +</span><span id="L-5319"><a href="#L-5319"><span class="linenos">5319</span></a> <span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> +</span><span id="L-5320"><a href="#L-5320"><span class="linenos">5320</span></a> <span class="n">quoted</span><span class="o">=</span><span class="ow">not</span> <span class="n">SAFE_IDENTIFIER_RE</span><span class="o">.</span><span class="n">match</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-5321"><a href="#L-5321"><span class="linenos">5321</span></a> <span class="p">)</span> +</span><span id="L-5322"><a href="#L-5322"><span class="linenos">5322</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-5323"><a href="#L-5323"><span class="linenos">5323</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-5324"><a href="#L-5324"><span class="linenos">5324</span></a> <span class="k">return</span> <span class="n">identifier</span> </span><span id="L-5325"><a href="#L-5325"><span class="linenos">5325</span></a> </span><span id="L-5326"><a href="#L-5326"><span class="linenos">5326</span></a> -</span><span id="L-5327"><a href="#L-5327"><span class="linenos">5327</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-5328"><a href="#L-5328"><span class="linenos">5328</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-5329"><a href="#L-5329"><span class="linenos">5329</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-5330"><a href="#L-5330"><span class="linenos">5330</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-5331"><a href="#L-5331"><span class="linenos">5331</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-5332"><a href="#L-5332"><span class="linenos">5332</span></a> -</span><span id="L-5333"><a href="#L-5333"><span class="linenos">5333</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-5334"><a href="#L-5334"><span class="linenos">5334</span></a> -</span><span id="L-5335"><a href="#L-5335"><span class="linenos">5335</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-5336"><a href="#L-5336"><span class="linenos">5336</span></a> -</span><span id="L-5337"><a href="#L-5337"><span class="linenos">5337</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-5338"><a href="#L-5338"><span class="linenos">5338</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-5327"><a href="#L-5327"><span class="linenos">5327</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-5328"><a href="#L-5328"><span class="linenos">5328</span></a> +</span><span id="L-5329"><a href="#L-5329"><span class="linenos">5329</span></a> +</span><span id="L-5330"><a href="#L-5330"><span class="linenos">5330</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-5331"><a href="#L-5331"><span class="linenos">5331</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-5332"><a href="#L-5332"><span class="linenos">5332</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-5333"><a href="#L-5333"><span class="linenos">5333</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-5334"><a href="#L-5334"><span class="linenos">5334</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-5335"><a href="#L-5335"><span class="linenos">5335</span></a> +</span><span id="L-5336"><a href="#L-5336"><span class="linenos">5336</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-5337"><a href="#L-5337"><span class="linenos">5337</span></a> +</span><span id="L-5338"><a href="#L-5338"><span class="linenos">5338</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-5339"><a href="#L-5339"><span class="linenos">5339</span></a> -</span><span id="L-5340"><a href="#L-5340"><span class="linenos">5340</span></a> <span class="k">return</span> <span class="n">Interval</span><span class="p">(</span> -</span><span id="L-5341"><a href="#L-5341"><span class="linenos">5341</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-5342"><a href="#L-5342"><span class="linenos">5342</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-5343"><a href="#L-5343"><span class="linenos">5343</span></a> <span class="p">)</span> -</span><span id="L-5344"><a href="#L-5344"><span class="linenos">5344</span></a> -</span><span id="L-5345"><a href="#L-5345"><span class="linenos">5345</span></a> -</span><span id="L-5346"><a href="#L-5346"><span class="linenos">5346</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="L-5347"><a href="#L-5347"><span class="linenos">5347</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-5348"><a href="#L-5348"><span class="linenos">5348</span></a> <span class="o">...</span> -</span><span id="L-5349"><a href="#L-5349"><span class="linenos">5349</span></a> -</span><span id="L-5350"><a href="#L-5350"><span class="linenos">5350</span></a> -</span><span id="L-5351"><a href="#L-5351"><span class="linenos">5351</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="L-5352"><a href="#L-5352"><span class="linenos">5352</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-5353"><a href="#L-5353"><span class="linenos">5353</span></a> <span class="o">...</span> -</span><span id="L-5354"><a href="#L-5354"><span class="linenos">5354</span></a> -</span><span id="L-5355"><a href="#L-5355"><span class="linenos">5355</span></a> -</span><span id="L-5356"><a href="#L-5356"><span class="linenos">5356</span></a><span class="k">def</span> <span class="nf">to_table</span><span class="p">(</span> -</span><span id="L-5357"><a href="#L-5357"><span class="linenos">5357</span></a> <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="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-5358"><a href="#L-5358"><span class="linenos">5358</span></a><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-5359"><a href="#L-5359"><span class="linenos">5359</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5360"><a href="#L-5360"><span class="linenos">5360</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-5361"><a href="#L-5361"><span class="linenos">5361</span></a><span class="sd"> If a table is passed in then that table is returned.</span> -</span><span id="L-5362"><a href="#L-5362"><span class="linenos">5362</span></a> -</span><span id="L-5363"><a href="#L-5363"><span class="linenos">5363</span></a><span class="sd"> Args:</span> -</span><span id="L-5364"><a href="#L-5364"><span class="linenos">5364</span></a><span class="sd"> sql_path: a `[catalog].[schema].[table]` string.</span> -</span><span id="L-5365"><a href="#L-5365"><span class="linenos">5365</span></a><span class="sd"> dialect: the source dialect according to which the table name will be parsed.</span> -</span><span id="L-5366"><a href="#L-5366"><span class="linenos">5366</span></a><span class="sd"> kwargs: the kwargs to instantiate the resulting `Table` expression with.</span> -</span><span id="L-5367"><a href="#L-5367"><span class="linenos">5367</span></a> -</span><span id="L-5368"><a href="#L-5368"><span class="linenos">5368</span></a><span class="sd"> Returns:</span> -</span><span id="L-5369"><a href="#L-5369"><span class="linenos">5369</span></a><span class="sd"> A table expression.</span> -</span><span id="L-5370"><a href="#L-5370"><span class="linenos">5370</span></a><span class="sd"> """</span> -</span><span id="L-5371"><a href="#L-5371"><span class="linenos">5371</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-5372"><a href="#L-5372"><span class="linenos">5372</span></a> <span class="k">return</span> <span class="n">sql_path</span> -</span><span id="L-5373"><a href="#L-5373"><span class="linenos">5373</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-5374"><a href="#L-5374"><span class="linenos">5374</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-5375"><a href="#L-5375"><span class="linenos">5375</span></a> -</span><span id="L-5376"><a href="#L-5376"><span class="linenos">5376</span></a> <span class="n">table</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_path</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-5377"><a href="#L-5377"><span class="linenos">5377</span></a> <span class="k">if</span> <span class="n">table</span><span class="p">:</span> -</span><span id="L-5378"><a href="#L-5378"><span class="linenos">5378</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">kwargs</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="L-5379"><a href="#L-5379"><span class="linenos">5379</span></a> <span class="n">table</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-5380"><a href="#L-5380"><span class="linenos">5380</span></a> -</span><span id="L-5381"><a href="#L-5381"><span class="linenos">5381</span></a> <span class="k">return</span> <span class="n">table</span> -</span><span id="L-5382"><a href="#L-5382"><span class="linenos">5382</span></a> +</span><span id="L-5340"><a href="#L-5340"><span class="linenos">5340</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-5341"><a href="#L-5341"><span class="linenos">5341</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-5342"><a href="#L-5342"><span class="linenos">5342</span></a> +</span><span id="L-5343"><a href="#L-5343"><span class="linenos">5343</span></a> <span class="k">return</span> <span class="n">Interval</span><span class="p">(</span> +</span><span id="L-5344"><a href="#L-5344"><span class="linenos">5344</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-5345"><a href="#L-5345"><span class="linenos">5345</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-5346"><a href="#L-5346"><span class="linenos">5346</span></a> <span class="p">)</span> +</span><span id="L-5347"><a href="#L-5347"><span class="linenos">5347</span></a> +</span><span id="L-5348"><a href="#L-5348"><span class="linenos">5348</span></a> +</span><span id="L-5349"><a href="#L-5349"><span class="linenos">5349</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> +</span><span id="L-5350"><a href="#L-5350"><span class="linenos">5350</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-5351"><a href="#L-5351"><span class="linenos">5351</span></a> <span class="o">...</span> +</span><span id="L-5352"><a href="#L-5352"><span class="linenos">5352</span></a> +</span><span id="L-5353"><a href="#L-5353"><span class="linenos">5353</span></a> +</span><span id="L-5354"><a href="#L-5354"><span class="linenos">5354</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> +</span><span id="L-5355"><a href="#L-5355"><span class="linenos">5355</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-5356"><a href="#L-5356"><span class="linenos">5356</span></a> <span class="o">...</span> +</span><span id="L-5357"><a href="#L-5357"><span class="linenos">5357</span></a> +</span><span id="L-5358"><a href="#L-5358"><span class="linenos">5358</span></a> +</span><span id="L-5359"><a href="#L-5359"><span class="linenos">5359</span></a><span class="k">def</span> <span class="nf">to_table</span><span class="p">(</span> +</span><span id="L-5360"><a href="#L-5360"><span class="linenos">5360</span></a> <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="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-5361"><a href="#L-5361"><span class="linenos">5361</span></a><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-5362"><a href="#L-5362"><span class="linenos">5362</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5363"><a href="#L-5363"><span class="linenos">5363</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-5364"><a href="#L-5364"><span class="linenos">5364</span></a><span class="sd"> If a table is passed in then that table is returned.</span> +</span><span id="L-5365"><a href="#L-5365"><span class="linenos">5365</span></a> +</span><span id="L-5366"><a href="#L-5366"><span class="linenos">5366</span></a><span class="sd"> Args:</span> +</span><span id="L-5367"><a href="#L-5367"><span class="linenos">5367</span></a><span class="sd"> sql_path: a `[catalog].[schema].[table]` string.</span> +</span><span id="L-5368"><a href="#L-5368"><span class="linenos">5368</span></a><span class="sd"> dialect: the source dialect according to which the table name will be parsed.</span> +</span><span id="L-5369"><a href="#L-5369"><span class="linenos">5369</span></a><span class="sd"> kwargs: the kwargs to instantiate the resulting `Table` expression with.</span> +</span><span id="L-5370"><a href="#L-5370"><span class="linenos">5370</span></a> +</span><span id="L-5371"><a href="#L-5371"><span class="linenos">5371</span></a><span class="sd"> Returns:</span> +</span><span id="L-5372"><a href="#L-5372"><span class="linenos">5372</span></a><span class="sd"> A table expression.</span> +</span><span id="L-5373"><a href="#L-5373"><span class="linenos">5373</span></a><span class="sd"> """</span> +</span><span id="L-5374"><a href="#L-5374"><span class="linenos">5374</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-5375"><a href="#L-5375"><span class="linenos">5375</span></a> <span class="k">return</span> <span class="n">sql_path</span> +</span><span id="L-5376"><a href="#L-5376"><span class="linenos">5376</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-5377"><a href="#L-5377"><span class="linenos">5377</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-5378"><a href="#L-5378"><span class="linenos">5378</span></a> +</span><span id="L-5379"><a href="#L-5379"><span class="linenos">5379</span></a> <span class="n">table</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_path</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-5380"><a href="#L-5380"><span class="linenos">5380</span></a> <span class="k">if</span> <span class="n">table</span><span class="p">:</span> +</span><span id="L-5381"><a href="#L-5381"><span class="linenos">5381</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">kwargs</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="L-5382"><a href="#L-5382"><span class="linenos">5382</span></a> <span class="n">table</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-5383"><a href="#L-5383"><span class="linenos">5383</span></a> -</span><span id="L-5384"><a href="#L-5384"><span class="linenos">5384</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-5385"><a href="#L-5385"><span class="linenos">5385</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5386"><a href="#L-5386"><span class="linenos">5386</span></a><span class="sd"> Create a column from a `[table].[column]` sql path. Schema is optional.</span> -</span><span id="L-5387"><a href="#L-5387"><span class="linenos">5387</span></a> -</span><span id="L-5388"><a href="#L-5388"><span class="linenos">5388</span></a><span class="sd"> If a column is passed in then that column is returned.</span> -</span><span id="L-5389"><a href="#L-5389"><span class="linenos">5389</span></a> -</span><span id="L-5390"><a href="#L-5390"><span class="linenos">5390</span></a><span class="sd"> Args:</span> -</span><span id="L-5391"><a href="#L-5391"><span class="linenos">5391</span></a><span class="sd"> sql_path: `[table].[column]` string</span> -</span><span id="L-5392"><a href="#L-5392"><span class="linenos">5392</span></a><span class="sd"> Returns:</span> -</span><span id="L-5393"><a href="#L-5393"><span class="linenos">5393</span></a><span class="sd"> Table: A column expression</span> -</span><span id="L-5394"><a href="#L-5394"><span class="linenos">5394</span></a><span class="sd"> """</span> -</span><span id="L-5395"><a href="#L-5395"><span class="linenos">5395</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-5396"><a href="#L-5396"><span class="linenos">5396</span></a> <span class="k">return</span> <span class="n">sql_path</span> -</span><span id="L-5397"><a href="#L-5397"><span class="linenos">5397</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-5398"><a href="#L-5398"><span class="linenos">5398</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-5399"><a href="#L-5399"><span class="linenos">5399</span></a> <span class="k">return</span> <span class="n">column</span><span class="p">(</span><span class="o">*</span><span class="nb">reversed</span><span class="p">(</span><span class="n">sql_path</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"."</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-5400"><a href="#L-5400"><span class="linenos">5400</span></a> -</span><span id="L-5401"><a href="#L-5401"><span class="linenos">5401</span></a> -</span><span id="L-5402"><a href="#L-5402"><span class="linenos">5402</span></a><span class="k">def</span> <span class="nf">alias_</span><span class="p">(</span> -</span><span id="L-5403"><a href="#L-5403"><span class="linenos">5403</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-5404"><a href="#L-5404"><span class="linenos">5404</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-5405"><a href="#L-5405"><span class="linenos">5405</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-5406"><a href="#L-5406"><span class="linenos">5406</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-5407"><a href="#L-5407"><span class="linenos">5407</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-5408"><a href="#L-5408"><span class="linenos">5408</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-5409"><a href="#L-5409"><span class="linenos">5409</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-5410"><a href="#L-5410"><span class="linenos">5410</span></a><span class="p">):</span> -</span><span id="L-5411"><a href="#L-5411"><span class="linenos">5411</span></a><span class="w"> </span><span class="sd">"""Create an Alias expression.</span> -</span><span id="L-5412"><a href="#L-5412"><span class="linenos">5412</span></a> -</span><span id="L-5413"><a href="#L-5413"><span class="linenos">5413</span></a><span class="sd"> Example:</span> -</span><span id="L-5414"><a href="#L-5414"><span class="linenos">5414</span></a><span class="sd"> >>> alias_('foo', 'bar').sql()</span> -</span><span id="L-5415"><a href="#L-5415"><span class="linenos">5415</span></a><span class="sd"> 'foo AS bar'</span> -</span><span id="L-5416"><a href="#L-5416"><span class="linenos">5416</span></a> -</span><span id="L-5417"><a href="#L-5417"><span class="linenos">5417</span></a><span class="sd"> >>> alias_('(select 1, 2)', 'bar', table=['a', 'b']).sql()</span> -</span><span id="L-5418"><a href="#L-5418"><span class="linenos">5418</span></a><span class="sd"> '(SELECT 1, 2) AS bar(a, b)'</span> +</span><span id="L-5384"><a href="#L-5384"><span class="linenos">5384</span></a> <span class="k">return</span> <span class="n">table</span> +</span><span id="L-5385"><a href="#L-5385"><span class="linenos">5385</span></a> +</span><span id="L-5386"><a href="#L-5386"><span class="linenos">5386</span></a> +</span><span id="L-5387"><a href="#L-5387"><span class="linenos">5387</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-5388"><a href="#L-5388"><span class="linenos">5388</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5389"><a href="#L-5389"><span class="linenos">5389</span></a><span class="sd"> Create a column from a `[table].[column]` sql path. Schema is optional.</span> +</span><span id="L-5390"><a href="#L-5390"><span class="linenos">5390</span></a> +</span><span id="L-5391"><a href="#L-5391"><span class="linenos">5391</span></a><span class="sd"> If a column is passed in then that column is returned.</span> +</span><span id="L-5392"><a href="#L-5392"><span class="linenos">5392</span></a> +</span><span id="L-5393"><a href="#L-5393"><span class="linenos">5393</span></a><span class="sd"> Args:</span> +</span><span id="L-5394"><a href="#L-5394"><span class="linenos">5394</span></a><span class="sd"> sql_path: `[table].[column]` string</span> +</span><span id="L-5395"><a href="#L-5395"><span class="linenos">5395</span></a><span class="sd"> Returns:</span> +</span><span id="L-5396"><a href="#L-5396"><span class="linenos">5396</span></a><span class="sd"> Table: A column expression</span> +</span><span id="L-5397"><a href="#L-5397"><span class="linenos">5397</span></a><span class="sd"> """</span> +</span><span id="L-5398"><a href="#L-5398"><span class="linenos">5398</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-5399"><a href="#L-5399"><span class="linenos">5399</span></a> <span class="k">return</span> <span class="n">sql_path</span> +</span><span id="L-5400"><a href="#L-5400"><span class="linenos">5400</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-5401"><a href="#L-5401"><span class="linenos">5401</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-5402"><a href="#L-5402"><span class="linenos">5402</span></a> <span class="k">return</span> <span class="n">column</span><span class="p">(</span><span class="o">*</span><span class="nb">reversed</span><span class="p">(</span><span class="n">sql_path</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"."</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-5403"><a href="#L-5403"><span class="linenos">5403</span></a> +</span><span id="L-5404"><a href="#L-5404"><span class="linenos">5404</span></a> +</span><span id="L-5405"><a href="#L-5405"><span class="linenos">5405</span></a><span class="k">def</span> <span class="nf">alias_</span><span class="p">(</span> +</span><span id="L-5406"><a href="#L-5406"><span class="linenos">5406</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-5407"><a href="#L-5407"><span class="linenos">5407</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-5408"><a href="#L-5408"><span class="linenos">5408</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-5409"><a href="#L-5409"><span class="linenos">5409</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-5410"><a href="#L-5410"><span class="linenos">5410</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-5411"><a href="#L-5411"><span class="linenos">5411</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-5412"><a href="#L-5412"><span class="linenos">5412</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-5413"><a href="#L-5413"><span class="linenos">5413</span></a><span class="p">):</span> +</span><span id="L-5414"><a href="#L-5414"><span class="linenos">5414</span></a><span class="w"> </span><span class="sd">"""Create an Alias expression.</span> +</span><span id="L-5415"><a href="#L-5415"><span class="linenos">5415</span></a> +</span><span id="L-5416"><a href="#L-5416"><span class="linenos">5416</span></a><span class="sd"> Example:</span> +</span><span id="L-5417"><a href="#L-5417"><span class="linenos">5417</span></a><span class="sd"> >>> alias_('foo', 'bar').sql()</span> +</span><span id="L-5418"><a href="#L-5418"><span class="linenos">5418</span></a><span class="sd"> 'foo AS bar'</span> </span><span id="L-5419"><a href="#L-5419"><span class="linenos">5419</span></a> -</span><span id="L-5420"><a href="#L-5420"><span class="linenos">5420</span></a><span class="sd"> Args:</span> -</span><span id="L-5421"><a href="#L-5421"><span class="linenos">5421</span></a><span class="sd"> expression: the SQL code strings to parse.</span> -</span><span id="L-5422"><a href="#L-5422"><span class="linenos">5422</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-5423"><a href="#L-5423"><span class="linenos">5423</span></a><span class="sd"> alias: the alias name to use. If the name has</span> -</span><span id="L-5424"><a href="#L-5424"><span class="linenos">5424</span></a><span class="sd"> special characters it is quoted.</span> -</span><span id="L-5425"><a href="#L-5425"><span class="linenos">5425</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-5426"><a href="#L-5426"><span class="linenos">5426</span></a><span class="sd"> quoted: whether or not to quote the alias</span> -</span><span id="L-5427"><a href="#L-5427"><span class="linenos">5427</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-5428"><a href="#L-5428"><span class="linenos">5428</span></a><span class="sd"> copy: Whether or not to copy the expression.</span> -</span><span id="L-5429"><a href="#L-5429"><span class="linenos">5429</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-5430"><a href="#L-5430"><span class="linenos">5430</span></a> -</span><span id="L-5431"><a href="#L-5431"><span class="linenos">5431</span></a><span class="sd"> Returns:</span> -</span><span id="L-5432"><a href="#L-5432"><span class="linenos">5432</span></a><span class="sd"> Alias: the aliased expression</span> -</span><span id="L-5433"><a href="#L-5433"><span class="linenos">5433</span></a><span class="sd"> """</span> -</span><span id="L-5434"><a href="#L-5434"><span class="linenos">5434</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-5435"><a href="#L-5435"><span class="linenos">5435</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-5436"><a href="#L-5436"><span class="linenos">5436</span></a> -</span><span id="L-5437"><a href="#L-5437"><span class="linenos">5437</span></a> <span class="k">if</span> <span class="n">table</span><span class="p">:</span> -</span><span id="L-5438"><a href="#L-5438"><span class="linenos">5438</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-5439"><a href="#L-5439"><span class="linenos">5439</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-5440"><a href="#L-5440"><span class="linenos">5440</span></a> -</span><span id="L-5441"><a href="#L-5441"><span class="linenos">5441</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-5442"><a href="#L-5442"><span class="linenos">5442</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-5443"><a href="#L-5443"><span class="linenos">5443</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-5444"><a href="#L-5444"><span class="linenos">5444</span></a> -</span><span id="L-5445"><a href="#L-5445"><span class="linenos">5445</span></a> <span class="k">return</span> <span class="n">exp</span> -</span><span id="L-5446"><a href="#L-5446"><span class="linenos">5446</span></a> -</span><span id="L-5447"><a href="#L-5447"><span class="linenos">5447</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-5448"><a href="#L-5448"><span class="linenos">5448</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-5449"><a href="#L-5449"><span class="linenos">5449</span></a> <span class="c1"># for the complete Window expression.</span> -</span><span id="L-5450"><a href="#L-5450"><span class="linenos">5450</span></a> <span class="c1">#</span> -</span><span id="L-5451"><a href="#L-5451"><span class="linenos">5451</span></a> <span class="c1"># [1]: https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls</span> -</span><span id="L-5452"><a href="#L-5452"><span class="linenos">5452</span></a> -</span><span id="L-5453"><a href="#L-5453"><span class="linenos">5453</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-5454"><a href="#L-5454"><span class="linenos">5454</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-5455"><a href="#L-5455"><span class="linenos">5455</span></a> <span class="k">return</span> <span class="n">exp</span> -</span><span id="L-5456"><a href="#L-5456"><span class="linenos">5456</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-5457"><a href="#L-5457"><span class="linenos">5457</span></a> -</span><span id="L-5458"><a href="#L-5458"><span class="linenos">5458</span></a> -</span><span id="L-5459"><a href="#L-5459"><span class="linenos">5459</span></a><span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span> -</span><span id="L-5460"><a href="#L-5460"><span class="linenos">5460</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="L-5461"><a href="#L-5461"><span class="linenos">5461</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="n">Identifier</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-5462"><a href="#L-5462"><span class="linenos">5462</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-5463"><a href="#L-5463"><span class="linenos">5463</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-5464"><a href="#L-5464"><span class="linenos">5464</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-5465"><a href="#L-5465"><span class="linenos">5465</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5466"><a href="#L-5466"><span class="linenos">5466</span></a><span class="sd"> Build a subquery expression.</span> -</span><span id="L-5467"><a href="#L-5467"><span class="linenos">5467</span></a> -</span><span id="L-5468"><a href="#L-5468"><span class="linenos">5468</span></a><span class="sd"> Example:</span> -</span><span id="L-5469"><a href="#L-5469"><span class="linenos">5469</span></a><span class="sd"> >>> subquery('select x from tbl', 'bar').select('x').sql()</span> -</span><span id="L-5470"><a href="#L-5470"><span class="linenos">5470</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl) AS bar'</span> -</span><span id="L-5471"><a href="#L-5471"><span class="linenos">5471</span></a> -</span><span id="L-5472"><a href="#L-5472"><span class="linenos">5472</span></a><span class="sd"> Args:</span> -</span><span id="L-5473"><a href="#L-5473"><span class="linenos">5473</span></a><span class="sd"> expression: the SQL code strings to parse.</span> -</span><span id="L-5474"><a href="#L-5474"><span class="linenos">5474</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-5475"><a href="#L-5475"><span class="linenos">5475</span></a><span class="sd"> alias: the alias name to use.</span> -</span><span id="L-5476"><a href="#L-5476"><span class="linenos">5476</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-5477"><a href="#L-5477"><span class="linenos">5477</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-5478"><a href="#L-5478"><span class="linenos">5478</span></a> -</span><span id="L-5479"><a href="#L-5479"><span class="linenos">5479</span></a><span class="sd"> Returns:</span> -</span><span id="L-5480"><a href="#L-5480"><span class="linenos">5480</span></a><span class="sd"> A new Select instance with the subquery expression included.</span> -</span><span id="L-5481"><a href="#L-5481"><span class="linenos">5481</span></a><span class="sd"> """</span> -</span><span id="L-5482"><a href="#L-5482"><span class="linenos">5482</span></a> -</span><span id="L-5483"><a href="#L-5483"><span class="linenos">5483</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-5484"><a href="#L-5484"><span class="linenos">5484</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-5420"><a href="#L-5420"><span class="linenos">5420</span></a><span class="sd"> >>> alias_('(select 1, 2)', 'bar', table=['a', 'b']).sql()</span> +</span><span id="L-5421"><a href="#L-5421"><span class="linenos">5421</span></a><span class="sd"> '(SELECT 1, 2) AS bar(a, b)'</span> +</span><span id="L-5422"><a href="#L-5422"><span class="linenos">5422</span></a> +</span><span id="L-5423"><a href="#L-5423"><span class="linenos">5423</span></a><span class="sd"> Args:</span> +</span><span id="L-5424"><a href="#L-5424"><span class="linenos">5424</span></a><span class="sd"> expression: the SQL code strings to parse.</span> +</span><span id="L-5425"><a href="#L-5425"><span class="linenos">5425</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-5426"><a href="#L-5426"><span class="linenos">5426</span></a><span class="sd"> alias: the alias name to use. If the name has</span> +</span><span id="L-5427"><a href="#L-5427"><span class="linenos">5427</span></a><span class="sd"> special characters it is quoted.</span> +</span><span id="L-5428"><a href="#L-5428"><span class="linenos">5428</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-5429"><a href="#L-5429"><span class="linenos">5429</span></a><span class="sd"> quoted: whether or not to quote the alias</span> +</span><span id="L-5430"><a href="#L-5430"><span class="linenos">5430</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-5431"><a href="#L-5431"><span class="linenos">5431</span></a><span class="sd"> copy: Whether or not to copy the expression.</span> +</span><span id="L-5432"><a href="#L-5432"><span class="linenos">5432</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="L-5433"><a href="#L-5433"><span class="linenos">5433</span></a> +</span><span id="L-5434"><a href="#L-5434"><span class="linenos">5434</span></a><span class="sd"> Returns:</span> +</span><span id="L-5435"><a href="#L-5435"><span class="linenos">5435</span></a><span class="sd"> Alias: the aliased expression</span> +</span><span id="L-5436"><a href="#L-5436"><span class="linenos">5436</span></a><span class="sd"> """</span> +</span><span id="L-5437"><a href="#L-5437"><span class="linenos">5437</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-5438"><a href="#L-5438"><span class="linenos">5438</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-5439"><a href="#L-5439"><span class="linenos">5439</span></a> +</span><span id="L-5440"><a href="#L-5440"><span class="linenos">5440</span></a> <span class="k">if</span> <span class="n">table</span><span class="p">:</span> +</span><span id="L-5441"><a href="#L-5441"><span class="linenos">5441</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-5442"><a href="#L-5442"><span class="linenos">5442</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-5443"><a href="#L-5443"><span class="linenos">5443</span></a> +</span><span id="L-5444"><a href="#L-5444"><span class="linenos">5444</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-5445"><a href="#L-5445"><span class="linenos">5445</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-5446"><a href="#L-5446"><span class="linenos">5446</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-5447"><a href="#L-5447"><span class="linenos">5447</span></a> +</span><span id="L-5448"><a href="#L-5448"><span class="linenos">5448</span></a> <span class="k">return</span> <span class="n">exp</span> +</span><span id="L-5449"><a href="#L-5449"><span class="linenos">5449</span></a> +</span><span id="L-5450"><a href="#L-5450"><span class="linenos">5450</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-5451"><a href="#L-5451"><span class="linenos">5451</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-5452"><a href="#L-5452"><span class="linenos">5452</span></a> <span class="c1"># for the complete Window expression.</span> +</span><span id="L-5453"><a href="#L-5453"><span class="linenos">5453</span></a> <span class="c1">#</span> +</span><span id="L-5454"><a href="#L-5454"><span class="linenos">5454</span></a> <span class="c1"># [1]: https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls</span> +</span><span id="L-5455"><a href="#L-5455"><span class="linenos">5455</span></a> +</span><span id="L-5456"><a href="#L-5456"><span class="linenos">5456</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-5457"><a href="#L-5457"><span class="linenos">5457</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-5458"><a href="#L-5458"><span class="linenos">5458</span></a> <span class="k">return</span> <span class="n">exp</span> +</span><span id="L-5459"><a href="#L-5459"><span class="linenos">5459</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-5460"><a href="#L-5460"><span class="linenos">5460</span></a> +</span><span id="L-5461"><a href="#L-5461"><span class="linenos">5461</span></a> +</span><span id="L-5462"><a href="#L-5462"><span class="linenos">5462</span></a><span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span> +</span><span id="L-5463"><a href="#L-5463"><span class="linenos">5463</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="L-5464"><a href="#L-5464"><span class="linenos">5464</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="n">Identifier</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-5465"><a href="#L-5465"><span class="linenos">5465</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-5466"><a href="#L-5466"><span class="linenos">5466</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-5467"><a href="#L-5467"><span class="linenos">5467</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-5468"><a href="#L-5468"><span class="linenos">5468</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5469"><a href="#L-5469"><span class="linenos">5469</span></a><span class="sd"> Build a subquery expression.</span> +</span><span id="L-5470"><a href="#L-5470"><span class="linenos">5470</span></a> +</span><span id="L-5471"><a href="#L-5471"><span class="linenos">5471</span></a><span class="sd"> Example:</span> +</span><span id="L-5472"><a href="#L-5472"><span class="linenos">5472</span></a><span class="sd"> >>> subquery('select x from tbl', 'bar').select('x').sql()</span> +</span><span id="L-5473"><a href="#L-5473"><span class="linenos">5473</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl) AS bar'</span> +</span><span id="L-5474"><a href="#L-5474"><span class="linenos">5474</span></a> +</span><span id="L-5475"><a href="#L-5475"><span class="linenos">5475</span></a><span class="sd"> Args:</span> +</span><span id="L-5476"><a href="#L-5476"><span class="linenos">5476</span></a><span class="sd"> expression: the SQL code strings to parse.</span> +</span><span id="L-5477"><a href="#L-5477"><span class="linenos">5477</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-5478"><a href="#L-5478"><span class="linenos">5478</span></a><span class="sd"> alias: the alias name to use.</span> +</span><span id="L-5479"><a href="#L-5479"><span class="linenos">5479</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-5480"><a href="#L-5480"><span class="linenos">5480</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="L-5481"><a href="#L-5481"><span class="linenos">5481</span></a> +</span><span id="L-5482"><a href="#L-5482"><span class="linenos">5482</span></a><span class="sd"> Returns:</span> +</span><span id="L-5483"><a href="#L-5483"><span class="linenos">5483</span></a><span class="sd"> A new Select instance with the subquery expression included.</span> +</span><span id="L-5484"><a href="#L-5484"><span class="linenos">5484</span></a><span class="sd"> """</span> </span><span id="L-5485"><a href="#L-5485"><span class="linenos">5485</span></a> -</span><span id="L-5486"><a href="#L-5486"><span class="linenos">5486</span></a> -</span><span id="L-5487"><a href="#L-5487"><span class="linenos">5487</span></a><span class="k">def</span> <span class="nf">column</span><span class="p">(</span> -</span><span id="L-5488"><a href="#L-5488"><span class="linenos">5488</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-5489"><a href="#L-5489"><span class="linenos">5489</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-5490"><a href="#L-5490"><span class="linenos">5490</span></a> <span class="n">db</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-5491"><a href="#L-5491"><span class="linenos">5491</span></a> <span class="n">catalog</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-5492"><a href="#L-5492"><span class="linenos">5492</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-5493"><a href="#L-5493"><span class="linenos">5493</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Column</span><span class="p">:</span> -</span><span id="L-5494"><a href="#L-5494"><span class="linenos">5494</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5495"><a href="#L-5495"><span class="linenos">5495</span></a><span class="sd"> Build a Column.</span> -</span><span id="L-5496"><a href="#L-5496"><span class="linenos">5496</span></a> -</span><span id="L-5497"><a href="#L-5497"><span class="linenos">5497</span></a><span class="sd"> Args:</span> -</span><span id="L-5498"><a href="#L-5498"><span class="linenos">5498</span></a><span class="sd"> col: Column name.</span> -</span><span id="L-5499"><a href="#L-5499"><span class="linenos">5499</span></a><span class="sd"> table: Table name.</span> -</span><span id="L-5500"><a href="#L-5500"><span class="linenos">5500</span></a><span class="sd"> db: Database name.</span> -</span><span id="L-5501"><a href="#L-5501"><span class="linenos">5501</span></a><span class="sd"> catalog: Catalog name.</span> -</span><span id="L-5502"><a href="#L-5502"><span class="linenos">5502</span></a><span class="sd"> quoted: Whether to force quotes on the column's identifiers.</span> -</span><span id="L-5503"><a href="#L-5503"><span class="linenos">5503</span></a> -</span><span id="L-5504"><a href="#L-5504"><span class="linenos">5504</span></a><span class="sd"> Returns:</span> -</span><span id="L-5505"><a href="#L-5505"><span class="linenos">5505</span></a><span class="sd"> The new Column instance.</span> -</span><span id="L-5506"><a href="#L-5506"><span class="linenos">5506</span></a><span class="sd"> """</span> -</span><span id="L-5507"><a href="#L-5507"><span class="linenos">5507</span></a> <span class="k">return</span> <span class="n">Column</span><span class="p">(</span> -</span><span id="L-5508"><a href="#L-5508"><span class="linenos">5508</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-5509"><a href="#L-5509"><span class="linenos">5509</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-5510"><a href="#L-5510"><span class="linenos">5510</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-5511"><a href="#L-5511"><span class="linenos">5511</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-5512"><a href="#L-5512"><span class="linenos">5512</span></a> <span class="p">)</span> -</span><span id="L-5513"><a href="#L-5513"><span class="linenos">5513</span></a> -</span><span id="L-5514"><a href="#L-5514"><span class="linenos">5514</span></a> -</span><span id="L-5515"><a href="#L-5515"><span class="linenos">5515</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="n">ExpOrStr</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-5516"><a href="#L-5516"><span class="linenos">5516</span></a><span class="w"> </span><span class="sd">"""Cast an expression to a data type.</span> +</span><span id="L-5486"><a href="#L-5486"><span class="linenos">5486</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-5487"><a href="#L-5487"><span class="linenos">5487</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-5488"><a href="#L-5488"><span class="linenos">5488</span></a> +</span><span id="L-5489"><a href="#L-5489"><span class="linenos">5489</span></a> +</span><span id="L-5490"><a href="#L-5490"><span class="linenos">5490</span></a><span class="k">def</span> <span class="nf">column</span><span class="p">(</span> +</span><span id="L-5491"><a href="#L-5491"><span class="linenos">5491</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-5492"><a href="#L-5492"><span class="linenos">5492</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-5493"><a href="#L-5493"><span class="linenos">5493</span></a> <span class="n">db</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-5494"><a href="#L-5494"><span class="linenos">5494</span></a> <span class="n">catalog</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-5495"><a href="#L-5495"><span class="linenos">5495</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-5496"><a href="#L-5496"><span class="linenos">5496</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Column</span><span class="p">:</span> +</span><span id="L-5497"><a href="#L-5497"><span class="linenos">5497</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5498"><a href="#L-5498"><span class="linenos">5498</span></a><span class="sd"> Build a Column.</span> +</span><span id="L-5499"><a href="#L-5499"><span class="linenos">5499</span></a> +</span><span id="L-5500"><a href="#L-5500"><span class="linenos">5500</span></a><span class="sd"> Args:</span> +</span><span id="L-5501"><a href="#L-5501"><span class="linenos">5501</span></a><span class="sd"> col: Column name.</span> +</span><span id="L-5502"><a href="#L-5502"><span class="linenos">5502</span></a><span class="sd"> table: Table name.</span> +</span><span id="L-5503"><a href="#L-5503"><span class="linenos">5503</span></a><span class="sd"> db: Database name.</span> +</span><span id="L-5504"><a href="#L-5504"><span class="linenos">5504</span></a><span class="sd"> catalog: Catalog name.</span> +</span><span id="L-5505"><a href="#L-5505"><span class="linenos">5505</span></a><span class="sd"> quoted: Whether to force quotes on the column's identifiers.</span> +</span><span id="L-5506"><a href="#L-5506"><span class="linenos">5506</span></a> +</span><span id="L-5507"><a href="#L-5507"><span class="linenos">5507</span></a><span class="sd"> Returns:</span> +</span><span id="L-5508"><a href="#L-5508"><span class="linenos">5508</span></a><span class="sd"> The new Column instance.</span> +</span><span id="L-5509"><a href="#L-5509"><span class="linenos">5509</span></a><span class="sd"> """</span> +</span><span id="L-5510"><a href="#L-5510"><span class="linenos">5510</span></a> <span class="k">return</span> <span class="n">Column</span><span class="p">(</span> +</span><span id="L-5511"><a href="#L-5511"><span class="linenos">5511</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-5512"><a href="#L-5512"><span class="linenos">5512</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-5513"><a href="#L-5513"><span class="linenos">5513</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-5514"><a href="#L-5514"><span class="linenos">5514</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-5515"><a href="#L-5515"><span class="linenos">5515</span></a> <span class="p">)</span> +</span><span id="L-5516"><a href="#L-5516"><span class="linenos">5516</span></a> </span><span id="L-5517"><a href="#L-5517"><span class="linenos">5517</span></a> -</span><span id="L-5518"><a href="#L-5518"><span class="linenos">5518</span></a><span class="sd"> Example:</span> -</span><span id="L-5519"><a href="#L-5519"><span class="linenos">5519</span></a><span class="sd"> >>> cast('x + 1', 'int').sql()</span> -</span><span id="L-5520"><a href="#L-5520"><span class="linenos">5520</span></a><span class="sd"> 'CAST(x + 1 AS INT)'</span> -</span><span id="L-5521"><a href="#L-5521"><span class="linenos">5521</span></a> -</span><span id="L-5522"><a href="#L-5522"><span class="linenos">5522</span></a><span class="sd"> Args:</span> -</span><span id="L-5523"><a href="#L-5523"><span class="linenos">5523</span></a><span class="sd"> expression: The expression to cast.</span> -</span><span id="L-5524"><a href="#L-5524"><span class="linenos">5524</span></a><span class="sd"> to: The datatype to cast to.</span> -</span><span id="L-5525"><a href="#L-5525"><span class="linenos">5525</span></a> -</span><span id="L-5526"><a href="#L-5526"><span class="linenos">5526</span></a><span class="sd"> Returns:</span> -</span><span id="L-5527"><a href="#L-5527"><span class="linenos">5527</span></a><span class="sd"> The new Cast instance.</span> -</span><span id="L-5528"><a href="#L-5528"><span class="linenos">5528</span></a><span class="sd"> """</span> -</span><span id="L-5529"><a href="#L-5529"><span class="linenos">5529</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-5530"><a href="#L-5530"><span class="linenos">5530</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-5531"><a href="#L-5531"><span class="linenos">5531</span></a> -</span><span id="L-5532"><a href="#L-5532"><span class="linenos">5532</span></a> -</span><span id="L-5533"><a href="#L-5533"><span class="linenos">5533</span></a><span class="k">def</span> <span class="nf">table_</span><span class="p">(</span> -</span><span id="L-5534"><a href="#L-5534"><span class="linenos">5534</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">Identifier</span> <span class="o">|</span> <span class="nb">str</span><span class="p">,</span> -</span><span id="L-5535"><a href="#L-5535"><span class="linenos">5535</span></a> <span class="n">db</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">Identifier</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-5536"><a href="#L-5536"><span class="linenos">5536</span></a> <span class="n">catalog</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">Identifier</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-5537"><a href="#L-5537"><span class="linenos">5537</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-5538"><a href="#L-5538"><span class="linenos">5538</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="n">Identifier</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-5539"><a href="#L-5539"><span class="linenos">5539</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Table</span><span class="p">:</span> -</span><span id="L-5540"><a href="#L-5540"><span class="linenos">5540</span></a><span class="w"> </span><span class="sd">"""Build a Table.</span> -</span><span id="L-5541"><a href="#L-5541"><span class="linenos">5541</span></a> -</span><span id="L-5542"><a href="#L-5542"><span class="linenos">5542</span></a><span class="sd"> Args:</span> -</span><span id="L-5543"><a href="#L-5543"><span class="linenos">5543</span></a><span class="sd"> table: Table name.</span> -</span><span id="L-5544"><a href="#L-5544"><span class="linenos">5544</span></a><span class="sd"> db: Database name.</span> -</span><span id="L-5545"><a href="#L-5545"><span class="linenos">5545</span></a><span class="sd"> catalog: Catalog name.</span> -</span><span id="L-5546"><a href="#L-5546"><span class="linenos">5546</span></a><span class="sd"> quote: Whether to force quotes on the table's identifiers.</span> -</span><span id="L-5547"><a href="#L-5547"><span class="linenos">5547</span></a><span class="sd"> alias: Table's alias.</span> -</span><span id="L-5548"><a href="#L-5548"><span class="linenos">5548</span></a> -</span><span id="L-5549"><a href="#L-5549"><span class="linenos">5549</span></a><span class="sd"> Returns:</span> -</span><span id="L-5550"><a href="#L-5550"><span class="linenos">5550</span></a><span class="sd"> The new Table instance.</span> -</span><span id="L-5551"><a href="#L-5551"><span class="linenos">5551</span></a><span class="sd"> """</span> -</span><span id="L-5552"><a href="#L-5552"><span class="linenos">5552</span></a> <span class="k">return</span> <span class="n">Table</span><span class="p">(</span> -</span><span id="L-5553"><a href="#L-5553"><span class="linenos">5553</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-5554"><a href="#L-5554"><span class="linenos">5554</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-5555"><a href="#L-5555"><span class="linenos">5555</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-5556"><a href="#L-5556"><span class="linenos">5556</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-5557"><a href="#L-5557"><span class="linenos">5557</span></a> <span class="p">)</span> -</span><span id="L-5558"><a href="#L-5558"><span class="linenos">5558</span></a> -</span><span id="L-5559"><a href="#L-5559"><span class="linenos">5559</span></a> -</span><span id="L-5560"><a href="#L-5560"><span class="linenos">5560</span></a><span class="k">def</span> <span class="nf">values</span><span class="p">(</span> -</span><span id="L-5561"><a href="#L-5561"><span class="linenos">5561</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-5562"><a href="#L-5562"><span class="linenos">5562</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-5563"><a href="#L-5563"><span class="linenos">5563</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-5564"><a href="#L-5564"><span class="linenos">5564</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Values</span><span class="p">:</span> -</span><span id="L-5565"><a href="#L-5565"><span class="linenos">5565</span></a><span class="w"> </span><span class="sd">"""Build VALUES statement.</span> -</span><span id="L-5566"><a href="#L-5566"><span class="linenos">5566</span></a> -</span><span id="L-5567"><a href="#L-5567"><span class="linenos">5567</span></a><span class="sd"> Example:</span> -</span><span id="L-5568"><a href="#L-5568"><span class="linenos">5568</span></a><span class="sd"> >>> values([(1, '2')]).sql()</span> -</span><span id="L-5569"><a href="#L-5569"><span class="linenos">5569</span></a><span class="sd"> "VALUES (1, '2')"</span> -</span><span id="L-5570"><a href="#L-5570"><span class="linenos">5570</span></a> -</span><span id="L-5571"><a href="#L-5571"><span class="linenos">5571</span></a><span class="sd"> Args:</span> -</span><span id="L-5572"><a href="#L-5572"><span class="linenos">5572</span></a><span class="sd"> values: values statements that will be converted to SQL</span> -</span><span id="L-5573"><a href="#L-5573"><span class="linenos">5573</span></a><span class="sd"> alias: optional alias</span> -</span><span id="L-5574"><a href="#L-5574"><span class="linenos">5574</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-5575"><a href="#L-5575"><span class="linenos">5575</span></a><span class="sd"> If either are provided then an alias is also required.</span> -</span><span id="L-5576"><a href="#L-5576"><span class="linenos">5576</span></a> -</span><span id="L-5577"><a href="#L-5577"><span class="linenos">5577</span></a><span class="sd"> Returns:</span> -</span><span id="L-5578"><a href="#L-5578"><span class="linenos">5578</span></a><span class="sd"> Values: the Values expression object</span> -</span><span id="L-5579"><a href="#L-5579"><span class="linenos">5579</span></a><span class="sd"> """</span> -</span><span id="L-5580"><a href="#L-5580"><span class="linenos">5580</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-5581"><a href="#L-5581"><span class="linenos">5581</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-5582"><a href="#L-5582"><span class="linenos">5582</span></a> -</span><span id="L-5583"><a href="#L-5583"><span class="linenos">5583</span></a> <span class="k">return</span> <span class="n">Values</span><span class="p">(</span> -</span><span id="L-5584"><a href="#L-5584"><span class="linenos">5584</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-5585"><a href="#L-5585"><span class="linenos">5585</span></a> <span class="n">alias</span><span class="o">=</span><span class="p">(</span> -</span><span id="L-5586"><a href="#L-5586"><span class="linenos">5586</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-5587"><a href="#L-5587"><span class="linenos">5587</span></a> <span class="k">if</span> <span class="n">columns</span> -</span><span id="L-5588"><a href="#L-5588"><span class="linenos">5588</span></a> <span class="k">else</span> <span class="p">(</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-5589"><a href="#L-5589"><span class="linenos">5589</span></a> <span class="p">),</span> -</span><span id="L-5590"><a href="#L-5590"><span class="linenos">5590</span></a> <span class="p">)</span> -</span><span id="L-5591"><a href="#L-5591"><span class="linenos">5591</span></a> -</span><span id="L-5592"><a href="#L-5592"><span class="linenos">5592</span></a> -</span><span id="L-5593"><a href="#L-5593"><span class="linenos">5593</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="n">ExpOrStr</span><span class="p">])</span> <span class="o">-></span> <span class="n">Var</span><span class="p">:</span> -</span><span id="L-5594"><a href="#L-5594"><span class="linenos">5594</span></a><span class="w"> </span><span class="sd">"""Build a SQL variable.</span> +</span><span id="L-5518"><a href="#L-5518"><span class="linenos">5518</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="n">ExpOrStr</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-5519"><a href="#L-5519"><span class="linenos">5519</span></a><span class="w"> </span><span class="sd">"""Cast an expression to a data type.</span> +</span><span id="L-5520"><a href="#L-5520"><span class="linenos">5520</span></a> +</span><span id="L-5521"><a href="#L-5521"><span class="linenos">5521</span></a><span class="sd"> Example:</span> +</span><span id="L-5522"><a href="#L-5522"><span class="linenos">5522</span></a><span class="sd"> >>> cast('x + 1', 'int').sql()</span> +</span><span id="L-5523"><a href="#L-5523"><span class="linenos">5523</span></a><span class="sd"> 'CAST(x + 1 AS INT)'</span> +</span><span id="L-5524"><a href="#L-5524"><span class="linenos">5524</span></a> +</span><span id="L-5525"><a href="#L-5525"><span class="linenos">5525</span></a><span class="sd"> Args:</span> +</span><span id="L-5526"><a href="#L-5526"><span class="linenos">5526</span></a><span class="sd"> expression: The expression to cast.</span> +</span><span id="L-5527"><a href="#L-5527"><span class="linenos">5527</span></a><span class="sd"> to: The datatype to cast to.</span> +</span><span id="L-5528"><a href="#L-5528"><span class="linenos">5528</span></a> +</span><span id="L-5529"><a href="#L-5529"><span class="linenos">5529</span></a><span class="sd"> Returns:</span> +</span><span id="L-5530"><a href="#L-5530"><span class="linenos">5530</span></a><span class="sd"> The new Cast instance.</span> +</span><span id="L-5531"><a href="#L-5531"><span class="linenos">5531</span></a><span class="sd"> """</span> +</span><span id="L-5532"><a href="#L-5532"><span class="linenos">5532</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-5533"><a href="#L-5533"><span class="linenos">5533</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-5534"><a href="#L-5534"><span class="linenos">5534</span></a> +</span><span id="L-5535"><a href="#L-5535"><span class="linenos">5535</span></a> +</span><span id="L-5536"><a href="#L-5536"><span class="linenos">5536</span></a><span class="k">def</span> <span class="nf">table_</span><span class="p">(</span> +</span><span id="L-5537"><a href="#L-5537"><span class="linenos">5537</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">Identifier</span> <span class="o">|</span> <span class="nb">str</span><span class="p">,</span> +</span><span id="L-5538"><a href="#L-5538"><span class="linenos">5538</span></a> <span class="n">db</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">Identifier</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-5539"><a href="#L-5539"><span class="linenos">5539</span></a> <span class="n">catalog</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">Identifier</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-5540"><a href="#L-5540"><span class="linenos">5540</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-5541"><a href="#L-5541"><span class="linenos">5541</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="n">Identifier</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-5542"><a href="#L-5542"><span class="linenos">5542</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Table</span><span class="p">:</span> +</span><span id="L-5543"><a href="#L-5543"><span class="linenos">5543</span></a><span class="w"> </span><span class="sd">"""Build a Table.</span> +</span><span id="L-5544"><a href="#L-5544"><span class="linenos">5544</span></a> +</span><span id="L-5545"><a href="#L-5545"><span class="linenos">5545</span></a><span class="sd"> Args:</span> +</span><span id="L-5546"><a href="#L-5546"><span class="linenos">5546</span></a><span class="sd"> table: Table name.</span> +</span><span id="L-5547"><a href="#L-5547"><span class="linenos">5547</span></a><span class="sd"> db: Database name.</span> +</span><span id="L-5548"><a href="#L-5548"><span class="linenos">5548</span></a><span class="sd"> catalog: Catalog name.</span> +</span><span id="L-5549"><a href="#L-5549"><span class="linenos">5549</span></a><span class="sd"> quote: Whether to force quotes on the table's identifiers.</span> +</span><span id="L-5550"><a href="#L-5550"><span class="linenos">5550</span></a><span class="sd"> alias: Table's alias.</span> +</span><span id="L-5551"><a href="#L-5551"><span class="linenos">5551</span></a> +</span><span id="L-5552"><a href="#L-5552"><span class="linenos">5552</span></a><span class="sd"> Returns:</span> +</span><span id="L-5553"><a href="#L-5553"><span class="linenos">5553</span></a><span class="sd"> The new Table instance.</span> +</span><span id="L-5554"><a href="#L-5554"><span class="linenos">5554</span></a><span class="sd"> """</span> +</span><span id="L-5555"><a href="#L-5555"><span class="linenos">5555</span></a> <span class="k">return</span> <span class="n">Table</span><span class="p">(</span> +</span><span id="L-5556"><a href="#L-5556"><span class="linenos">5556</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-5557"><a href="#L-5557"><span class="linenos">5557</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-5558"><a href="#L-5558"><span class="linenos">5558</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-5559"><a href="#L-5559"><span class="linenos">5559</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-5560"><a href="#L-5560"><span class="linenos">5560</span></a> <span class="p">)</span> +</span><span id="L-5561"><a href="#L-5561"><span class="linenos">5561</span></a> +</span><span id="L-5562"><a href="#L-5562"><span class="linenos">5562</span></a> +</span><span id="L-5563"><a href="#L-5563"><span class="linenos">5563</span></a><span class="k">def</span> <span class="nf">values</span><span class="p">(</span> +</span><span id="L-5564"><a href="#L-5564"><span class="linenos">5564</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-5565"><a href="#L-5565"><span class="linenos">5565</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-5566"><a href="#L-5566"><span class="linenos">5566</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-5567"><a href="#L-5567"><span class="linenos">5567</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Values</span><span class="p">:</span> +</span><span id="L-5568"><a href="#L-5568"><span class="linenos">5568</span></a><span class="w"> </span><span class="sd">"""Build VALUES statement.</span> +</span><span id="L-5569"><a href="#L-5569"><span class="linenos">5569</span></a> +</span><span id="L-5570"><a href="#L-5570"><span class="linenos">5570</span></a><span class="sd"> Example:</span> +</span><span id="L-5571"><a href="#L-5571"><span class="linenos">5571</span></a><span class="sd"> >>> values([(1, '2')]).sql()</span> +</span><span id="L-5572"><a href="#L-5572"><span class="linenos">5572</span></a><span class="sd"> "VALUES (1, '2')"</span> +</span><span id="L-5573"><a href="#L-5573"><span class="linenos">5573</span></a> +</span><span id="L-5574"><a href="#L-5574"><span class="linenos">5574</span></a><span class="sd"> Args:</span> +</span><span id="L-5575"><a href="#L-5575"><span class="linenos">5575</span></a><span class="sd"> values: values statements that will be converted to SQL</span> +</span><span id="L-5576"><a href="#L-5576"><span class="linenos">5576</span></a><span class="sd"> alias: optional alias</span> +</span><span id="L-5577"><a href="#L-5577"><span class="linenos">5577</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-5578"><a href="#L-5578"><span class="linenos">5578</span></a><span class="sd"> If either are provided then an alias is also required.</span> +</span><span id="L-5579"><a href="#L-5579"><span class="linenos">5579</span></a> +</span><span id="L-5580"><a href="#L-5580"><span class="linenos">5580</span></a><span class="sd"> Returns:</span> +</span><span id="L-5581"><a href="#L-5581"><span class="linenos">5581</span></a><span class="sd"> Values: the Values expression object</span> +</span><span id="L-5582"><a href="#L-5582"><span class="linenos">5582</span></a><span class="sd"> """</span> +</span><span id="L-5583"><a href="#L-5583"><span class="linenos">5583</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-5584"><a href="#L-5584"><span class="linenos">5584</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-5585"><a href="#L-5585"><span class="linenos">5585</span></a> +</span><span id="L-5586"><a href="#L-5586"><span class="linenos">5586</span></a> <span class="k">return</span> <span class="n">Values</span><span class="p">(</span> +</span><span id="L-5587"><a href="#L-5587"><span class="linenos">5587</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-5588"><a href="#L-5588"><span class="linenos">5588</span></a> <span class="n">alias</span><span class="o">=</span><span class="p">(</span> +</span><span id="L-5589"><a href="#L-5589"><span class="linenos">5589</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-5590"><a href="#L-5590"><span class="linenos">5590</span></a> <span class="k">if</span> <span class="n">columns</span> +</span><span id="L-5591"><a href="#L-5591"><span class="linenos">5591</span></a> <span class="k">else</span> <span class="p">(</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-5592"><a href="#L-5592"><span class="linenos">5592</span></a> <span class="p">),</span> +</span><span id="L-5593"><a href="#L-5593"><span class="linenos">5593</span></a> <span class="p">)</span> +</span><span id="L-5594"><a href="#L-5594"><span class="linenos">5594</span></a> </span><span id="L-5595"><a href="#L-5595"><span class="linenos">5595</span></a> -</span><span id="L-5596"><a href="#L-5596"><span class="linenos">5596</span></a><span class="sd"> Example:</span> -</span><span id="L-5597"><a href="#L-5597"><span class="linenos">5597</span></a><span class="sd"> >>> repr(var('x'))</span> -</span><span id="L-5598"><a href="#L-5598"><span class="linenos">5598</span></a><span class="sd"> '(VAR this: x)'</span> -</span><span id="L-5599"><a href="#L-5599"><span class="linenos">5599</span></a> -</span><span id="L-5600"><a href="#L-5600"><span class="linenos">5600</span></a><span class="sd"> >>> repr(var(column('x', table='y')))</span> +</span><span id="L-5596"><a href="#L-5596"><span class="linenos">5596</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="n">ExpOrStr</span><span class="p">])</span> <span class="o">-></span> <span class="n">Var</span><span class="p">:</span> +</span><span id="L-5597"><a href="#L-5597"><span class="linenos">5597</span></a><span class="w"> </span><span class="sd">"""Build a SQL variable.</span> +</span><span id="L-5598"><a href="#L-5598"><span class="linenos">5598</span></a> +</span><span id="L-5599"><a href="#L-5599"><span class="linenos">5599</span></a><span class="sd"> Example:</span> +</span><span id="L-5600"><a href="#L-5600"><span class="linenos">5600</span></a><span class="sd"> >>> repr(var('x'))</span> </span><span id="L-5601"><a href="#L-5601"><span class="linenos">5601</span></a><span class="sd"> '(VAR this: x)'</span> </span><span id="L-5602"><a href="#L-5602"><span class="linenos">5602</span></a> -</span><span id="L-5603"><a href="#L-5603"><span class="linenos">5603</span></a><span class="sd"> Args:</span> -</span><span id="L-5604"><a href="#L-5604"><span class="linenos">5604</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-5603"><a href="#L-5603"><span class="linenos">5603</span></a><span class="sd"> >>> repr(var(column('x', table='y')))</span> +</span><span id="L-5604"><a href="#L-5604"><span class="linenos">5604</span></a><span class="sd"> '(VAR this: x)'</span> </span><span id="L-5605"><a href="#L-5605"><span class="linenos">5605</span></a> -</span><span id="L-5606"><a href="#L-5606"><span class="linenos">5606</span></a><span class="sd"> Returns:</span> -</span><span id="L-5607"><a href="#L-5607"><span class="linenos">5607</span></a><span class="sd"> The new variable node.</span> -</span><span id="L-5608"><a href="#L-5608"><span class="linenos">5608</span></a><span class="sd"> """</span> -</span><span id="L-5609"><a href="#L-5609"><span class="linenos">5609</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-5610"><a href="#L-5610"><span class="linenos">5610</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Cannot convert empty name into var."</span><span class="p">)</span> -</span><span id="L-5611"><a href="#L-5611"><span class="linenos">5611</span></a> -</span><span id="L-5612"><a href="#L-5612"><span class="linenos">5612</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-5613"><a href="#L-5613"><span class="linenos">5613</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-5614"><a href="#L-5614"><span class="linenos">5614</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-5615"><a href="#L-5615"><span class="linenos">5615</span></a> -</span><span id="L-5616"><a href="#L-5616"><span class="linenos">5616</span></a> -</span><span id="L-5617"><a href="#L-5617"><span class="linenos">5617</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-5618"><a href="#L-5618"><span class="linenos">5618</span></a><span class="w"> </span><span class="sd">"""Build ALTER TABLE... RENAME... expression</span> +</span><span id="L-5606"><a href="#L-5606"><span class="linenos">5606</span></a><span class="sd"> Args:</span> +</span><span id="L-5607"><a href="#L-5607"><span class="linenos">5607</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-5608"><a href="#L-5608"><span class="linenos">5608</span></a> +</span><span id="L-5609"><a href="#L-5609"><span class="linenos">5609</span></a><span class="sd"> Returns:</span> +</span><span id="L-5610"><a href="#L-5610"><span class="linenos">5610</span></a><span class="sd"> The new variable node.</span> +</span><span id="L-5611"><a href="#L-5611"><span class="linenos">5611</span></a><span class="sd"> """</span> +</span><span id="L-5612"><a href="#L-5612"><span class="linenos">5612</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-5613"><a href="#L-5613"><span class="linenos">5613</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Cannot convert empty name into var."</span><span class="p">)</span> +</span><span id="L-5614"><a href="#L-5614"><span class="linenos">5614</span></a> +</span><span id="L-5615"><a href="#L-5615"><span class="linenos">5615</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-5616"><a href="#L-5616"><span class="linenos">5616</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-5617"><a href="#L-5617"><span class="linenos">5617</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-5618"><a href="#L-5618"><span class="linenos">5618</span></a> </span><span id="L-5619"><a href="#L-5619"><span class="linenos">5619</span></a> -</span><span id="L-5620"><a href="#L-5620"><span class="linenos">5620</span></a><span class="sd"> Args:</span> -</span><span id="L-5621"><a href="#L-5621"><span class="linenos">5621</span></a><span class="sd"> old_name: The old name of the table</span> -</span><span id="L-5622"><a href="#L-5622"><span class="linenos">5622</span></a><span class="sd"> new_name: The new name of the table</span> -</span><span id="L-5623"><a href="#L-5623"><span class="linenos">5623</span></a> -</span><span id="L-5624"><a href="#L-5624"><span class="linenos">5624</span></a><span class="sd"> Returns:</span> -</span><span id="L-5625"><a href="#L-5625"><span class="linenos">5625</span></a><span class="sd"> Alter table expression</span> -</span><span id="L-5626"><a href="#L-5626"><span class="linenos">5626</span></a><span class="sd"> """</span> -</span><span id="L-5627"><a href="#L-5627"><span class="linenos">5627</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-5628"><a href="#L-5628"><span class="linenos">5628</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-5629"><a href="#L-5629"><span class="linenos">5629</span></a> <span class="k">return</span> <span class="n">AlterTable</span><span class="p">(</span> -</span><span id="L-5630"><a href="#L-5630"><span class="linenos">5630</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-5631"><a href="#L-5631"><span class="linenos">5631</span></a> <span class="n">actions</span><span class="o">=</span><span class="p">[</span> -</span><span id="L-5632"><a href="#L-5632"><span class="linenos">5632</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-5633"><a href="#L-5633"><span class="linenos">5633</span></a> <span class="p">],</span> -</span><span id="L-5634"><a href="#L-5634"><span class="linenos">5634</span></a> <span class="p">)</span> -</span><span id="L-5635"><a href="#L-5635"><span class="linenos">5635</span></a> -</span><span id="L-5636"><a href="#L-5636"><span class="linenos">5636</span></a> -</span><span id="L-5637"><a href="#L-5637"><span class="linenos">5637</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="n">t</span><span class="o">.</span><span class="n">Any</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">False</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="L-5638"><a href="#L-5638"><span class="linenos">5638</span></a><span class="w"> </span><span class="sd">"""Convert a python value into an expression object.</span> +</span><span id="L-5620"><a href="#L-5620"><span class="linenos">5620</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-5621"><a href="#L-5621"><span class="linenos">5621</span></a><span class="w"> </span><span class="sd">"""Build ALTER TABLE... RENAME... expression</span> +</span><span id="L-5622"><a href="#L-5622"><span class="linenos">5622</span></a> +</span><span id="L-5623"><a href="#L-5623"><span class="linenos">5623</span></a><span class="sd"> Args:</span> +</span><span id="L-5624"><a href="#L-5624"><span class="linenos">5624</span></a><span class="sd"> old_name: The old name of the table</span> +</span><span id="L-5625"><a href="#L-5625"><span class="linenos">5625</span></a><span class="sd"> new_name: The new name of the table</span> +</span><span id="L-5626"><a href="#L-5626"><span class="linenos">5626</span></a> +</span><span id="L-5627"><a href="#L-5627"><span class="linenos">5627</span></a><span class="sd"> Returns:</span> +</span><span id="L-5628"><a href="#L-5628"><span class="linenos">5628</span></a><span class="sd"> Alter table expression</span> +</span><span id="L-5629"><a href="#L-5629"><span class="linenos">5629</span></a><span class="sd"> """</span> +</span><span id="L-5630"><a href="#L-5630"><span class="linenos">5630</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-5631"><a href="#L-5631"><span class="linenos">5631</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-5632"><a href="#L-5632"><span class="linenos">5632</span></a> <span class="k">return</span> <span class="n">AlterTable</span><span class="p">(</span> +</span><span id="L-5633"><a href="#L-5633"><span class="linenos">5633</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-5634"><a href="#L-5634"><span class="linenos">5634</span></a> <span class="n">actions</span><span class="o">=</span><span class="p">[</span> +</span><span id="L-5635"><a href="#L-5635"><span class="linenos">5635</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-5636"><a href="#L-5636"><span class="linenos">5636</span></a> <span class="p">],</span> +</span><span id="L-5637"><a href="#L-5637"><span class="linenos">5637</span></a> <span class="p">)</span> +</span><span id="L-5638"><a href="#L-5638"><span class="linenos">5638</span></a> </span><span id="L-5639"><a href="#L-5639"><span class="linenos">5639</span></a> -</span><span id="L-5640"><a href="#L-5640"><span class="linenos">5640</span></a><span class="sd"> Raises an error if a conversion is not possible.</span> -</span><span id="L-5641"><a href="#L-5641"><span class="linenos">5641</span></a> -</span><span id="L-5642"><a href="#L-5642"><span class="linenos">5642</span></a><span class="sd"> Args:</span> -</span><span id="L-5643"><a href="#L-5643"><span class="linenos">5643</span></a><span class="sd"> value: A python object.</span> -</span><span id="L-5644"><a href="#L-5644"><span class="linenos">5644</span></a><span class="sd"> copy: Whether or not to copy `value` (only applies to Expressions and collections).</span> -</span><span id="L-5645"><a href="#L-5645"><span class="linenos">5645</span></a> -</span><span id="L-5646"><a href="#L-5646"><span class="linenos">5646</span></a><span class="sd"> Returns:</span> -</span><span id="L-5647"><a href="#L-5647"><span class="linenos">5647</span></a><span class="sd"> Expression: the equivalent expression object.</span> -</span><span id="L-5648"><a href="#L-5648"><span class="linenos">5648</span></a><span class="sd"> """</span> -</span><span id="L-5649"><a href="#L-5649"><span class="linenos">5649</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-5650"><a href="#L-5650"><span class="linenos">5650</span></a> <span class="k">return</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="L-5651"><a href="#L-5651"><span class="linenos">5651</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-5652"><a href="#L-5652"><span class="linenos">5652</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-5653"><a href="#L-5653"><span class="linenos">5653</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-5654"><a href="#L-5654"><span class="linenos">5654</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-5655"><a href="#L-5655"><span class="linenos">5655</span></a> <span class="k">if</span> <span class="n">value</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">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-5656"><a href="#L-5656"><span class="linenos">5656</span></a> <span class="k">return</span> <span class="n">NULL</span> -</span><span id="L-5657"><a href="#L-5657"><span class="linenos">5657</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-5658"><a href="#L-5658"><span class="linenos">5658</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-5659"><a href="#L-5659"><span class="linenos">5659</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-5660"><a href="#L-5660"><span class="linenos">5660</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-5661"><a href="#L-5661"><span class="linenos">5661</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-5662"><a href="#L-5662"><span class="linenos">5662</span></a> <span class="p">)</span> -</span><span id="L-5663"><a href="#L-5663"><span class="linenos">5663</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-5664"><a href="#L-5664"><span class="linenos">5664</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-5665"><a href="#L-5665"><span class="linenos">5665</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-5666"><a href="#L-5666"><span class="linenos">5666</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-5667"><a href="#L-5667"><span class="linenos">5667</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-5668"><a href="#L-5668"><span class="linenos">5668</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5669"><a href="#L-5669"><span class="linenos">5669</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-5670"><a href="#L-5670"><span class="linenos">5670</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5671"><a href="#L-5671"><span class="linenos">5671</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-5672"><a href="#L-5672"><span class="linenos">5672</span></a> <span class="k">return</span> <span class="n">Map</span><span class="p">(</span> -</span><span id="L-5673"><a href="#L-5673"><span class="linenos">5673</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5674"><a href="#L-5674"><span class="linenos">5674</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5675"><a href="#L-5675"><span class="linenos">5675</span></a> <span class="p">)</span> -</span><span id="L-5676"><a href="#L-5676"><span class="linenos">5676</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-5677"><a href="#L-5677"><span class="linenos">5677</span></a> -</span><span id="L-5678"><a href="#L-5678"><span class="linenos">5678</span></a> -</span><span id="L-5679"><a href="#L-5679"><span class="linenos">5679</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">Expression</span><span class="p">,</span> <span class="n">fun</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Callable</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 class="o">-></span> <span class="kc">None</span><span class="p">:</span> -</span><span id="L-5680"><a href="#L-5680"><span class="linenos">5680</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5681"><a href="#L-5681"><span class="linenos">5681</span></a><span class="sd"> Replace children of an expression with the result of a lambda fun(child) -> exp.</span> -</span><span id="L-5682"><a href="#L-5682"><span class="linenos">5682</span></a><span class="sd"> """</span> -</span><span id="L-5683"><a href="#L-5683"><span class="linenos">5683</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-5684"><a href="#L-5684"><span class="linenos">5684</span></a> <span class="n">is_list_arg</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span> -</span><span id="L-5685"><a href="#L-5685"><span class="linenos">5685</span></a> -</span><span id="L-5686"><a href="#L-5686"><span class="linenos">5686</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-5687"><a href="#L-5687"><span class="linenos">5687</span></a> <span class="n">new_child_nodes</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="L-5640"><a href="#L-5640"><span class="linenos">5640</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="n">t</span><span class="o">.</span><span class="n">Any</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">False</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="L-5641"><a href="#L-5641"><span class="linenos">5641</span></a><span class="w"> </span><span class="sd">"""Convert a python value into an expression object.</span> +</span><span id="L-5642"><a href="#L-5642"><span class="linenos">5642</span></a> +</span><span id="L-5643"><a href="#L-5643"><span class="linenos">5643</span></a><span class="sd"> Raises an error if a conversion is not possible.</span> +</span><span id="L-5644"><a href="#L-5644"><span class="linenos">5644</span></a> +</span><span id="L-5645"><a href="#L-5645"><span class="linenos">5645</span></a><span class="sd"> Args:</span> +</span><span id="L-5646"><a href="#L-5646"><span class="linenos">5646</span></a><span class="sd"> value: A python object.</span> +</span><span id="L-5647"><a href="#L-5647"><span class="linenos">5647</span></a><span class="sd"> copy: Whether or not to copy `value` (only applies to Expressions and collections).</span> +</span><span id="L-5648"><a href="#L-5648"><span class="linenos">5648</span></a> +</span><span id="L-5649"><a href="#L-5649"><span class="linenos">5649</span></a><span class="sd"> Returns:</span> +</span><span id="L-5650"><a href="#L-5650"><span class="linenos">5650</span></a><span class="sd"> Expression: the equivalent expression object.</span> +</span><span id="L-5651"><a href="#L-5651"><span class="linenos">5651</span></a><span class="sd"> """</span> +</span><span id="L-5652"><a href="#L-5652"><span class="linenos">5652</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-5653"><a href="#L-5653"><span class="linenos">5653</span></a> <span class="k">return</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="L-5654"><a href="#L-5654"><span class="linenos">5654</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-5655"><a href="#L-5655"><span class="linenos">5655</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-5656"><a href="#L-5656"><span class="linenos">5656</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-5657"><a href="#L-5657"><span class="linenos">5657</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-5658"><a href="#L-5658"><span class="linenos">5658</span></a> <span class="k">if</span> <span class="n">value</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">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-5659"><a href="#L-5659"><span class="linenos">5659</span></a> <span class="k">return</span> <span class="n">NULL</span> +</span><span id="L-5660"><a href="#L-5660"><span class="linenos">5660</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-5661"><a href="#L-5661"><span class="linenos">5661</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-5662"><a href="#L-5662"><span class="linenos">5662</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-5663"><a href="#L-5663"><span class="linenos">5663</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-5664"><a href="#L-5664"><span class="linenos">5664</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-5665"><a href="#L-5665"><span class="linenos">5665</span></a> <span class="p">)</span> +</span><span id="L-5666"><a href="#L-5666"><span class="linenos">5666</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-5667"><a href="#L-5667"><span class="linenos">5667</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-5668"><a href="#L-5668"><span class="linenos">5668</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-5669"><a href="#L-5669"><span class="linenos">5669</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-5670"><a href="#L-5670"><span class="linenos">5670</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-5671"><a href="#L-5671"><span class="linenos">5671</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5672"><a href="#L-5672"><span class="linenos">5672</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-5673"><a href="#L-5673"><span class="linenos">5673</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5674"><a href="#L-5674"><span class="linenos">5674</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-5675"><a href="#L-5675"><span class="linenos">5675</span></a> <span class="k">return</span> <span class="n">Map</span><span class="p">(</span> +</span><span id="L-5676"><a href="#L-5676"><span class="linenos">5676</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5677"><a href="#L-5677"><span class="linenos">5677</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5678"><a href="#L-5678"><span class="linenos">5678</span></a> <span class="p">)</span> +</span><span id="L-5679"><a href="#L-5679"><span class="linenos">5679</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-5680"><a href="#L-5680"><span class="linenos">5680</span></a> +</span><span id="L-5681"><a href="#L-5681"><span class="linenos">5681</span></a> +</span><span id="L-5682"><a href="#L-5682"><span class="linenos">5682</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">Expression</span><span class="p">,</span> <span class="n">fun</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Callable</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 class="o">-></span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-5683"><a href="#L-5683"><span class="linenos">5683</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5684"><a href="#L-5684"><span class="linenos">5684</span></a><span class="sd"> Replace children of an expression with the result of a lambda fun(child) -> exp.</span> +</span><span id="L-5685"><a href="#L-5685"><span class="linenos">5685</span></a><span class="sd"> """</span> +</span><span id="L-5686"><a href="#L-5686"><span class="linenos">5686</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-5687"><a href="#L-5687"><span class="linenos">5687</span></a> <span class="n">is_list_arg</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span> </span><span id="L-5688"><a href="#L-5688"><span class="linenos">5688</span></a> -</span><span id="L-5689"><a href="#L-5689"><span class="linenos">5689</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-5690"><a href="#L-5690"><span class="linenos">5690</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-5691"><a href="#L-5691"><span class="linenos">5691</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 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-5692"><a href="#L-5692"><span class="linenos">5692</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-5693"><a href="#L-5693"><span class="linenos">5693</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-5694"><a href="#L-5694"><span class="linenos">5694</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-5695"><a href="#L-5695"><span class="linenos">5695</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-5696"><a href="#L-5696"><span class="linenos">5696</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-5697"><a href="#L-5697"><span class="linenos">5697</span></a> -</span><span id="L-5698"><a href="#L-5698"><span class="linenos">5698</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-5699"><a href="#L-5699"><span class="linenos">5699</span></a> +</span><span id="L-5689"><a href="#L-5689"><span class="linenos">5689</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-5690"><a href="#L-5690"><span class="linenos">5690</span></a> <span class="n">new_child_nodes</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="L-5691"><a href="#L-5691"><span class="linenos">5691</span></a> +</span><span id="L-5692"><a href="#L-5692"><span class="linenos">5692</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-5693"><a href="#L-5693"><span class="linenos">5693</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-5694"><a href="#L-5694"><span class="linenos">5694</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 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-5695"><a href="#L-5695"><span class="linenos">5695</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-5696"><a href="#L-5696"><span class="linenos">5696</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-5697"><a href="#L-5697"><span class="linenos">5697</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-5698"><a href="#L-5698"><span class="linenos">5698</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-5699"><a href="#L-5699"><span class="linenos">5699</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-5700"><a href="#L-5700"><span class="linenos">5700</span></a> -</span><span id="L-5701"><a href="#L-5701"><span class="linenos">5701</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 class="n">Expression</span><span class="p">,</span> <span class="n">exclude</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">""</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Set</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> -</span><span id="L-5702"><a href="#L-5702"><span class="linenos">5702</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5703"><a href="#L-5703"><span class="linenos">5703</span></a><span class="sd"> Return all table names referenced through columns in an expression.</span> -</span><span id="L-5704"><a href="#L-5704"><span class="linenos">5704</span></a> -</span><span id="L-5705"><a href="#L-5705"><span class="linenos">5705</span></a><span class="sd"> Example:</span> -</span><span id="L-5706"><a href="#L-5706"><span class="linenos">5706</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-5707"><a href="#L-5707"><span class="linenos">5707</span></a><span class="sd"> >>> sorted(column_table_names(sqlglot.parse_one("a.b AND c.d AND c.e")))</span> -</span><span id="L-5708"><a href="#L-5708"><span class="linenos">5708</span></a><span class="sd"> ['a', 'c']</span> -</span><span id="L-5709"><a href="#L-5709"><span class="linenos">5709</span></a> -</span><span id="L-5710"><a href="#L-5710"><span class="linenos">5710</span></a><span class="sd"> Args:</span> -</span><span id="L-5711"><a href="#L-5711"><span class="linenos">5711</span></a><span class="sd"> expression: expression to find table names.</span> -</span><span id="L-5712"><a href="#L-5712"><span class="linenos">5712</span></a><span class="sd"> exclude: a table name to exclude</span> -</span><span id="L-5713"><a href="#L-5713"><span class="linenos">5713</span></a> -</span><span id="L-5714"><a href="#L-5714"><span class="linenos">5714</span></a><span class="sd"> Returns:</span> -</span><span id="L-5715"><a href="#L-5715"><span class="linenos">5715</span></a><span class="sd"> A list of unique names.</span> -</span><span id="L-5716"><a href="#L-5716"><span class="linenos">5716</span></a><span class="sd"> """</span> -</span><span id="L-5717"><a href="#L-5717"><span class="linenos">5717</span></a> <span class="k">return</span> <span class="p">{</span> -</span><span id="L-5718"><a href="#L-5718"><span class="linenos">5718</span></a> <span class="n">table</span> -</span><span id="L-5719"><a href="#L-5719"><span class="linenos">5719</span></a> <span class="k">for</span> <span class="n">table</span> <span class="ow">in</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-5720"><a href="#L-5720"><span class="linenos">5720</span></a> <span class="k">if</span> <span class="n">table</span> <span class="ow">and</span> <span class="n">table</span> <span class="o">!=</span> <span class="n">exclude</span> -</span><span id="L-5721"><a href="#L-5721"><span class="linenos">5721</span></a> <span class="p">}</span> -</span><span id="L-5722"><a href="#L-5722"><span class="linenos">5722</span></a> -</span><span id="L-5723"><a href="#L-5723"><span class="linenos">5723</span></a> -</span><span id="L-5724"><a href="#L-5724"><span class="linenos">5724</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="n">Table</span> <span class="o">|</span> <span class="nb">str</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="nb">str</span><span class="p">:</span> -</span><span id="L-5725"><a href="#L-5725"><span class="linenos">5725</span></a><span class="w"> </span><span class="sd">"""Get the full name of a table as a string.</span> +</span><span id="L-5701"><a href="#L-5701"><span class="linenos">5701</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-5702"><a href="#L-5702"><span class="linenos">5702</span></a> +</span><span id="L-5703"><a href="#L-5703"><span class="linenos">5703</span></a> +</span><span id="L-5704"><a href="#L-5704"><span class="linenos">5704</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 class="n">Expression</span><span class="p">,</span> <span class="n">exclude</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">""</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Set</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> +</span><span id="L-5705"><a href="#L-5705"><span class="linenos">5705</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5706"><a href="#L-5706"><span class="linenos">5706</span></a><span class="sd"> Return all table names referenced through columns in an expression.</span> +</span><span id="L-5707"><a href="#L-5707"><span class="linenos">5707</span></a> +</span><span id="L-5708"><a href="#L-5708"><span class="linenos">5708</span></a><span class="sd"> Example:</span> +</span><span id="L-5709"><a href="#L-5709"><span class="linenos">5709</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-5710"><a href="#L-5710"><span class="linenos">5710</span></a><span class="sd"> >>> sorted(column_table_names(sqlglot.parse_one("a.b AND c.d AND c.e")))</span> +</span><span id="L-5711"><a href="#L-5711"><span class="linenos">5711</span></a><span class="sd"> ['a', 'c']</span> +</span><span id="L-5712"><a href="#L-5712"><span class="linenos">5712</span></a> +</span><span id="L-5713"><a href="#L-5713"><span class="linenos">5713</span></a><span class="sd"> Args:</span> +</span><span id="L-5714"><a href="#L-5714"><span class="linenos">5714</span></a><span class="sd"> expression: expression to find table names.</span> +</span><span id="L-5715"><a href="#L-5715"><span class="linenos">5715</span></a><span class="sd"> exclude: a table name to exclude</span> +</span><span id="L-5716"><a href="#L-5716"><span class="linenos">5716</span></a> +</span><span id="L-5717"><a href="#L-5717"><span class="linenos">5717</span></a><span class="sd"> Returns:</span> +</span><span id="L-5718"><a href="#L-5718"><span class="linenos">5718</span></a><span class="sd"> A list of unique names.</span> +</span><span id="L-5719"><a href="#L-5719"><span class="linenos">5719</span></a><span class="sd"> """</span> +</span><span id="L-5720"><a href="#L-5720"><span class="linenos">5720</span></a> <span class="k">return</span> <span class="p">{</span> +</span><span id="L-5721"><a href="#L-5721"><span class="linenos">5721</span></a> <span class="n">table</span> +</span><span id="L-5722"><a href="#L-5722"><span class="linenos">5722</span></a> <span class="k">for</span> <span class="n">table</span> <span class="ow">in</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-5723"><a href="#L-5723"><span class="linenos">5723</span></a> <span class="k">if</span> <span class="n">table</span> <span class="ow">and</span> <span class="n">table</span> <span class="o">!=</span> <span class="n">exclude</span> +</span><span id="L-5724"><a href="#L-5724"><span class="linenos">5724</span></a> <span class="p">}</span> +</span><span id="L-5725"><a href="#L-5725"><span class="linenos">5725</span></a> </span><span id="L-5726"><a href="#L-5726"><span class="linenos">5726</span></a> -</span><span id="L-5727"><a href="#L-5727"><span class="linenos">5727</span></a><span class="sd"> Args:</span> -</span><span id="L-5728"><a href="#L-5728"><span class="linenos">5728</span></a><span class="sd"> table: Table expression node or string.</span> -</span><span id="L-5729"><a href="#L-5729"><span class="linenos">5729</span></a><span class="sd"> dialect: The dialect to generate the table name for.</span> -</span><span id="L-5730"><a href="#L-5730"><span class="linenos">5730</span></a> -</span><span id="L-5731"><a href="#L-5731"><span class="linenos">5731</span></a><span class="sd"> Examples:</span> -</span><span id="L-5732"><a href="#L-5732"><span class="linenos">5732</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> -</span><span id="L-5733"><a href="#L-5733"><span class="linenos">5733</span></a><span class="sd"> >>> table_name(parse_one("select * from a.b.c").find(exp.Table))</span> -</span><span id="L-5734"><a href="#L-5734"><span class="linenos">5734</span></a><span class="sd"> 'a.b.c'</span> -</span><span id="L-5735"><a href="#L-5735"><span class="linenos">5735</span></a> -</span><span id="L-5736"><a href="#L-5736"><span class="linenos">5736</span></a><span class="sd"> Returns:</span> -</span><span id="L-5737"><a href="#L-5737"><span class="linenos">5737</span></a><span class="sd"> The table name.</span> -</span><span id="L-5738"><a href="#L-5738"><span class="linenos">5738</span></a><span class="sd"> """</span> -</span><span id="L-5739"><a href="#L-5739"><span class="linenos">5739</span></a> -</span><span id="L-5740"><a href="#L-5740"><span class="linenos">5740</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-5741"><a href="#L-5741"><span class="linenos">5741</span></a> -</span><span id="L-5742"><a href="#L-5742"><span class="linenos">5742</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-5743"><a href="#L-5743"><span class="linenos">5743</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-5727"><a href="#L-5727"><span class="linenos">5727</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="n">Table</span> <span class="o">|</span> <span class="nb">str</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="nb">str</span><span class="p">:</span> +</span><span id="L-5728"><a href="#L-5728"><span class="linenos">5728</span></a><span class="w"> </span><span class="sd">"""Get the full name of a table as a string.</span> +</span><span id="L-5729"><a href="#L-5729"><span class="linenos">5729</span></a> +</span><span id="L-5730"><a href="#L-5730"><span class="linenos">5730</span></a><span class="sd"> Args:</span> +</span><span id="L-5731"><a href="#L-5731"><span class="linenos">5731</span></a><span class="sd"> table: Table expression node or string.</span> +</span><span id="L-5732"><a href="#L-5732"><span class="linenos">5732</span></a><span class="sd"> dialect: The dialect to generate the table name for.</span> +</span><span id="L-5733"><a href="#L-5733"><span class="linenos">5733</span></a> +</span><span id="L-5734"><a href="#L-5734"><span class="linenos">5734</span></a><span class="sd"> Examples:</span> +</span><span id="L-5735"><a href="#L-5735"><span class="linenos">5735</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> +</span><span id="L-5736"><a href="#L-5736"><span class="linenos">5736</span></a><span class="sd"> >>> table_name(parse_one("select * from a.b.c").find(exp.Table))</span> +</span><span id="L-5737"><a href="#L-5737"><span class="linenos">5737</span></a><span class="sd"> 'a.b.c'</span> +</span><span id="L-5738"><a href="#L-5738"><span class="linenos">5738</span></a> +</span><span id="L-5739"><a href="#L-5739"><span class="linenos">5739</span></a><span class="sd"> Returns:</span> +</span><span id="L-5740"><a href="#L-5740"><span class="linenos">5740</span></a><span class="sd"> The table name.</span> +</span><span id="L-5741"><a href="#L-5741"><span class="linenos">5741</span></a><span class="sd"> """</span> +</span><span id="L-5742"><a href="#L-5742"><span class="linenos">5742</span></a> +</span><span id="L-5743"><a href="#L-5743"><span class="linenos">5743</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-5744"><a href="#L-5744"><span class="linenos">5744</span></a> -</span><span id="L-5745"><a href="#L-5745"><span class="linenos">5745</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-5746"><a href="#L-5746"><span class="linenos">5746</span></a> <span class="n">part</span><span class="o">.</span><span class="n">sql</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="k">if</span> <span class="ow">not</span> <span class="n">SAFE_IDENTIFIER_RE</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">part</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> <span class="k">else</span> <span class="n">part</span><span class="o">.</span><span class="n">name</span> -</span><span id="L-5747"><a href="#L-5747"><span class="linenos">5747</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="n">table</span><span class="o">.</span><span class="n">parts</span> -</span><span id="L-5748"><a href="#L-5748"><span class="linenos">5748</span></a> <span class="p">)</span> -</span><span id="L-5749"><a href="#L-5749"><span class="linenos">5749</span></a> -</span><span id="L-5750"><a href="#L-5750"><span class="linenos">5750</span></a> -</span><span id="L-5751"><a href="#L-5751"><span class="linenos">5751</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">E</span><span class="p">,</span> <span class="n">mapping</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="nb">str</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">E</span><span class="p">:</span> -</span><span id="L-5752"><a href="#L-5752"><span class="linenos">5752</span></a><span class="w"> </span><span class="sd">"""Replace all tables in expression according to the mapping.</span> +</span><span id="L-5745"><a href="#L-5745"><span class="linenos">5745</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-5746"><a href="#L-5746"><span class="linenos">5746</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-5747"><a href="#L-5747"><span class="linenos">5747</span></a> +</span><span id="L-5748"><a href="#L-5748"><span class="linenos">5748</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-5749"><a href="#L-5749"><span class="linenos">5749</span></a> <span class="n">part</span><span class="o">.</span><span class="n">sql</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="k">if</span> <span class="ow">not</span> <span class="n">SAFE_IDENTIFIER_RE</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">part</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> <span class="k">else</span> <span class="n">part</span><span class="o">.</span><span class="n">name</span> +</span><span id="L-5750"><a href="#L-5750"><span class="linenos">5750</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="n">table</span><span class="o">.</span><span class="n">parts</span> +</span><span id="L-5751"><a href="#L-5751"><span class="linenos">5751</span></a> <span class="p">)</span> +</span><span id="L-5752"><a href="#L-5752"><span class="linenos">5752</span></a> </span><span id="L-5753"><a href="#L-5753"><span class="linenos">5753</span></a> -</span><span id="L-5754"><a href="#L-5754"><span class="linenos">5754</span></a><span class="sd"> Args:</span> -</span><span id="L-5755"><a href="#L-5755"><span class="linenos">5755</span></a><span class="sd"> expression: expression node to be transformed and replaced.</span> -</span><span id="L-5756"><a href="#L-5756"><span class="linenos">5756</span></a><span class="sd"> mapping: mapping of table names.</span> -</span><span id="L-5757"><a href="#L-5757"><span class="linenos">5757</span></a><span class="sd"> copy: whether or not to copy the expression.</span> -</span><span id="L-5758"><a href="#L-5758"><span class="linenos">5758</span></a> -</span><span id="L-5759"><a href="#L-5759"><span class="linenos">5759</span></a><span class="sd"> Examples:</span> -</span><span id="L-5760"><a href="#L-5760"><span class="linenos">5760</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> -</span><span id="L-5761"><a href="#L-5761"><span class="linenos">5761</span></a><span class="sd"> >>> replace_tables(parse_one("select * from a.b"), {"a.b": "c"}).sql()</span> -</span><span id="L-5762"><a href="#L-5762"><span class="linenos">5762</span></a><span class="sd"> 'SELECT * FROM c'</span> -</span><span id="L-5763"><a href="#L-5763"><span class="linenos">5763</span></a> -</span><span id="L-5764"><a href="#L-5764"><span class="linenos">5764</span></a><span class="sd"> Returns:</span> -</span><span id="L-5765"><a href="#L-5765"><span class="linenos">5765</span></a><span class="sd"> The mapped expression.</span> -</span><span id="L-5766"><a href="#L-5766"><span class="linenos">5766</span></a><span class="sd"> """</span> -</span><span id="L-5767"><a href="#L-5767"><span class="linenos">5767</span></a> -</span><span id="L-5768"><a href="#L-5768"><span class="linenos">5768</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 class="n">Expression</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="L-5769"><a href="#L-5769"><span class="linenos">5769</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-5770"><a href="#L-5770"><span class="linenos">5770</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-5771"><a href="#L-5771"><span class="linenos">5771</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> -</span><span id="L-5772"><a href="#L-5772"><span class="linenos">5772</span></a> <span class="k">return</span> <span class="n">to_table</span><span class="p">(</span> -</span><span id="L-5773"><a href="#L-5773"><span class="linenos">5773</span></a> <span class="n">new_name</span><span class="p">,</span> -</span><span id="L-5774"><a href="#L-5774"><span class="linenos">5774</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-5775"><a href="#L-5775"><span class="linenos">5775</span></a> <span class="p">)</span> -</span><span id="L-5776"><a href="#L-5776"><span class="linenos">5776</span></a> <span class="k">return</span> <span class="n">node</span> -</span><span id="L-5777"><a href="#L-5777"><span class="linenos">5777</span></a> -</span><span id="L-5778"><a href="#L-5778"><span class="linenos">5778</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 class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> -</span><span id="L-5779"><a href="#L-5779"><span class="linenos">5779</span></a> +</span><span id="L-5754"><a href="#L-5754"><span class="linenos">5754</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">E</span><span class="p">,</span> <span class="n">mapping</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="nb">str</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">E</span><span class="p">:</span> +</span><span id="L-5755"><a href="#L-5755"><span class="linenos">5755</span></a><span class="w"> </span><span class="sd">"""Replace all tables in expression according to the mapping.</span> +</span><span id="L-5756"><a href="#L-5756"><span class="linenos">5756</span></a> +</span><span id="L-5757"><a href="#L-5757"><span class="linenos">5757</span></a><span class="sd"> Args:</span> +</span><span id="L-5758"><a href="#L-5758"><span class="linenos">5758</span></a><span class="sd"> expression: expression node to be transformed and replaced.</span> +</span><span id="L-5759"><a href="#L-5759"><span class="linenos">5759</span></a><span class="sd"> mapping: mapping of table names.</span> +</span><span id="L-5760"><a href="#L-5760"><span class="linenos">5760</span></a><span class="sd"> copy: whether or not to copy the expression.</span> +</span><span id="L-5761"><a href="#L-5761"><span class="linenos">5761</span></a> +</span><span id="L-5762"><a href="#L-5762"><span class="linenos">5762</span></a><span class="sd"> Examples:</span> +</span><span id="L-5763"><a href="#L-5763"><span class="linenos">5763</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> +</span><span id="L-5764"><a href="#L-5764"><span class="linenos">5764</span></a><span class="sd"> >>> replace_tables(parse_one("select * from a.b"), {"a.b": "c"}).sql()</span> +</span><span id="L-5765"><a href="#L-5765"><span class="linenos">5765</span></a><span class="sd"> 'SELECT * FROM c'</span> +</span><span id="L-5766"><a href="#L-5766"><span class="linenos">5766</span></a> +</span><span id="L-5767"><a href="#L-5767"><span class="linenos">5767</span></a><span class="sd"> Returns:</span> +</span><span id="L-5768"><a href="#L-5768"><span class="linenos">5768</span></a><span class="sd"> The mapped expression.</span> +</span><span id="L-5769"><a href="#L-5769"><span class="linenos">5769</span></a><span class="sd"> """</span> +</span><span id="L-5770"><a href="#L-5770"><span class="linenos">5770</span></a> +</span><span id="L-5771"><a href="#L-5771"><span class="linenos">5771</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 class="n">Expression</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="L-5772"><a href="#L-5772"><span class="linenos">5772</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-5773"><a href="#L-5773"><span class="linenos">5773</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-5774"><a href="#L-5774"><span class="linenos">5774</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> +</span><span id="L-5775"><a href="#L-5775"><span class="linenos">5775</span></a> <span class="k">return</span> <span class="n">to_table</span><span class="p">(</span> +</span><span id="L-5776"><a href="#L-5776"><span class="linenos">5776</span></a> <span class="n">new_name</span><span class="p">,</span> +</span><span id="L-5777"><a href="#L-5777"><span class="linenos">5777</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-5778"><a href="#L-5778"><span class="linenos">5778</span></a> <span class="p">)</span> +</span><span id="L-5779"><a href="#L-5779"><span class="linenos">5779</span></a> <span class="k">return</span> <span class="n">node</span> </span><span id="L-5780"><a href="#L-5780"><span class="linenos">5780</span></a> -</span><span id="L-5781"><a href="#L-5781"><span class="linenos">5781</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="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 class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="L-5782"><a href="#L-5782"><span class="linenos">5782</span></a><span class="w"> </span><span class="sd">"""Replace placeholders in an expression.</span> +</span><span id="L-5781"><a href="#L-5781"><span class="linenos">5781</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 class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> +</span><span id="L-5782"><a href="#L-5782"><span class="linenos">5782</span></a> </span><span id="L-5783"><a href="#L-5783"><span class="linenos">5783</span></a> -</span><span id="L-5784"><a href="#L-5784"><span class="linenos">5784</span></a><span class="sd"> Args:</span> -</span><span id="L-5785"><a href="#L-5785"><span class="linenos">5785</span></a><span class="sd"> expression: expression node to be transformed and replaced.</span> -</span><span id="L-5786"><a href="#L-5786"><span class="linenos">5786</span></a><span class="sd"> args: positional names that will substitute unnamed placeholders in the given order.</span> -</span><span id="L-5787"><a href="#L-5787"><span class="linenos">5787</span></a><span class="sd"> kwargs: keyword arguments that will substitute named placeholders.</span> -</span><span id="L-5788"><a href="#L-5788"><span class="linenos">5788</span></a> -</span><span id="L-5789"><a href="#L-5789"><span class="linenos">5789</span></a><span class="sd"> Examples:</span> -</span><span id="L-5790"><a href="#L-5790"><span class="linenos">5790</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> -</span><span id="L-5791"><a href="#L-5791"><span class="linenos">5791</span></a><span class="sd"> >>> replace_placeholders(</span> -</span><span id="L-5792"><a href="#L-5792"><span class="linenos">5792</span></a><span class="sd"> ... parse_one("select * from :tbl where ? = ?"),</span> -</span><span id="L-5793"><a href="#L-5793"><span class="linenos">5793</span></a><span class="sd"> ... exp.to_identifier("str_col"), "b", tbl=exp.to_identifier("foo")</span> -</span><span id="L-5794"><a href="#L-5794"><span class="linenos">5794</span></a><span class="sd"> ... ).sql()</span> -</span><span id="L-5795"><a href="#L-5795"><span class="linenos">5795</span></a><span class="sd"> "SELECT * FROM foo WHERE str_col = 'b'"</span> -</span><span id="L-5796"><a href="#L-5796"><span class="linenos">5796</span></a> -</span><span id="L-5797"><a href="#L-5797"><span class="linenos">5797</span></a><span class="sd"> Returns:</span> -</span><span id="L-5798"><a href="#L-5798"><span class="linenos">5798</span></a><span class="sd"> The mapped expression.</span> -</span><span id="L-5799"><a href="#L-5799"><span class="linenos">5799</span></a><span class="sd"> """</span> -</span><span id="L-5800"><a href="#L-5800"><span class="linenos">5800</span></a> -</span><span id="L-5801"><a href="#L-5801"><span class="linenos">5801</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">Expression</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 class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="L-5802"><a href="#L-5802"><span class="linenos">5802</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-5803"><a href="#L-5803"><span class="linenos">5803</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-5804"><a href="#L-5804"><span class="linenos">5804</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-5805"><a href="#L-5805"><span class="linenos">5805</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> -</span><span id="L-5806"><a href="#L-5806"><span class="linenos">5806</span></a> <span class="k">return</span> <span class="n">convert</span><span class="p">(</span><span class="n">new_name</span><span class="p">)</span> -</span><span id="L-5807"><a href="#L-5807"><span class="linenos">5807</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-5808"><a href="#L-5808"><span class="linenos">5808</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="L-5809"><a href="#L-5809"><span class="linenos">5809</span></a> <span class="k">return</span> <span class="n">convert</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-5810"><a href="#L-5810"><span class="linenos">5810</span></a> <span class="k">except</span> <span class="ne">StopIteration</span><span class="p">:</span> -</span><span id="L-5811"><a href="#L-5811"><span class="linenos">5811</span></a> <span class="k">pass</span> -</span><span id="L-5812"><a href="#L-5812"><span class="linenos">5812</span></a> <span class="k">return</span> <span class="n">node</span> -</span><span id="L-5813"><a href="#L-5813"><span class="linenos">5813</span></a> -</span><span id="L-5814"><a href="#L-5814"><span class="linenos">5814</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-5815"><a href="#L-5815"><span class="linenos">5815</span></a> +</span><span id="L-5784"><a href="#L-5784"><span class="linenos">5784</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="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 class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="L-5785"><a href="#L-5785"><span class="linenos">5785</span></a><span class="w"> </span><span class="sd">"""Replace placeholders in an expression.</span> +</span><span id="L-5786"><a href="#L-5786"><span class="linenos">5786</span></a> +</span><span id="L-5787"><a href="#L-5787"><span class="linenos">5787</span></a><span class="sd"> Args:</span> +</span><span id="L-5788"><a href="#L-5788"><span class="linenos">5788</span></a><span class="sd"> expression: expression node to be transformed and replaced.</span> +</span><span id="L-5789"><a href="#L-5789"><span class="linenos">5789</span></a><span class="sd"> args: positional names that will substitute unnamed placeholders in the given order.</span> +</span><span id="L-5790"><a href="#L-5790"><span class="linenos">5790</span></a><span class="sd"> kwargs: keyword arguments that will substitute named placeholders.</span> +</span><span id="L-5791"><a href="#L-5791"><span class="linenos">5791</span></a> +</span><span id="L-5792"><a href="#L-5792"><span class="linenos">5792</span></a><span class="sd"> Examples:</span> +</span><span id="L-5793"><a href="#L-5793"><span class="linenos">5793</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> +</span><span id="L-5794"><a href="#L-5794"><span class="linenos">5794</span></a><span class="sd"> >>> replace_placeholders(</span> +</span><span id="L-5795"><a href="#L-5795"><span class="linenos">5795</span></a><span class="sd"> ... parse_one("select * from :tbl where ? = ?"),</span> +</span><span id="L-5796"><a href="#L-5796"><span class="linenos">5796</span></a><span class="sd"> ... exp.to_identifier("str_col"), "b", tbl=exp.to_identifier("foo")</span> +</span><span id="L-5797"><a href="#L-5797"><span class="linenos">5797</span></a><span class="sd"> ... ).sql()</span> +</span><span id="L-5798"><a href="#L-5798"><span class="linenos">5798</span></a><span class="sd"> "SELECT * FROM foo WHERE str_col = 'b'"</span> +</span><span id="L-5799"><a href="#L-5799"><span class="linenos">5799</span></a> +</span><span id="L-5800"><a href="#L-5800"><span class="linenos">5800</span></a><span class="sd"> Returns:</span> +</span><span id="L-5801"><a href="#L-5801"><span class="linenos">5801</span></a><span class="sd"> The mapped expression.</span> +</span><span id="L-5802"><a href="#L-5802"><span class="linenos">5802</span></a><span class="sd"> """</span> +</span><span id="L-5803"><a href="#L-5803"><span class="linenos">5803</span></a> +</span><span id="L-5804"><a href="#L-5804"><span class="linenos">5804</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">Expression</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 class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="L-5805"><a href="#L-5805"><span class="linenos">5805</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-5806"><a href="#L-5806"><span class="linenos">5806</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-5807"><a href="#L-5807"><span class="linenos">5807</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-5808"><a href="#L-5808"><span class="linenos">5808</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> +</span><span id="L-5809"><a href="#L-5809"><span class="linenos">5809</span></a> <span class="k">return</span> <span class="n">convert</span><span class="p">(</span><span class="n">new_name</span><span class="p">)</span> +</span><span id="L-5810"><a href="#L-5810"><span class="linenos">5810</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-5811"><a href="#L-5811"><span class="linenos">5811</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="L-5812"><a href="#L-5812"><span class="linenos">5812</span></a> <span class="k">return</span> <span class="n">convert</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-5813"><a href="#L-5813"><span class="linenos">5813</span></a> <span class="k">except</span> <span class="ne">StopIteration</span><span class="p">:</span> +</span><span id="L-5814"><a href="#L-5814"><span class="linenos">5814</span></a> <span class="k">pass</span> +</span><span id="L-5815"><a href="#L-5815"><span class="linenos">5815</span></a> <span class="k">return</span> <span class="n">node</span> </span><span id="L-5816"><a href="#L-5816"><span class="linenos">5816</span></a> -</span><span id="L-5817"><a href="#L-5817"><span class="linenos">5817</span></a><span class="k">def</span> <span class="nf">expand</span><span class="p">(</span> -</span><span id="L-5818"><a href="#L-5818"><span class="linenos">5818</span></a> <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="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-5819"><a href="#L-5819"><span class="linenos">5819</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="L-5820"><a href="#L-5820"><span class="linenos">5820</span></a><span class="w"> </span><span class="sd">"""Transforms an expression by expanding all referenced sources into subqueries.</span> -</span><span id="L-5821"><a href="#L-5821"><span class="linenos">5821</span></a> -</span><span id="L-5822"><a href="#L-5822"><span class="linenos">5822</span></a><span class="sd"> Examples:</span> -</span><span id="L-5823"><a href="#L-5823"><span class="linenos">5823</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="L-5824"><a href="#L-5824"><span class="linenos">5824</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-5825"><a href="#L-5825"><span class="linenos">5825</span></a><span class="sd"> 'SELECT * FROM (SELECT * FROM y) AS z /* source: x */'</span> -</span><span id="L-5826"><a href="#L-5826"><span class="linenos">5826</span></a> -</span><span id="L-5827"><a href="#L-5827"><span class="linenos">5827</span></a><span class="sd"> >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y"), "y": parse_one("select * from z")}).sql()</span> -</span><span id="L-5828"><a href="#L-5828"><span class="linenos">5828</span></a><span class="sd"> 'SELECT * FROM (SELECT * FROM (SELECT * FROM z) AS y /* source: y */) AS z /* source: x */'</span> +</span><span id="L-5817"><a href="#L-5817"><span class="linenos">5817</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-5818"><a href="#L-5818"><span class="linenos">5818</span></a> +</span><span id="L-5819"><a href="#L-5819"><span class="linenos">5819</span></a> +</span><span id="L-5820"><a href="#L-5820"><span class="linenos">5820</span></a><span class="k">def</span> <span class="nf">expand</span><span class="p">(</span> +</span><span id="L-5821"><a href="#L-5821"><span class="linenos">5821</span></a> <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="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-5822"><a href="#L-5822"><span class="linenos">5822</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="L-5823"><a href="#L-5823"><span class="linenos">5823</span></a><span class="w"> </span><span class="sd">"""Transforms an expression by expanding all referenced sources into subqueries.</span> +</span><span id="L-5824"><a href="#L-5824"><span class="linenos">5824</span></a> +</span><span id="L-5825"><a href="#L-5825"><span class="linenos">5825</span></a><span class="sd"> Examples:</span> +</span><span id="L-5826"><a href="#L-5826"><span class="linenos">5826</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="L-5827"><a href="#L-5827"><span class="linenos">5827</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-5828"><a href="#L-5828"><span class="linenos">5828</span></a><span class="sd"> 'SELECT * FROM (SELECT * FROM y) AS z /* source: x */'</span> </span><span id="L-5829"><a href="#L-5829"><span class="linenos">5829</span></a> -</span><span id="L-5830"><a href="#L-5830"><span class="linenos">5830</span></a><span class="sd"> Args:</span> -</span><span id="L-5831"><a href="#L-5831"><span class="linenos">5831</span></a><span class="sd"> expression: The expression to expand.</span> -</span><span id="L-5832"><a href="#L-5832"><span class="linenos">5832</span></a><span class="sd"> sources: A dictionary of name to Subqueryables.</span> -</span><span id="L-5833"><a href="#L-5833"><span class="linenos">5833</span></a><span class="sd"> copy: Whether or not to copy the expression during transformation. Defaults to True.</span> -</span><span id="L-5834"><a href="#L-5834"><span class="linenos">5834</span></a> -</span><span id="L-5835"><a href="#L-5835"><span class="linenos">5835</span></a><span class="sd"> Returns:</span> -</span><span id="L-5836"><a href="#L-5836"><span class="linenos">5836</span></a><span class="sd"> The transformed expression.</span> -</span><span id="L-5837"><a href="#L-5837"><span class="linenos">5837</span></a><span class="sd"> """</span> -</span><span id="L-5838"><a href="#L-5838"><span class="linenos">5838</span></a> -</span><span id="L-5839"><a href="#L-5839"><span class="linenos">5839</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-5840"><a href="#L-5840"><span class="linenos">5840</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-5841"><a href="#L-5841"><span class="linenos">5841</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-5842"><a href="#L-5842"><span class="linenos">5842</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-5843"><a href="#L-5843"><span class="linenos">5843</span></a> <span class="k">if</span> <span class="n">source</span><span class="p">:</span> -</span><span id="L-5844"><a href="#L-5844"><span class="linenos">5844</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-5845"><a href="#L-5845"><span class="linenos">5845</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-5846"><a href="#L-5846"><span class="linenos">5846</span></a> <span class="k">return</span> <span class="n">subquery</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="kc">False</span><span class="p">)</span> -</span><span id="L-5847"><a href="#L-5847"><span class="linenos">5847</span></a> <span class="k">return</span> <span class="n">node</span> -</span><span id="L-5848"><a href="#L-5848"><span class="linenos">5848</span></a> -</span><span id="L-5849"><a href="#L-5849"><span class="linenos">5849</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-5850"><a href="#L-5850"><span class="linenos">5850</span></a> +</span><span id="L-5830"><a href="#L-5830"><span class="linenos">5830</span></a><span class="sd"> >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y"), "y": parse_one("select * from z")}).sql()</span> +</span><span id="L-5831"><a href="#L-5831"><span class="linenos">5831</span></a><span class="sd"> 'SELECT * FROM (SELECT * FROM (SELECT * FROM z) AS y /* source: y */) AS z /* source: x */'</span> +</span><span id="L-5832"><a href="#L-5832"><span class="linenos">5832</span></a> +</span><span id="L-5833"><a href="#L-5833"><span class="linenos">5833</span></a><span class="sd"> Args:</span> +</span><span id="L-5834"><a href="#L-5834"><span class="linenos">5834</span></a><span class="sd"> expression: The expression to expand.</span> +</span><span id="L-5835"><a href="#L-5835"><span class="linenos">5835</span></a><span class="sd"> sources: A dictionary of name to Subqueryables.</span> +</span><span id="L-5836"><a href="#L-5836"><span class="linenos">5836</span></a><span class="sd"> copy: Whether or not to copy the expression during transformation. Defaults to True.</span> +</span><span id="L-5837"><a href="#L-5837"><span class="linenos">5837</span></a> +</span><span id="L-5838"><a href="#L-5838"><span class="linenos">5838</span></a><span class="sd"> Returns:</span> +</span><span id="L-5839"><a href="#L-5839"><span class="linenos">5839</span></a><span class="sd"> The transformed expression.</span> +</span><span id="L-5840"><a href="#L-5840"><span class="linenos">5840</span></a><span class="sd"> """</span> +</span><span id="L-5841"><a href="#L-5841"><span class="linenos">5841</span></a> +</span><span id="L-5842"><a href="#L-5842"><span class="linenos">5842</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-5843"><a href="#L-5843"><span class="linenos">5843</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-5844"><a href="#L-5844"><span class="linenos">5844</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-5845"><a href="#L-5845"><span class="linenos">5845</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-5846"><a href="#L-5846"><span class="linenos">5846</span></a> <span class="k">if</span> <span class="n">source</span><span class="p">:</span> +</span><span id="L-5847"><a href="#L-5847"><span class="linenos">5847</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-5848"><a href="#L-5848"><span class="linenos">5848</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-5849"><a href="#L-5849"><span class="linenos">5849</span></a> <span class="k">return</span> <span class="n">subquery</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="kc">False</span><span class="p">)</span> +</span><span id="L-5850"><a href="#L-5850"><span class="linenos">5850</span></a> <span class="k">return</span> <span class="n">node</span> </span><span id="L-5851"><a href="#L-5851"><span class="linenos">5851</span></a> -</span><span id="L-5852"><a href="#L-5852"><span class="linenos">5852</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-5853"><a href="#L-5853"><span class="linenos">5853</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5854"><a href="#L-5854"><span class="linenos">5854</span></a><span class="sd"> Returns a Func expression.</span> -</span><span id="L-5855"><a href="#L-5855"><span class="linenos">5855</span></a> -</span><span id="L-5856"><a href="#L-5856"><span class="linenos">5856</span></a><span class="sd"> Examples:</span> -</span><span id="L-5857"><a href="#L-5857"><span class="linenos">5857</span></a><span class="sd"> >>> func("abs", 5).sql()</span> -</span><span id="L-5858"><a href="#L-5858"><span class="linenos">5858</span></a><span class="sd"> 'ABS(5)'</span> -</span><span id="L-5859"><a href="#L-5859"><span class="linenos">5859</span></a> -</span><span id="L-5860"><a href="#L-5860"><span class="linenos">5860</span></a><span class="sd"> >>> func("cast", this=5, to=DataType.build("DOUBLE")).sql()</span> -</span><span id="L-5861"><a href="#L-5861"><span class="linenos">5861</span></a><span class="sd"> 'CAST(5 AS DOUBLE)'</span> +</span><span id="L-5852"><a href="#L-5852"><span class="linenos">5852</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-5853"><a href="#L-5853"><span class="linenos">5853</span></a> +</span><span id="L-5854"><a href="#L-5854"><span class="linenos">5854</span></a> +</span><span id="L-5855"><a href="#L-5855"><span class="linenos">5855</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-5856"><a href="#L-5856"><span class="linenos">5856</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5857"><a href="#L-5857"><span class="linenos">5857</span></a><span class="sd"> Returns a Func expression.</span> +</span><span id="L-5858"><a href="#L-5858"><span class="linenos">5858</span></a> +</span><span id="L-5859"><a href="#L-5859"><span class="linenos">5859</span></a><span class="sd"> Examples:</span> +</span><span id="L-5860"><a href="#L-5860"><span class="linenos">5860</span></a><span class="sd"> >>> func("abs", 5).sql()</span> +</span><span id="L-5861"><a href="#L-5861"><span class="linenos">5861</span></a><span class="sd"> 'ABS(5)'</span> </span><span id="L-5862"><a href="#L-5862"><span class="linenos">5862</span></a> -</span><span id="L-5863"><a href="#L-5863"><span class="linenos">5863</span></a><span class="sd"> Args:</span> -</span><span id="L-5864"><a href="#L-5864"><span class="linenos">5864</span></a><span class="sd"> name: the name of the function to build.</span> -</span><span id="L-5865"><a href="#L-5865"><span class="linenos">5865</span></a><span class="sd"> args: the args used to instantiate the function of interest.</span> -</span><span id="L-5866"><a href="#L-5866"><span class="linenos">5866</span></a><span class="sd"> dialect: the source dialect.</span> -</span><span id="L-5867"><a href="#L-5867"><span class="linenos">5867</span></a><span class="sd"> kwargs: the kwargs used to instantiate the function of interest.</span> -</span><span id="L-5868"><a href="#L-5868"><span class="linenos">5868</span></a> -</span><span id="L-5869"><a href="#L-5869"><span class="linenos">5869</span></a><span class="sd"> Note:</span> -</span><span id="L-5870"><a href="#L-5870"><span class="linenos">5870</span></a><span class="sd"> The arguments `args` and `kwargs` are mutually exclusive.</span> +</span><span id="L-5863"><a href="#L-5863"><span class="linenos">5863</span></a><span class="sd"> >>> func("cast", this=5, to=DataType.build("DOUBLE")).sql()</span> +</span><span id="L-5864"><a href="#L-5864"><span class="linenos">5864</span></a><span class="sd"> 'CAST(5 AS DOUBLE)'</span> +</span><span id="L-5865"><a href="#L-5865"><span class="linenos">5865</span></a> +</span><span id="L-5866"><a href="#L-5866"><span class="linenos">5866</span></a><span class="sd"> Args:</span> +</span><span id="L-5867"><a href="#L-5867"><span class="linenos">5867</span></a><span class="sd"> name: the name of the function to build.</span> +</span><span id="L-5868"><a href="#L-5868"><span class="linenos">5868</span></a><span class="sd"> args: the args used to instantiate the function of interest.</span> +</span><span id="L-5869"><a href="#L-5869"><span class="linenos">5869</span></a><span class="sd"> dialect: the source dialect.</span> +</span><span id="L-5870"><a href="#L-5870"><span class="linenos">5870</span></a><span class="sd"> kwargs: the kwargs used to instantiate the function of interest.</span> </span><span id="L-5871"><a href="#L-5871"><span class="linenos">5871</span></a> -</span><span id="L-5872"><a href="#L-5872"><span class="linenos">5872</span></a><span class="sd"> Returns:</span> -</span><span id="L-5873"><a href="#L-5873"><span class="linenos">5873</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-5874"><a href="#L-5874"><span class="linenos">5874</span></a><span class="sd"> correspond to an existing `sqlglot.expressions.Func` class.</span> -</span><span id="L-5875"><a href="#L-5875"><span class="linenos">5875</span></a><span class="sd"> """</span> -</span><span id="L-5876"><a href="#L-5876"><span class="linenos">5876</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-5877"><a href="#L-5877"><span class="linenos">5877</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-5878"><a href="#L-5878"><span class="linenos">5878</span></a> -</span><span id="L-5879"><a href="#L-5879"><span class="linenos">5879</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-5880"><a href="#L-5880"><span class="linenos">5880</span></a> -</span><span id="L-5881"><a href="#L-5881"><span class="linenos">5881</span></a> <span class="n">converted</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="n">Expression</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">arg</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="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-5882"><a href="#L-5882"><span class="linenos">5882</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">maybe_parse</span><span class="p">(</span><span class="n">value</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="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-5872"><a href="#L-5872"><span class="linenos">5872</span></a><span class="sd"> Note:</span> +</span><span id="L-5873"><a href="#L-5873"><span class="linenos">5873</span></a><span class="sd"> The arguments `args` and `kwargs` are mutually exclusive.</span> +</span><span id="L-5874"><a href="#L-5874"><span class="linenos">5874</span></a> +</span><span id="L-5875"><a href="#L-5875"><span class="linenos">5875</span></a><span class="sd"> Returns:</span> +</span><span id="L-5876"><a href="#L-5876"><span class="linenos">5876</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-5877"><a href="#L-5877"><span class="linenos">5877</span></a><span class="sd"> correspond to an existing `sqlglot.expressions.Func` class.</span> +</span><span id="L-5878"><a href="#L-5878"><span class="linenos">5878</span></a><span class="sd"> """</span> +</span><span id="L-5879"><a href="#L-5879"><span class="linenos">5879</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-5880"><a href="#L-5880"><span class="linenos">5880</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-5881"><a href="#L-5881"><span class="linenos">5881</span></a> +</span><span id="L-5882"><a href="#L-5882"><span class="linenos">5882</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-5883"><a href="#L-5883"><span class="linenos">5883</span></a> -</span><span id="L-5884"><a href="#L-5884"><span class="linenos">5884</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-5885"><a href="#L-5885"><span class="linenos">5885</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-5884"><a href="#L-5884"><span class="linenos">5884</span></a> <span class="n">converted</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="n">Expression</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">arg</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="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-5885"><a href="#L-5885"><span class="linenos">5885</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">maybe_parse</span><span class="p">(</span><span class="n">value</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="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-5886"><a href="#L-5886"><span class="linenos">5886</span></a> -</span><span id="L-5887"><a href="#L-5887"><span class="linenos">5887</span></a> <span class="k">if</span> <span class="n">from_args_list</span><span class="p">:</span> -</span><span id="L-5888"><a href="#L-5888"><span class="linenos">5888</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">converted</span><span class="p">)</span> <span class="k">if</span> <span class="n">converted</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-5889"><a href="#L-5889"><span class="linenos">5889</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-5890"><a href="#L-5890"><span class="linenos">5890</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">converted</span><span class="p">}</span> -</span><span id="L-5891"><a href="#L-5891"><span class="linenos">5891</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-5892"><a href="#L-5892"><span class="linenos">5892</span></a> -</span><span id="L-5893"><a href="#L-5893"><span class="linenos">5893</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">converted</span><span class="p">):</span> -</span><span id="L-5894"><a href="#L-5894"><span class="linenos">5894</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-5887"><a href="#L-5887"><span class="linenos">5887</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-5888"><a href="#L-5888"><span class="linenos">5888</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-5889"><a href="#L-5889"><span class="linenos">5889</span></a> +</span><span id="L-5890"><a href="#L-5890"><span class="linenos">5890</span></a> <span class="k">if</span> <span class="n">from_args_list</span><span class="p">:</span> +</span><span id="L-5891"><a href="#L-5891"><span class="linenos">5891</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">converted</span><span class="p">)</span> <span class="k">if</span> <span class="n">converted</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-5892"><a href="#L-5892"><span class="linenos">5892</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-5893"><a href="#L-5893"><span class="linenos">5893</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">converted</span><span class="p">}</span> +</span><span id="L-5894"><a href="#L-5894"><span class="linenos">5894</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-5895"><a href="#L-5895"><span class="linenos">5895</span></a> -</span><span id="L-5896"><a href="#L-5896"><span class="linenos">5896</span></a> <span class="k">return</span> <span class="n">function</span> -</span><span id="L-5897"><a href="#L-5897"><span class="linenos">5897</span></a> +</span><span id="L-5896"><a href="#L-5896"><span class="linenos">5896</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">converted</span><span class="p">):</span> +</span><span id="L-5897"><a href="#L-5897"><span class="linenos">5897</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-5898"><a href="#L-5898"><span class="linenos">5898</span></a> -</span><span id="L-5899"><a href="#L-5899"><span class="linenos">5899</span></a><span class="k">def</span> <span class="nf">true</span><span class="p">()</span> <span class="o">-></span> <span class="n">Boolean</span><span class="p">:</span> -</span><span id="L-5900"><a href="#L-5900"><span class="linenos">5900</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5901"><a href="#L-5901"><span class="linenos">5901</span></a><span class="sd"> Returns a true Boolean expression.</span> -</span><span id="L-5902"><a href="#L-5902"><span class="linenos">5902</span></a><span class="sd"> """</span> -</span><span id="L-5903"><a href="#L-5903"><span class="linenos">5903</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-5904"><a href="#L-5904"><span class="linenos">5904</span></a> -</span><span id="L-5905"><a href="#L-5905"><span class="linenos">5905</span></a> -</span><span id="L-5906"><a href="#L-5906"><span class="linenos">5906</span></a><span class="k">def</span> <span class="nf">false</span><span class="p">()</span> <span class="o">-></span> <span class="n">Boolean</span><span class="p">:</span> -</span><span id="L-5907"><a href="#L-5907"><span class="linenos">5907</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5908"><a href="#L-5908"><span class="linenos">5908</span></a><span class="sd"> Returns a false Boolean expression.</span> -</span><span id="L-5909"><a href="#L-5909"><span class="linenos">5909</span></a><span class="sd"> """</span> -</span><span id="L-5910"><a href="#L-5910"><span class="linenos">5910</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-5911"><a href="#L-5911"><span class="linenos">5911</span></a> -</span><span id="L-5912"><a href="#L-5912"><span class="linenos">5912</span></a> -</span><span id="L-5913"><a href="#L-5913"><span class="linenos">5913</span></a><span class="k">def</span> <span class="nf">null</span><span class="p">()</span> <span class="o">-></span> <span class="n">Null</span><span class="p">:</span> -</span><span id="L-5914"><a href="#L-5914"><span class="linenos">5914</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-5915"><a href="#L-5915"><span class="linenos">5915</span></a><span class="sd"> Returns a Null expression.</span> -</span><span id="L-5916"><a href="#L-5916"><span class="linenos">5916</span></a><span class="sd"> """</span> -</span><span id="L-5917"><a href="#L-5917"><span class="linenos">5917</span></a> <span class="k">return</span> <span class="n">Null</span><span class="p">()</span> -</span><span id="L-5918"><a href="#L-5918"><span class="linenos">5918</span></a> -</span><span id="L-5919"><a href="#L-5919"><span class="linenos">5919</span></a> -</span><span id="L-5920"><a href="#L-5920"><span class="linenos">5920</span></a><span class="c1"># TODO: deprecate this</span> -</span><span id="L-5921"><a href="#L-5921"><span class="linenos">5921</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-5922"><a href="#L-5922"><span class="linenos">5922</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-5923"><a href="#L-5923"><span class="linenos">5923</span></a><span class="n">NULL</span> <span class="o">=</span> <span class="n">Null</span><span class="p">()</span> +</span><span id="L-5899"><a href="#L-5899"><span class="linenos">5899</span></a> <span class="k">return</span> <span class="n">function</span> +</span><span id="L-5900"><a href="#L-5900"><span class="linenos">5900</span></a> +</span><span id="L-5901"><a href="#L-5901"><span class="linenos">5901</span></a> +</span><span id="L-5902"><a href="#L-5902"><span class="linenos">5902</span></a><span class="k">def</span> <span class="nf">true</span><span class="p">()</span> <span class="o">-></span> <span class="n">Boolean</span><span class="p">:</span> +</span><span id="L-5903"><a href="#L-5903"><span class="linenos">5903</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5904"><a href="#L-5904"><span class="linenos">5904</span></a><span class="sd"> Returns a true Boolean expression.</span> +</span><span id="L-5905"><a href="#L-5905"><span class="linenos">5905</span></a><span class="sd"> """</span> +</span><span id="L-5906"><a href="#L-5906"><span class="linenos">5906</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-5907"><a href="#L-5907"><span class="linenos">5907</span></a> +</span><span id="L-5908"><a href="#L-5908"><span class="linenos">5908</span></a> +</span><span id="L-5909"><a href="#L-5909"><span class="linenos">5909</span></a><span class="k">def</span> <span class="nf">false</span><span class="p">()</span> <span class="o">-></span> <span class="n">Boolean</span><span class="p">:</span> +</span><span id="L-5910"><a href="#L-5910"><span class="linenos">5910</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5911"><a href="#L-5911"><span class="linenos">5911</span></a><span class="sd"> Returns a false Boolean expression.</span> +</span><span id="L-5912"><a href="#L-5912"><span class="linenos">5912</span></a><span class="sd"> """</span> +</span><span id="L-5913"><a href="#L-5913"><span class="linenos">5913</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-5914"><a href="#L-5914"><span class="linenos">5914</span></a> +</span><span id="L-5915"><a href="#L-5915"><span class="linenos">5915</span></a> +</span><span id="L-5916"><a href="#L-5916"><span class="linenos">5916</span></a><span class="k">def</span> <span class="nf">null</span><span class="p">()</span> <span class="o">-></span> <span class="n">Null</span><span class="p">:</span> +</span><span id="L-5917"><a href="#L-5917"><span class="linenos">5917</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-5918"><a href="#L-5918"><span class="linenos">5918</span></a><span class="sd"> Returns a Null expression.</span> +</span><span id="L-5919"><a href="#L-5919"><span class="linenos">5919</span></a><span class="sd"> """</span> +</span><span id="L-5920"><a href="#L-5920"><span class="linenos">5920</span></a> <span class="k">return</span> <span class="n">Null</span><span class="p">()</span> +</span><span id="L-5921"><a href="#L-5921"><span class="linenos">5921</span></a> +</span><span id="L-5922"><a href="#L-5922"><span class="linenos">5922</span></a> +</span><span id="L-5923"><a href="#L-5923"><span class="linenos">5923</span></a><span class="c1"># TODO: deprecate this</span> +</span><span id="L-5924"><a href="#L-5924"><span class="linenos">5924</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-5925"><a href="#L-5925"><span class="linenos">5925</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-5926"><a href="#L-5926"><span class="linenos">5926</span></a><span class="n">NULL</span> <span class="o">=</span> <span class="n">Null</span><span class="p">()</span> </span></pre></div> @@ -11650,557 +11662,554 @@ SQL expressions, such as <code><a href="#select">sqlglot.expressions.select</a>< </span><span id="Expression-103"><a href="#Expression-103"><span class="linenos">103</span></a> </span><span id="Expression-104"><a href="#Expression-104"><span class="linenos">104</span></a> <span class="nd">@property</span> </span><span id="Expression-105"><a href="#Expression-105"><span class="linenos">105</span></a> <span class="k">def</span> <span class="nf">hashable_args</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">Any</span><span class="p">:</span> -</span><span id="Expression-106"><a href="#Expression-106"><span class="linenos">106</span></a> <span class="n">args</span> <span class="o">=</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">k</span><span class="p">)</span> <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">arg_types</span><span class="p">)</span> -</span><span id="Expression-107"><a href="#Expression-107"><span class="linenos">107</span></a> -</span><span id="Expression-108"><a href="#Expression-108"><span class="linenos">108</span></a> <span class="k">return</span> <span class="nb">tuple</span><span class="p">(</span> -</span><span id="Expression-109"><a href="#Expression-109"><span class="linenos">109</span></a> <span class="p">(</span><span class="nb">tuple</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 class="k">if</span> <span class="n">arg</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="Expression-110"><a href="#Expression-110"><span class="linenos">110</span></a> <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span> -</span><span id="Expression-111"><a href="#Expression-111"><span class="linenos">111</span></a> <span class="k">else</span> <span class="p">(</span><span class="n">_norm_arg</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> <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="k">else</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="Expression-112"><a href="#Expression-112"><span class="linenos">112</span></a> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">args</span> -</span><span id="Expression-113"><a href="#Expression-113"><span class="linenos">113</span></a> <span class="p">)</span> -</span><span id="Expression-114"><a href="#Expression-114"><span class="linenos">114</span></a> -</span><span id="Expression-115"><a href="#Expression-115"><span class="linenos">115</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-116"><a href="#Expression-116"><span class="linenos">116</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hash</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</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">_hash</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="k">return</span> <span class="nb">hash</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="bp">self</span><span class="o">.</span><span class="n">hashable_args</span><span class="p">))</span> -</span><span id="Expression-120"><a href="#Expression-120"><span class="linenos">120</span></a> -</span><span id="Expression-121"><a href="#Expression-121"><span class="linenos">121</span></a> <span class="nd">@property</span> -</span><span id="Expression-122"><a href="#Expression-122"><span class="linenos">122</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-123"><a href="#Expression-123"><span class="linenos">123</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-124"><a href="#Expression-124"><span class="linenos">124</span></a><span class="sd"> Retrieves the argument with key "this".</span> -</span><span id="Expression-125"><a href="#Expression-125"><span class="linenos">125</span></a><span class="sd"> """</span> -</span><span id="Expression-126"><a href="#Expression-126"><span class="linenos">126</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-127"><a href="#Expression-127"><span class="linenos">127</span></a> -</span><span id="Expression-128"><a href="#Expression-128"><span class="linenos">128</span></a> <span class="nd">@property</span> -</span><span id="Expression-129"><a href="#Expression-129"><span class="linenos">129</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-130"><a href="#Expression-130"><span class="linenos">130</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-131"><a href="#Expression-131"><span class="linenos">131</span></a><span class="sd"> Retrieves the argument with key "expression".</span> -</span><span id="Expression-132"><a href="#Expression-132"><span class="linenos">132</span></a><span class="sd"> """</span> -</span><span id="Expression-133"><a href="#Expression-133"><span class="linenos">133</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-134"><a href="#Expression-134"><span class="linenos">134</span></a> -</span><span id="Expression-135"><a href="#Expression-135"><span class="linenos">135</span></a> <span class="nd">@property</span> -</span><span id="Expression-136"><a href="#Expression-136"><span class="linenos">136</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-137"><a href="#Expression-137"><span class="linenos">137</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-138"><a href="#Expression-138"><span class="linenos">138</span></a><span class="sd"> Retrieves the argument with key "expressions".</span> -</span><span id="Expression-139"><a href="#Expression-139"><span class="linenos">139</span></a><span class="sd"> """</span> -</span><span id="Expression-140"><a href="#Expression-140"><span class="linenos">140</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-141"><a href="#Expression-141"><span class="linenos">141</span></a> -</span><span id="Expression-142"><a href="#Expression-142"><span class="linenos">142</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-143"><a href="#Expression-143"><span class="linenos">143</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-144"><a href="#Expression-144"><span class="linenos">144</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-145"><a href="#Expression-145"><span class="linenos">145</span></a><span class="sd"> for args that are strings or leaf Expression instances, such as identifiers and literals.</span> -</span><span id="Expression-146"><a href="#Expression-146"><span class="linenos">146</span></a><span class="sd"> """</span> -</span><span id="Expression-147"><a href="#Expression-147"><span class="linenos">147</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-148"><a href="#Expression-148"><span class="linenos">148</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-149"><a href="#Expression-149"><span class="linenos">149</span></a> <span class="k">return</span> <span class="n">field</span> -</span><span id="Expression-150"><a href="#Expression-150"><span class="linenos">150</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-151"><a href="#Expression-151"><span class="linenos">151</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-152"><a href="#Expression-152"><span class="linenos">152</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-153"><a href="#Expression-153"><span class="linenos">153</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-154"><a href="#Expression-154"><span class="linenos">154</span></a> <span class="k">return</span> <span class="s2">""</span> -</span><span id="Expression-155"><a href="#Expression-155"><span class="linenos">155</span></a> -</span><span id="Expression-156"><a href="#Expression-156"><span class="linenos">156</span></a> <span class="nd">@property</span> -</span><span id="Expression-157"><a href="#Expression-157"><span class="linenos">157</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-158"><a href="#Expression-158"><span class="linenos">158</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-159"><a href="#Expression-159"><span class="linenos">159</span></a><span class="sd"> Checks whether a Literal expression is a string.</span> -</span><span id="Expression-160"><a href="#Expression-160"><span class="linenos">160</span></a><span class="sd"> """</span> -</span><span id="Expression-161"><a href="#Expression-161"><span class="linenos">161</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-162"><a href="#Expression-162"><span class="linenos">162</span></a> -</span><span id="Expression-163"><a href="#Expression-163"><span class="linenos">163</span></a> <span class="nd">@property</span> -</span><span id="Expression-164"><a href="#Expression-164"><span class="linenos">164</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-165"><a href="#Expression-165"><span class="linenos">165</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-166"><a href="#Expression-166"><span class="linenos">166</span></a><span class="sd"> Checks whether a Literal expression is a number.</span> -</span><span id="Expression-167"><a href="#Expression-167"><span class="linenos">167</span></a><span class="sd"> """</span> -</span><span id="Expression-168"><a href="#Expression-168"><span class="linenos">168</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-169"><a href="#Expression-169"><span class="linenos">169</span></a> -</span><span id="Expression-170"><a href="#Expression-170"><span class="linenos">170</span></a> <span class="nd">@property</span> -</span><span id="Expression-171"><a href="#Expression-171"><span class="linenos">171</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-172"><a href="#Expression-172"><span class="linenos">172</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-173"><a href="#Expression-173"><span class="linenos">173</span></a><span class="sd"> Checks whether a Literal expression is an integer.</span> -</span><span id="Expression-174"><a href="#Expression-174"><span class="linenos">174</span></a><span class="sd"> """</span> -</span><span id="Expression-175"><a href="#Expression-175"><span class="linenos">175</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-176"><a href="#Expression-176"><span class="linenos">176</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="Expression-177"><a href="#Expression-177"><span class="linenos">177</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-178"><a href="#Expression-178"><span class="linenos">178</span></a> <span class="k">return</span> <span class="kc">True</span> -</span><span id="Expression-179"><a href="#Expression-179"><span class="linenos">179</span></a> <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> -</span><span id="Expression-180"><a href="#Expression-180"><span class="linenos">180</span></a> <span class="k">pass</span> -</span><span id="Expression-181"><a href="#Expression-181"><span class="linenos">181</span></a> <span class="k">return</span> <span class="kc">False</span> -</span><span id="Expression-182"><a href="#Expression-182"><span class="linenos">182</span></a> -</span><span id="Expression-183"><a href="#Expression-183"><span class="linenos">183</span></a> <span class="nd">@property</span> -</span><span id="Expression-184"><a href="#Expression-184"><span class="linenos">184</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-185"><a href="#Expression-185"><span class="linenos">185</span></a><span class="w"> </span><span class="sd">"""Checks whether an expression is a star."""</span> -</span><span id="Expression-186"><a href="#Expression-186"><span class="linenos">186</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-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">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-190"><a href="#Expression-190"><span class="linenos">190</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-191"><a href="#Expression-191"><span class="linenos">191</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-192"><a href="#Expression-192"><span class="linenos">192</span></a><span class="sd"> """</span> -</span><span id="Expression-193"><a href="#Expression-193"><span class="linenos">193</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-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">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-195"><a href="#Expression-195"><span class="linenos">195</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-196"><a href="#Expression-196"><span class="linenos">196</span></a> -</span><span id="Expression-197"><a href="#Expression-197"><span class="linenos">197</span></a> <span class="nd">@property</span> -</span><span id="Expression-198"><a href="#Expression-198"><span class="linenos">198</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-199"><a href="#Expression-199"><span class="linenos">199</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-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="nd">@property</span> -</span><span id="Expression-202"><a href="#Expression-202"><span class="linenos">202</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Expression-203"><a href="#Expression-203"><span class="linenos">203</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-204"><a href="#Expression-204"><span class="linenos">204</span></a> -</span><span id="Expression-205"><a href="#Expression-205"><span class="linenos">205</span></a> <span class="nd">@property</span> -</span><span id="Expression-206"><a href="#Expression-206"><span class="linenos">206</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="Expression-207"><a href="#Expression-207"><span class="linenos">207</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-208"><a href="#Expression-208"><span class="linenos">208</span></a><span class="sd"> Name of the output column if this expression is a selection.</span> -</span><span id="Expression-209"><a href="#Expression-209"><span class="linenos">209</span></a> -</span><span id="Expression-210"><a href="#Expression-210"><span class="linenos">210</span></a><span class="sd"> If the Expression has no output name, an empty string is returned.</span> -</span><span id="Expression-211"><a href="#Expression-211"><span class="linenos">211</span></a> -</span><span id="Expression-212"><a href="#Expression-212"><span class="linenos">212</span></a><span class="sd"> Example:</span> -</span><span id="Expression-213"><a href="#Expression-213"><span class="linenos">213</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="Expression-214"><a href="#Expression-214"><span class="linenos">214</span></a><span class="sd"> >>> parse_one("SELECT a").expressions[0].output_name</span> -</span><span id="Expression-215"><a href="#Expression-215"><span class="linenos">215</span></a><span class="sd"> 'a'</span> -</span><span id="Expression-216"><a href="#Expression-216"><span class="linenos">216</span></a><span class="sd"> >>> parse_one("SELECT b AS c").expressions[0].output_name</span> -</span><span id="Expression-217"><a href="#Expression-217"><span class="linenos">217</span></a><span class="sd"> 'c'</span> -</span><span id="Expression-218"><a href="#Expression-218"><span class="linenos">218</span></a><span class="sd"> >>> parse_one("SELECT 1 + 2").expressions[0].output_name</span> -</span><span id="Expression-219"><a href="#Expression-219"><span class="linenos">219</span></a><span class="sd"> ''</span> -</span><span id="Expression-220"><a href="#Expression-220"><span class="linenos">220</span></a><span class="sd"> """</span> -</span><span id="Expression-221"><a href="#Expression-221"><span class="linenos">221</span></a> <span class="k">return</span> <span class="s2">""</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="nd">@property</span> -</span><span id="Expression-224"><a href="#Expression-224"><span class="linenos">224</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-225"><a href="#Expression-225"><span class="linenos">225</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-226"><a href="#Expression-226"><span class="linenos">226</span></a> -</span><span id="Expression-227"><a href="#Expression-227"><span class="linenos">227</span></a> <span class="nd">@type</span><span class="o">.</span><span class="n">setter</span> -</span><span id="Expression-228"><a href="#Expression-228"><span class="linenos">228</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-229"><a href="#Expression-229"><span class="linenos">229</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-230"><a href="#Expression-230"><span class="linenos">230</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-231"><a href="#Expression-231"><span class="linenos">231</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-232"><a href="#Expression-232"><span class="linenos">232</span></a> -</span><span id="Expression-233"><a href="#Expression-233"><span class="linenos">233</span></a> <span class="nd">@property</span> -</span><span id="Expression-234"><a href="#Expression-234"><span class="linenos">234</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-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">_meta</span> <span class="ow">is</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="bp">self</span><span class="o">.</span><span class="n">_meta</span> <span class="o">=</span> <span class="p">{}</span> -</span><span id="Expression-237"><a href="#Expression-237"><span class="linenos">237</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-238"><a href="#Expression-238"><span class="linenos">238</span></a> -</span><span id="Expression-239"><a href="#Expression-239"><span class="linenos">239</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-240"><a href="#Expression-240"><span class="linenos">240</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-241"><a href="#Expression-241"><span class="linenos">241</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-242"><a href="#Expression-242"><span class="linenos">242</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-106"><a href="#Expression-106"><span class="linenos">106</span></a> <span class="k">return</span> <span class="nb">frozenset</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">_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">v</span><span class="p">)</span> <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span> <span class="k">else</span> <span class="n">_norm_arg</span><span class="p">(</span><span class="n">v</span><span class="p">))</span> +</span><span id="Expression-108"><a href="#Expression-108"><span class="linenos">108</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-109"><a href="#Expression-109"><span class="linenos">109</span></a> <span class="k">if</span> <span class="ow">not</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="n">v</span> <span class="ow">is</span> <span class="kc">False</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">type</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">v</span><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="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-113"><a href="#Expression-113"><span class="linenos">113</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hash</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="Expression-114"><a href="#Expression-114"><span class="linenos">114</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hash</span> +</span><span id="Expression-115"><a href="#Expression-115"><span class="linenos">115</span></a> +</span><span id="Expression-116"><a href="#Expression-116"><span class="linenos">116</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="vm">__class__</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">hashable_args</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">this</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 "this".</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">"this"</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">expression</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 "expression".</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">"expression"</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="nd">@property</span> +</span><span id="Expression-133"><a href="#Expression-133"><span class="linenos">133</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-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"> Retrieves the argument with key "expressions".</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="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-138"><a href="#Expression-138"><span class="linenos">138</span></a> +</span><span id="Expression-139"><a href="#Expression-139"><span class="linenos">139</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-140"><a href="#Expression-140"><span class="linenos">140</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-141"><a href="#Expression-141"><span class="linenos">141</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-142"><a href="#Expression-142"><span class="linenos">142</span></a><span class="sd"> for args that are strings or leaf Expression instances, such as identifiers and literals.</span> +</span><span id="Expression-143"><a href="#Expression-143"><span class="linenos">143</span></a><span class="sd"> """</span> +</span><span id="Expression-144"><a href="#Expression-144"><span class="linenos">144</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-145"><a href="#Expression-145"><span class="linenos">145</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-146"><a href="#Expression-146"><span class="linenos">146</span></a> <span class="k">return</span> <span class="n">field</span> +</span><span id="Expression-147"><a href="#Expression-147"><span class="linenos">147</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-148"><a href="#Expression-148"><span class="linenos">148</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-149"><a href="#Expression-149"><span class="linenos">149</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-150"><a href="#Expression-150"><span class="linenos">150</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-151"><a href="#Expression-151"><span class="linenos">151</span></a> <span class="k">return</span> <span class="s2">""</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_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-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 string.</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="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_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-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 a number.</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">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-166"><a href="#Expression-166"><span class="linenos">166</span></a> +</span><span id="Expression-167"><a href="#Expression-167"><span class="linenos">167</span></a> <span class="nd">@property</span> +</span><span id="Expression-168"><a href="#Expression-168"><span class="linenos">168</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-169"><a href="#Expression-169"><span class="linenos">169</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-170"><a href="#Expression-170"><span class="linenos">170</span></a><span class="sd"> Checks whether a Literal expression is an integer.</span> +</span><span id="Expression-171"><a href="#Expression-171"><span class="linenos">171</span></a><span class="sd"> """</span> +</span><span id="Expression-172"><a href="#Expression-172"><span class="linenos">172</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-173"><a href="#Expression-173"><span class="linenos">173</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="Expression-174"><a href="#Expression-174"><span class="linenos">174</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-175"><a href="#Expression-175"><span class="linenos">175</span></a> <span class="k">return</span> <span class="kc">True</span> +</span><span id="Expression-176"><a href="#Expression-176"><span class="linenos">176</span></a> <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> +</span><span id="Expression-177"><a href="#Expression-177"><span class="linenos">177</span></a> <span class="k">pass</span> +</span><span id="Expression-178"><a href="#Expression-178"><span class="linenos">178</span></a> <span class="k">return</span> <span class="kc">False</span> +</span><span id="Expression-179"><a href="#Expression-179"><span class="linenos">179</span></a> +</span><span id="Expression-180"><a href="#Expression-180"><span class="linenos">180</span></a> <span class="nd">@property</span> +</span><span id="Expression-181"><a href="#Expression-181"><span class="linenos">181</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-182"><a href="#Expression-182"><span class="linenos">182</span></a><span class="w"> </span><span class="sd">"""Checks whether an expression is a star."""</span> +</span><span id="Expression-183"><a href="#Expression-183"><span class="linenos">183</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-184"><a href="#Expression-184"><span class="linenos">184</span></a> +</span><span id="Expression-185"><a href="#Expression-185"><span class="linenos">185</span></a> <span class="nd">@property</span> +</span><span id="Expression-186"><a href="#Expression-186"><span class="linenos">186</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-187"><a href="#Expression-187"><span class="linenos">187</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-188"><a href="#Expression-188"><span class="linenos">188</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-189"><a href="#Expression-189"><span class="linenos">189</span></a><span class="sd"> """</span> +</span><span id="Expression-190"><a href="#Expression-190"><span class="linenos">190</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-191"><a href="#Expression-191"><span class="linenos">191</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-192"><a href="#Expression-192"><span class="linenos">192</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-193"><a href="#Expression-193"><span class="linenos">193</span></a> +</span><span id="Expression-194"><a href="#Expression-194"><span class="linenos">194</span></a> <span class="nd">@property</span> +</span><span id="Expression-195"><a href="#Expression-195"><span class="linenos">195</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-196"><a href="#Expression-196"><span class="linenos">196</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-197"><a href="#Expression-197"><span class="linenos">197</span></a> +</span><span id="Expression-198"><a href="#Expression-198"><span class="linenos">198</span></a> <span class="nd">@property</span> +</span><span id="Expression-199"><a href="#Expression-199"><span class="linenos">199</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Expression-200"><a href="#Expression-200"><span class="linenos">200</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-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="nd">@property</span> +</span><span id="Expression-203"><a href="#Expression-203"><span class="linenos">203</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="Expression-204"><a href="#Expression-204"><span class="linenos">204</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-205"><a href="#Expression-205"><span class="linenos">205</span></a><span class="sd"> Name of the output column if this expression is a selection.</span> +</span><span id="Expression-206"><a href="#Expression-206"><span class="linenos">206</span></a> +</span><span id="Expression-207"><a href="#Expression-207"><span class="linenos">207</span></a><span class="sd"> If the Expression has no output name, an empty string is returned.</span> +</span><span id="Expression-208"><a href="#Expression-208"><span class="linenos">208</span></a> +</span><span id="Expression-209"><a href="#Expression-209"><span class="linenos">209</span></a><span class="sd"> Example:</span> +</span><span id="Expression-210"><a href="#Expression-210"><span class="linenos">210</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="Expression-211"><a href="#Expression-211"><span class="linenos">211</span></a><span class="sd"> >>> parse_one("SELECT a").expressions[0].output_name</span> +</span><span id="Expression-212"><a href="#Expression-212"><span class="linenos">212</span></a><span class="sd"> 'a'</span> +</span><span id="Expression-213"><a href="#Expression-213"><span class="linenos">213</span></a><span class="sd"> >>> parse_one("SELECT b AS c").expressions[0].output_name</span> +</span><span id="Expression-214"><a href="#Expression-214"><span class="linenos">214</span></a><span class="sd"> 'c'</span> +</span><span id="Expression-215"><a href="#Expression-215"><span class="linenos">215</span></a><span class="sd"> >>> parse_one("SELECT 1 + 2").expressions[0].output_name</span> +</span><span id="Expression-216"><a href="#Expression-216"><span class="linenos">216</span></a><span class="sd"> ''</span> +</span><span id="Expression-217"><a href="#Expression-217"><span class="linenos">217</span></a><span class="sd"> """</span> +</span><span id="Expression-218"><a href="#Expression-218"><span class="linenos">218</span></a> <span class="k">return</span> <span class="s2">""</span> +</span><span id="Expression-219"><a href="#Expression-219"><span class="linenos">219</span></a> +</span><span id="Expression-220"><a href="#Expression-220"><span class="linenos">220</span></a> <span class="nd">@property</span> +</span><span id="Expression-221"><a href="#Expression-221"><span class="linenos">221</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-222"><a href="#Expression-222"><span class="linenos">222</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-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">@type</span><span class="o">.</span><span class="n">setter</span> +</span><span id="Expression-225"><a href="#Expression-225"><span class="linenos">225</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-226"><a href="#Expression-226"><span class="linenos">226</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-227"><a href="#Expression-227"><span class="linenos">227</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-228"><a href="#Expression-228"><span class="linenos">228</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-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="nd">@property</span> +</span><span id="Expression-231"><a href="#Expression-231"><span class="linenos">231</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-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">_meta</span> <span class="ow">is</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="bp">self</span><span class="o">.</span><span class="n">_meta</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="Expression-234"><a href="#Expression-234"><span class="linenos">234</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-235"><a href="#Expression-235"><span class="linenos">235</span></a> +</span><span id="Expression-236"><a href="#Expression-236"><span class="linenos">236</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-237"><a href="#Expression-237"><span class="linenos">237</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-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">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-239"><a href="#Expression-239"><span class="linenos">239</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-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">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-242"><a href="#Expression-242"><span class="linenos">242</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-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="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-245"><a href="#Expression-245"><span class="linenos">245</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-244"><a href="#Expression-244"><span class="linenos">244</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-245"><a href="#Expression-245"><span class="linenos">245</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-246"><a href="#Expression-246"><span class="linenos">246</span></a> -</span><span id="Expression-247"><a href="#Expression-247"><span class="linenos">247</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-248"><a href="#Expression-248"><span class="linenos">248</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-249"><a href="#Expression-249"><span class="linenos">249</span></a> -</span><span id="Expression-250"><a href="#Expression-250"><span class="linenos">250</span></a> <span class="k">return</span> <span class="n">copy</span> -</span><span id="Expression-251"><a href="#Expression-251"><span class="linenos">251</span></a> -</span><span id="Expression-252"><a href="#Expression-252"><span class="linenos">252</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-253"><a href="#Expression-253"><span class="linenos">253</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-254"><a href="#Expression-254"><span class="linenos">254</span></a><span class="sd"> Returns a deep copy of the expression.</span> -</span><span id="Expression-255"><a href="#Expression-255"><span class="linenos">255</span></a><span class="sd"> """</span> -</span><span id="Expression-256"><a href="#Expression-256"><span class="linenos">256</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-257"><a href="#Expression-257"><span class="linenos">257</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-258"><a href="#Expression-258"><span class="linenos">258</span></a> <span class="k">return</span> <span class="n">new</span> -</span><span id="Expression-259"><a href="#Expression-259"><span class="linenos">259</span></a> -</span><span id="Expression-260"><a href="#Expression-260"><span class="linenos">260</span></a> <span class="k">def</span> <span class="nf">add_comments</span><span class="p">(</span><span class="bp">self</span><span class="p">,</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 class="p">:</span> -</span><span id="Expression-261"><a href="#Expression-261"><span class="linenos">261</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="kc">None</span><span class="p">:</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">comments</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="Expression-263"><a href="#Expression-263"><span class="linenos">263</span></a> <span class="k">if</span> <span class="n">comments</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">comments</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">comments</span><span class="p">)</span> -</span><span id="Expression-265"><a href="#Expression-265"><span class="linenos">265</span></a> -</span><span id="Expression-266"><a href="#Expression-266"><span class="linenos">266</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> -</span><span id="Expression-267"><a href="#Expression-267"><span class="linenos">267</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-268"><a href="#Expression-268"><span class="linenos">268</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-269"><a href="#Expression-269"><span class="linenos">269</span></a> -</span><span id="Expression-270"><a href="#Expression-270"><span class="linenos">270</span></a><span class="sd"> Args:</span> -</span><span id="Expression-271"><a href="#Expression-271"><span class="linenos">271</span></a><span class="sd"> arg_key (str): name of the list expression arg</span> -</span><span id="Expression-272"><a href="#Expression-272"><span class="linenos">272</span></a><span class="sd"> value (Any): value to append to the list</span> -</span><span id="Expression-273"><a href="#Expression-273"><span class="linenos">273</span></a><span class="sd"> """</span> -</span><span id="Expression-274"><a href="#Expression-274"><span class="linenos">274</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-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="p">[]</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">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-277"><a href="#Expression-277"><span class="linenos">277</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-278"><a href="#Expression-278"><span class="linenos">278</span></a> -</span><span id="Expression-279"><a href="#Expression-279"><span class="linenos">279</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> -</span><span id="Expression-280"><a href="#Expression-280"><span class="linenos">280</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-281"><a href="#Expression-281"><span class="linenos">281</span></a><span class="sd"> Sets `arg_key` to `value`.</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="sd"> Args:</span> -</span><span id="Expression-284"><a href="#Expression-284"><span class="linenos">284</span></a><span class="sd"> arg_key (str): name of the expression arg.</span> -</span><span id="Expression-285"><a href="#Expression-285"><span class="linenos">285</span></a><span class="sd"> value: value to set the arg to.</span> -</span><span id="Expression-286"><a href="#Expression-286"><span class="linenos">286</span></a><span class="sd"> """</span> -</span><span id="Expression-287"><a href="#Expression-287"><span class="linenos">287</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-288"><a href="#Expression-288"><span class="linenos">288</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-289"><a href="#Expression-289"><span class="linenos">289</span></a> -</span><span id="Expression-290"><a href="#Expression-290"><span class="linenos">290</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> -</span><span id="Expression-291"><a href="#Expression-291"><span class="linenos">291</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">):</span> -</span><span id="Expression-292"><a href="#Expression-292"><span class="linenos">292</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-293"><a href="#Expression-293"><span class="linenos">293</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-294"><a href="#Expression-294"><span class="linenos">294</span></a> <span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span> -</span><span id="Expression-295"><a href="#Expression-295"><span class="linenos">295</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-296"><a href="#Expression-296"><span class="linenos">296</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">"parent"</span><span class="p">):</span> -</span><span id="Expression-297"><a href="#Expression-297"><span class="linenos">297</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-298"><a href="#Expression-298"><span class="linenos">298</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-299"><a href="#Expression-299"><span class="linenos">299</span></a> -</span><span id="Expression-300"><a href="#Expression-300"><span class="linenos">300</span></a> <span class="nd">@property</span> -</span><span id="Expression-301"><a href="#Expression-301"><span class="linenos">301</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 class="o">-></span> <span class="nb">int</span><span class="p">:</span> -</span><span id="Expression-302"><a href="#Expression-302"><span class="linenos">302</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-303"><a href="#Expression-303"><span class="linenos">303</span></a><span class="sd"> Returns the depth of this tree.</span> -</span><span id="Expression-304"><a href="#Expression-304"><span class="linenos">304</span></a><span class="sd"> """</span> -</span><span id="Expression-305"><a href="#Expression-305"><span class="linenos">305</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-306"><a href="#Expression-306"><span class="linenos">306</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-307"><a href="#Expression-307"><span class="linenos">307</span></a> <span class="k">return</span> <span class="mi">0</span> -</span><span id="Expression-308"><a href="#Expression-308"><span class="linenos">308</span></a> -</span><span id="Expression-309"><a href="#Expression-309"><span class="linenos">309</span></a> <span class="k">def</span> <span class="nf">iter_expressions</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">Iterator</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="nb">str</span><span class="p">,</span> <span class="n">Expression</span><span class="p">]]:</span> -</span><span id="Expression-310"><a href="#Expression-310"><span class="linenos">310</span></a><span class="w"> </span><span class="sd">"""Yields the key and expression for all arguments, exploding list args."""</span> -</span><span id="Expression-311"><a href="#Expression-311"><span class="linenos">311</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-312"><a href="#Expression-312"><span class="linenos">312</span></a> <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span> -</span><span id="Expression-313"><a href="#Expression-313"><span class="linenos">313</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">vs</span><span class="p">:</span> -</span><span id="Expression-314"><a href="#Expression-314"><span class="linenos">314</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">"parent"</span><span class="p">):</span> -</span><span id="Expression-315"><a href="#Expression-315"><span class="linenos">315</span></a> <span class="k">yield</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> -</span><span id="Expression-316"><a href="#Expression-316"><span class="linenos">316</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Expression-317"><a href="#Expression-317"><span class="linenos">317</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">vs</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">):</span> -</span><span id="Expression-318"><a href="#Expression-318"><span class="linenos">318</span></a> <span class="k">yield</span> <span class="n">k</span><span class="p">,</span> <span class="n">vs</span> -</span><span id="Expression-319"><a href="#Expression-319"><span class="linenos">319</span></a> -</span><span id="Expression-320"><a href="#Expression-320"><span class="linenos">320</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">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">],</span> <span class="n">bfs</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">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">E</span><span class="p">]:</span> -</span><span id="Expression-321"><a href="#Expression-321"><span class="linenos">321</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-322"><a href="#Expression-322"><span class="linenos">322</span></a><span class="sd"> Returns the first node in this tree which matches at least one of</span> -</span><span id="Expression-323"><a href="#Expression-323"><span class="linenos">323</span></a><span class="sd"> the specified types.</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="sd"> Args:</span> -</span><span id="Expression-326"><a href="#Expression-326"><span class="linenos">326</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> -</span><span id="Expression-327"><a href="#Expression-327"><span class="linenos">327</span></a><span class="sd"> bfs: whether to search the AST using the BFS algorithm (DFS is used if false).</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"> Returns:</span> -</span><span id="Expression-330"><a href="#Expression-330"><span class="linenos">330</span></a><span class="sd"> The node which matches the criteria or None if no such node was found.</span> -</span><span id="Expression-331"><a href="#Expression-331"><span class="linenos">331</span></a><span class="sd"> """</span> -</span><span id="Expression-332"><a href="#Expression-332"><span class="linenos">332</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-333"><a href="#Expression-333"><span class="linenos">333</span></a> -</span><span id="Expression-334"><a href="#Expression-334"><span class="linenos">334</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">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">],</span> <span class="n">bfs</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">t</span><span class="o">.</span><span class="n">Iterator</span><span class="p">[</span><span class="n">E</span><span class="p">]:</span> -</span><span id="Expression-335"><a href="#Expression-335"><span class="linenos">335</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-336"><a href="#Expression-336"><span class="linenos">336</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree and only</span> -</span><span id="Expression-337"><a href="#Expression-337"><span class="linenos">337</span></a><span class="sd"> yields those that match at least one of the specified expression types.</span> -</span><span id="Expression-338"><a href="#Expression-338"><span class="linenos">338</span></a> -</span><span id="Expression-339"><a href="#Expression-339"><span class="linenos">339</span></a><span class="sd"> Args:</span> -</span><span id="Expression-340"><a href="#Expression-340"><span class="linenos">340</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> -</span><span id="Expression-341"><a href="#Expression-341"><span class="linenos">341</span></a><span class="sd"> bfs: whether to search the AST using the BFS algorithm (DFS is used if false).</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">for</span> <span class="n">expression</span><span class="p">,</span> <span class="o">*</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-347"><a href="#Expression-347"><span class="linenos">347</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-348"><a href="#Expression-348"><span class="linenos">348</span></a> <span class="k">yield</span> <span class="n">expression</span> -</span><span id="Expression-349"><a href="#Expression-349"><span class="linenos">349</span></a> -</span><span id="Expression-350"><a href="#Expression-350"><span class="linenos">350</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 class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</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">E</span><span class="p">]:</span> -</span><span id="Expression-351"><a href="#Expression-351"><span class="linenos">351</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-352"><a href="#Expression-352"><span class="linenos">352</span></a><span class="sd"> Returns a nearest parent matching expression_types.</span> +</span><span id="Expression-247"><a href="#Expression-247"><span class="linenos">247</span></a> <span class="k">return</span> <span class="n">copy</span> +</span><span id="Expression-248"><a href="#Expression-248"><span class="linenos">248</span></a> +</span><span id="Expression-249"><a href="#Expression-249"><span class="linenos">249</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-250"><a href="#Expression-250"><span class="linenos">250</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-251"><a href="#Expression-251"><span class="linenos">251</span></a><span class="sd"> Returns a deep copy of the expression.</span> +</span><span id="Expression-252"><a href="#Expression-252"><span class="linenos">252</span></a><span class="sd"> """</span> +</span><span id="Expression-253"><a href="#Expression-253"><span class="linenos">253</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-254"><a href="#Expression-254"><span class="linenos">254</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-255"><a href="#Expression-255"><span class="linenos">255</span></a> <span class="k">return</span> <span class="n">new</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="k">def</span> <span class="nf">add_comments</span><span class="p">(</span><span class="bp">self</span><span class="p">,</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 class="p">:</span> +</span><span id="Expression-258"><a href="#Expression-258"><span class="linenos">258</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="kc">None</span><span class="p">:</span> +</span><span id="Expression-259"><a href="#Expression-259"><span class="linenos">259</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="Expression-260"><a href="#Expression-260"><span class="linenos">260</span></a> <span class="k">if</span> <span class="n">comments</span><span class="p">:</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">comments</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">comments</span><span class="p">)</span> +</span><span id="Expression-262"><a href="#Expression-262"><span class="linenos">262</span></a> +</span><span id="Expression-263"><a href="#Expression-263"><span class="linenos">263</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> +</span><span id="Expression-264"><a href="#Expression-264"><span class="linenos">264</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-265"><a href="#Expression-265"><span class="linenos">265</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-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="sd"> Args:</span> +</span><span id="Expression-268"><a href="#Expression-268"><span class="linenos">268</span></a><span class="sd"> arg_key (str): name of the list expression arg</span> +</span><span id="Expression-269"><a href="#Expression-269"><span class="linenos">269</span></a><span class="sd"> value (Any): value to append to the list</span> +</span><span id="Expression-270"><a href="#Expression-270"><span class="linenos">270</span></a><span class="sd"> """</span> +</span><span id="Expression-271"><a href="#Expression-271"><span class="linenos">271</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-272"><a href="#Expression-272"><span class="linenos">272</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-273"><a href="#Expression-273"><span class="linenos">273</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-274"><a href="#Expression-274"><span class="linenos">274</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-275"><a href="#Expression-275"><span class="linenos">275</span></a> +</span><span id="Expression-276"><a href="#Expression-276"><span class="linenos">276</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> +</span><span id="Expression-277"><a href="#Expression-277"><span class="linenos">277</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-278"><a href="#Expression-278"><span class="linenos">278</span></a><span class="sd"> Sets `arg_key` to `value`.</span> +</span><span id="Expression-279"><a href="#Expression-279"><span class="linenos">279</span></a> +</span><span id="Expression-280"><a href="#Expression-280"><span class="linenos">280</span></a><span class="sd"> Args:</span> +</span><span id="Expression-281"><a href="#Expression-281"><span class="linenos">281</span></a><span class="sd"> arg_key (str): name of the expression arg.</span> +</span><span id="Expression-282"><a href="#Expression-282"><span class="linenos">282</span></a><span class="sd"> value: value to set the arg to.</span> +</span><span id="Expression-283"><a href="#Expression-283"><span class="linenos">283</span></a><span class="sd"> """</span> +</span><span id="Expression-284"><a href="#Expression-284"><span class="linenos">284</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-285"><a href="#Expression-285"><span class="linenos">285</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-286"><a href="#Expression-286"><span class="linenos">286</span></a> +</span><span id="Expression-287"><a href="#Expression-287"><span class="linenos">287</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> +</span><span id="Expression-288"><a href="#Expression-288"><span class="linenos">288</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">):</span> +</span><span id="Expression-289"><a href="#Expression-289"><span class="linenos">289</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-290"><a href="#Expression-290"><span class="linenos">290</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-291"><a href="#Expression-291"><span class="linenos">291</span></a> <span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span> +</span><span id="Expression-292"><a href="#Expression-292"><span class="linenos">292</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-293"><a href="#Expression-293"><span class="linenos">293</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">"parent"</span><span class="p">):</span> +</span><span id="Expression-294"><a href="#Expression-294"><span class="linenos">294</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-295"><a href="#Expression-295"><span class="linenos">295</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-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="nd">@property</span> +</span><span id="Expression-298"><a href="#Expression-298"><span class="linenos">298</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 class="o">-></span> <span class="nb">int</span><span class="p">:</span> +</span><span id="Expression-299"><a href="#Expression-299"><span class="linenos">299</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-300"><a href="#Expression-300"><span class="linenos">300</span></a><span class="sd"> Returns the depth of this tree.</span> +</span><span id="Expression-301"><a href="#Expression-301"><span class="linenos">301</span></a><span class="sd"> """</span> +</span><span id="Expression-302"><a href="#Expression-302"><span class="linenos">302</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-303"><a href="#Expression-303"><span class="linenos">303</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-304"><a href="#Expression-304"><span class="linenos">304</span></a> <span class="k">return</span> <span class="mi">0</span> +</span><span id="Expression-305"><a href="#Expression-305"><span class="linenos">305</span></a> +</span><span id="Expression-306"><a href="#Expression-306"><span class="linenos">306</span></a> <span class="k">def</span> <span class="nf">iter_expressions</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">Iterator</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="nb">str</span><span class="p">,</span> <span class="n">Expression</span><span class="p">]]:</span> +</span><span id="Expression-307"><a href="#Expression-307"><span class="linenos">307</span></a><span class="w"> </span><span class="sd">"""Yields the key and expression for all arguments, exploding list args."""</span> +</span><span id="Expression-308"><a href="#Expression-308"><span class="linenos">308</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-309"><a href="#Expression-309"><span class="linenos">309</span></a> <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span> +</span><span id="Expression-310"><a href="#Expression-310"><span class="linenos">310</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">vs</span><span class="p">:</span> +</span><span id="Expression-311"><a href="#Expression-311"><span class="linenos">311</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">"parent"</span><span class="p">):</span> +</span><span id="Expression-312"><a href="#Expression-312"><span class="linenos">312</span></a> <span class="k">yield</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> +</span><span id="Expression-313"><a href="#Expression-313"><span class="linenos">313</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Expression-314"><a href="#Expression-314"><span class="linenos">314</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">vs</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">):</span> +</span><span id="Expression-315"><a href="#Expression-315"><span class="linenos">315</span></a> <span class="k">yield</span> <span class="n">k</span><span class="p">,</span> <span class="n">vs</span> +</span><span id="Expression-316"><a href="#Expression-316"><span class="linenos">316</span></a> +</span><span id="Expression-317"><a href="#Expression-317"><span class="linenos">317</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">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">],</span> <span class="n">bfs</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">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">E</span><span class="p">]:</span> +</span><span id="Expression-318"><a href="#Expression-318"><span class="linenos">318</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-319"><a href="#Expression-319"><span class="linenos">319</span></a><span class="sd"> Returns the first node in this tree which matches at least one of</span> +</span><span id="Expression-320"><a href="#Expression-320"><span class="linenos">320</span></a><span class="sd"> the specified types.</span> +</span><span id="Expression-321"><a href="#Expression-321"><span class="linenos">321</span></a> +</span><span id="Expression-322"><a href="#Expression-322"><span class="linenos">322</span></a><span class="sd"> Args:</span> +</span><span id="Expression-323"><a href="#Expression-323"><span class="linenos">323</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> +</span><span id="Expression-324"><a href="#Expression-324"><span class="linenos">324</span></a><span class="sd"> bfs: whether to search the AST using the BFS algorithm (DFS is used if false).</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="sd"> Returns:</span> +</span><span id="Expression-327"><a href="#Expression-327"><span class="linenos">327</span></a><span class="sd"> The node which matches the criteria or None if no such node was found.</span> +</span><span id="Expression-328"><a href="#Expression-328"><span class="linenos">328</span></a><span class="sd"> """</span> +</span><span id="Expression-329"><a href="#Expression-329"><span class="linenos">329</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-330"><a href="#Expression-330"><span class="linenos">330</span></a> +</span><span id="Expression-331"><a href="#Expression-331"><span class="linenos">331</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">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">],</span> <span class="n">bfs</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">t</span><span class="o">.</span><span class="n">Iterator</span><span class="p">[</span><span class="n">E</span><span class="p">]:</span> +</span><span id="Expression-332"><a href="#Expression-332"><span class="linenos">332</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-333"><a href="#Expression-333"><span class="linenos">333</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree and only</span> +</span><span id="Expression-334"><a href="#Expression-334"><span class="linenos">334</span></a><span class="sd"> yields those that match at least one of the specified expression types.</span> +</span><span id="Expression-335"><a href="#Expression-335"><span class="linenos">335</span></a> +</span><span id="Expression-336"><a href="#Expression-336"><span class="linenos">336</span></a><span class="sd"> Args:</span> +</span><span id="Expression-337"><a href="#Expression-337"><span class="linenos">337</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> +</span><span id="Expression-338"><a href="#Expression-338"><span class="linenos">338</span></a><span class="sd"> bfs: whether to search the AST using the BFS algorithm (DFS is used if false).</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="sd"> Returns:</span> +</span><span id="Expression-341"><a href="#Expression-341"><span class="linenos">341</span></a><span class="sd"> The generator object.</span> +</span><span id="Expression-342"><a href="#Expression-342"><span class="linenos">342</span></a><span class="sd"> """</span> +</span><span id="Expression-343"><a href="#Expression-343"><span class="linenos">343</span></a> <span class="k">for</span> <span class="n">expression</span><span class="p">,</span> <span class="o">*</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-344"><a href="#Expression-344"><span class="linenos">344</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-345"><a href="#Expression-345"><span class="linenos">345</span></a> <span class="k">yield</span> <span class="n">expression</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">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 class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</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">E</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 nearest parent matching expression_types.</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="sd"> Args:</span> +</span><span id="Expression-352"><a href="#Expression-352"><span class="linenos">352</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> </span><span id="Expression-353"><a href="#Expression-353"><span class="linenos">353</span></a> -</span><span id="Expression-354"><a href="#Expression-354"><span class="linenos">354</span></a><span class="sd"> Args:</span> -</span><span id="Expression-355"><a href="#Expression-355"><span class="linenos">355</span></a><span class="sd"> expression_types: the expression type(s) to match.</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 parent node.</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="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-361"><a href="#Expression-361"><span class="linenos">361</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-362"><a href="#Expression-362"><span class="linenos">362</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-363"><a href="#Expression-363"><span class="linenos">363</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">E</span><span class="p">,</span> <span class="n">ancestor</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="nd">@property</span> -</span><span id="Expression-366"><a href="#Expression-366"><span class="linenos">366</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 class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Select</span><span class="p">]:</span> -</span><span id="Expression-367"><a href="#Expression-367"><span class="linenos">367</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-368"><a href="#Expression-368"><span class="linenos">368</span></a><span class="sd"> Returns the parent select statement.</span> -</span><span id="Expression-369"><a href="#Expression-369"><span class="linenos">369</span></a><span class="sd"> """</span> -</span><span id="Expression-370"><a href="#Expression-370"><span class="linenos">370</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-371"><a href="#Expression-371"><span class="linenos">371</span></a> -</span><span id="Expression-372"><a href="#Expression-372"><span class="linenos">372</span></a> <span class="nd">@property</span> -</span><span id="Expression-373"><a href="#Expression-373"><span class="linenos">373</span></a> <span class="k">def</span> <span class="nf">same_parent</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-374"><a href="#Expression-374"><span class="linenos">374</span></a><span class="w"> </span><span class="sd">"""Returns if the parent is the same class as itself."""</span> -</span><span id="Expression-375"><a href="#Expression-375"><span class="linenos">375</span></a> <span class="k">return</span> <span class="nb">type</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="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span> -</span><span id="Expression-376"><a href="#Expression-376"><span class="linenos">376</span></a> -</span><span id="Expression-377"><a href="#Expression-377"><span class="linenos">377</span></a> <span class="k">def</span> <span class="nf">root</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="Expression-378"><a href="#Expression-378"><span class="linenos">378</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-379"><a href="#Expression-379"><span class="linenos">379</span></a><span class="sd"> Returns the root expression of this tree.</span> -</span><span id="Expression-380"><a href="#Expression-380"><span class="linenos">380</span></a><span class="sd"> """</span> -</span><span id="Expression-381"><a href="#Expression-381"><span class="linenos">381</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="Expression-382"><a href="#Expression-382"><span class="linenos">382</span></a> <span class="k">while</span> <span class="n">expression</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> -</span><span id="Expression-383"><a href="#Expression-383"><span class="linenos">383</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression-384"><a href="#Expression-384"><span class="linenos">384</span></a> <span class="k">return</span> <span class="n">expression</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">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-387"><a href="#Expression-387"><span class="linenos">387</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-388"><a href="#Expression-388"><span class="linenos">388</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree.</span> -</span><span id="Expression-389"><a href="#Expression-389"><span class="linenos">389</span></a> -</span><span id="Expression-390"><a href="#Expression-390"><span class="linenos">390</span></a><span class="sd"> Args:</span> -</span><span id="Expression-391"><a href="#Expression-391"><span class="linenos">391</span></a><span class="sd"> bfs (bool): if set to True the BFS traversal order will be applied,</span> -</span><span id="Expression-392"><a href="#Expression-392"><span class="linenos">392</span></a><span class="sd"> otherwise the DFS traversal will be used instead.</span> -</span><span id="Expression-393"><a href="#Expression-393"><span class="linenos">393</span></a><span class="sd"> prune ((node, parent, arg_key) -> bool): callable that returns True if</span> -</span><span id="Expression-394"><a href="#Expression-394"><span class="linenos">394</span></a><span class="sd"> the generator should stop traversing this branch of the tree.</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="sd"> Returns:</span> -</span><span id="Expression-397"><a href="#Expression-397"><span class="linenos">397</span></a><span class="sd"> the generator object.</span> -</span><span id="Expression-398"><a href="#Expression-398"><span class="linenos">398</span></a><span class="sd"> """</span> -</span><span id="Expression-399"><a href="#Expression-399"><span class="linenos">399</span></a> <span class="k">if</span> <span class="n">bfs</span><span class="p">:</span> -</span><span id="Expression-400"><a href="#Expression-400"><span class="linenos">400</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-401"><a href="#Expression-401"><span class="linenos">401</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Expression-402"><a href="#Expression-402"><span class="linenos">402</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-403"><a href="#Expression-403"><span class="linenos">403</span></a> -</span><span id="Expression-404"><a href="#Expression-404"><span class="linenos">404</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-405"><a href="#Expression-405"><span class="linenos">405</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-406"><a href="#Expression-406"><span class="linenos">406</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> -</span><span id="Expression-407"><a href="#Expression-407"><span class="linenos">407</span></a><span class="sd"> the DFS (Depth-first) order.</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="sd"> Returns:</span> -</span><span id="Expression-410"><a href="#Expression-410"><span class="linenos">410</span></a><span class="sd"> The generator object.</span> -</span><span id="Expression-411"><a href="#Expression-411"><span class="linenos">411</span></a><span class="sd"> """</span> -</span><span id="Expression-412"><a href="#Expression-412"><span class="linenos">412</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-413"><a href="#Expression-413"><span class="linenos">413</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-414"><a href="#Expression-414"><span class="linenos">414</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-415"><a href="#Expression-415"><span class="linenos">415</span></a> <span class="k">return</span> +</span><span id="Expression-354"><a href="#Expression-354"><span class="linenos">354</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-355"><a href="#Expression-355"><span class="linenos">355</span></a><span class="sd"> The parent node.</span> +</span><span id="Expression-356"><a href="#Expression-356"><span class="linenos">356</span></a><span class="sd"> """</span> +</span><span id="Expression-357"><a href="#Expression-357"><span class="linenos">357</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-358"><a href="#Expression-358"><span class="linenos">358</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-359"><a href="#Expression-359"><span class="linenos">359</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-360"><a href="#Expression-360"><span class="linenos">360</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">E</span><span class="p">,</span> <span class="n">ancestor</span><span class="p">)</span> +</span><span id="Expression-361"><a href="#Expression-361"><span class="linenos">361</span></a> +</span><span id="Expression-362"><a href="#Expression-362"><span class="linenos">362</span></a> <span class="nd">@property</span> +</span><span id="Expression-363"><a href="#Expression-363"><span class="linenos">363</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 class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Select</span><span class="p">]:</span> +</span><span id="Expression-364"><a href="#Expression-364"><span class="linenos">364</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-365"><a href="#Expression-365"><span class="linenos">365</span></a><span class="sd"> Returns the parent select statement.</span> +</span><span id="Expression-366"><a href="#Expression-366"><span class="linenos">366</span></a><span class="sd"> """</span> +</span><span id="Expression-367"><a href="#Expression-367"><span class="linenos">367</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-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="nd">@property</span> +</span><span id="Expression-370"><a href="#Expression-370"><span class="linenos">370</span></a> <span class="k">def</span> <span class="nf">same_parent</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-371"><a href="#Expression-371"><span class="linenos">371</span></a><span class="w"> </span><span class="sd">"""Returns if the parent is the same class as itself."""</span> +</span><span id="Expression-372"><a href="#Expression-372"><span class="linenos">372</span></a> <span class="k">return</span> <span class="nb">type</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="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</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="k">def</span> <span class="nf">root</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="Expression-375"><a href="#Expression-375"><span class="linenos">375</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-376"><a href="#Expression-376"><span class="linenos">376</span></a><span class="sd"> Returns the root expression of this tree.</span> +</span><span id="Expression-377"><a href="#Expression-377"><span class="linenos">377</span></a><span class="sd"> """</span> +</span><span id="Expression-378"><a href="#Expression-378"><span class="linenos">378</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="Expression-379"><a href="#Expression-379"><span class="linenos">379</span></a> <span class="k">while</span> <span class="n">expression</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> +</span><span id="Expression-380"><a href="#Expression-380"><span class="linenos">380</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression-381"><a href="#Expression-381"><span class="linenos">381</span></a> <span class="k">return</span> <span class="n">expression</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">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-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.</span> +</span><span id="Expression-386"><a href="#Expression-386"><span class="linenos">386</span></a> +</span><span id="Expression-387"><a href="#Expression-387"><span class="linenos">387</span></a><span class="sd"> Args:</span> +</span><span id="Expression-388"><a href="#Expression-388"><span class="linenos">388</span></a><span class="sd"> bfs (bool): if set to True the BFS traversal order will be applied,</span> +</span><span id="Expression-389"><a href="#Expression-389"><span class="linenos">389</span></a><span class="sd"> otherwise the DFS traversal will be used instead.</span> +</span><span id="Expression-390"><a href="#Expression-390"><span class="linenos">390</span></a><span class="sd"> prune ((node, parent, arg_key) -> bool): callable that returns True if</span> +</span><span id="Expression-391"><a href="#Expression-391"><span class="linenos">391</span></a><span class="sd"> the generator should stop traversing this branch of the tree.</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="sd"> Returns:</span> +</span><span id="Expression-394"><a href="#Expression-394"><span class="linenos">394</span></a><span class="sd"> the generator object.</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="k">if</span> <span class="n">bfs</span><span class="p">:</span> +</span><span id="Expression-397"><a href="#Expression-397"><span class="linenos">397</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-398"><a href="#Expression-398"><span class="linenos">398</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Expression-399"><a href="#Expression-399"><span class="linenos">399</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-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">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-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 a generator object which visits all nodes in this tree in</span> +</span><span id="Expression-404"><a href="#Expression-404"><span class="linenos">404</span></a><span class="sd"> the DFS (Depth-first) order.</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="sd"> Returns:</span> +</span><span id="Expression-407"><a href="#Expression-407"><span class="linenos">407</span></a><span class="sd"> The generator object.</span> +</span><span id="Expression-408"><a href="#Expression-408"><span class="linenos">408</span></a><span class="sd"> """</span> +</span><span id="Expression-409"><a href="#Expression-409"><span class="linenos">409</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-410"><a href="#Expression-410"><span class="linenos">410</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-411"><a href="#Expression-411"><span class="linenos">411</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-412"><a href="#Expression-412"><span class="linenos">412</span></a> <span class="k">return</span> +</span><span id="Expression-413"><a href="#Expression-413"><span class="linenos">413</span></a> +</span><span id="Expression-414"><a href="#Expression-414"><span class="linenos">414</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">iter_expressions</span><span class="p">():</span> +</span><span id="Expression-415"><a href="#Expression-415"><span class="linenos">415</span></a> <span class="k">yield from</span> <span class="n">v</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-416"><a href="#Expression-416"><span class="linenos">416</span></a> -</span><span id="Expression-417"><a href="#Expression-417"><span class="linenos">417</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">iter_expressions</span><span class="p">():</span> -</span><span id="Expression-418"><a href="#Expression-418"><span class="linenos">418</span></a> <span class="k">yield from</span> <span class="n">v</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-419"><a href="#Expression-419"><span class="linenos">419</span></a> -</span><span id="Expression-420"><a href="#Expression-420"><span class="linenos">420</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-421"><a href="#Expression-421"><span class="linenos">421</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-422"><a href="#Expression-422"><span class="linenos">422</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> -</span><span id="Expression-423"><a href="#Expression-423"><span class="linenos">423</span></a><span class="sd"> the BFS (Breadth-first) order.</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="sd"> Returns:</span> -</span><span id="Expression-426"><a href="#Expression-426"><span class="linenos">426</span></a><span class="sd"> The generator object.</span> -</span><span id="Expression-427"><a href="#Expression-427"><span class="linenos">427</span></a><span class="sd"> """</span> -</span><span id="Expression-428"><a href="#Expression-428"><span class="linenos">428</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-417"><a href="#Expression-417"><span class="linenos">417</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-418"><a href="#Expression-418"><span class="linenos">418</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-419"><a href="#Expression-419"><span class="linenos">419</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> +</span><span id="Expression-420"><a href="#Expression-420"><span class="linenos">420</span></a><span class="sd"> the BFS (Breadth-first) order.</span> +</span><span id="Expression-421"><a href="#Expression-421"><span class="linenos">421</span></a> +</span><span id="Expression-422"><a href="#Expression-422"><span class="linenos">422</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-423"><a href="#Expression-423"><span class="linenos">423</span></a><span class="sd"> The generator object.</span> +</span><span id="Expression-424"><a href="#Expression-424"><span class="linenos">424</span></a><span class="sd"> """</span> +</span><span id="Expression-425"><a href="#Expression-425"><span class="linenos">425</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-426"><a href="#Expression-426"><span class="linenos">426</span></a> +</span><span id="Expression-427"><a href="#Expression-427"><span class="linenos">427</span></a> <span class="k">while</span> <span class="n">queue</span><span class="p">:</span> +</span><span id="Expression-428"><a href="#Expression-428"><span class="linenos">428</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-429"><a href="#Expression-429"><span class="linenos">429</span></a> -</span><span id="Expression-430"><a href="#Expression-430"><span class="linenos">430</span></a> <span class="k">while</span> <span class="n">queue</span><span class="p">:</span> -</span><span id="Expression-431"><a href="#Expression-431"><span class="linenos">431</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-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="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-434"><a href="#Expression-434"><span class="linenos">434</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-435"><a href="#Expression-435"><span class="linenos">435</span></a> <span class="k">continue</span> +</span><span id="Expression-430"><a href="#Expression-430"><span class="linenos">430</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-431"><a href="#Expression-431"><span class="linenos">431</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-432"><a href="#Expression-432"><span class="linenos">432</span></a> <span class="k">continue</span> +</span><span id="Expression-433"><a href="#Expression-433"><span class="linenos">433</span></a> +</span><span id="Expression-434"><a href="#Expression-434"><span class="linenos">434</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">iter_expressions</span><span class="p">():</span> +</span><span id="Expression-435"><a href="#Expression-435"><span class="linenos">435</span></a> <span class="n">queue</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">v</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-436"><a href="#Expression-436"><span class="linenos">436</span></a> -</span><span id="Expression-437"><a href="#Expression-437"><span class="linenos">437</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">iter_expressions</span><span class="p">():</span> -</span><span id="Expression-438"><a href="#Expression-438"><span class="linenos">438</span></a> <span class="n">queue</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">v</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-439"><a href="#Expression-439"><span class="linenos">439</span></a> -</span><span id="Expression-440"><a href="#Expression-440"><span class="linenos">440</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-441"><a href="#Expression-441"><span class="linenos">441</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-442"><a href="#Expression-442"><span class="linenos">442</span></a><span class="sd"> Returns the first non parenthesis child or self.</span> -</span><span id="Expression-443"><a href="#Expression-443"><span class="linenos">443</span></a><span class="sd"> """</span> -</span><span id="Expression-444"><a href="#Expression-444"><span class="linenos">444</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="Expression-445"><a href="#Expression-445"><span class="linenos">445</span></a> <span class="k">while</span> <span class="nb">type</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> <span class="ow">is</span> <span class="n">Paren</span><span class="p">:</span> -</span><span id="Expression-446"><a href="#Expression-446"><span class="linenos">446</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-447"><a href="#Expression-447"><span class="linenos">447</span></a> <span class="k">return</span> <span class="n">expression</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="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-450"><a href="#Expression-450"><span class="linenos">450</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-451"><a href="#Expression-451"><span class="linenos">451</span></a><span class="sd"> Returns the inner expression if this is an Alias.</span> -</span><span id="Expression-452"><a href="#Expression-452"><span class="linenos">452</span></a><span class="sd"> """</span> -</span><span id="Expression-453"><a href="#Expression-453"><span class="linenos">453</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-454"><a href="#Expression-454"><span class="linenos">454</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-455"><a href="#Expression-455"><span class="linenos">455</span></a> <span class="k">return</span> <span class="bp">self</span> -</span><span id="Expression-456"><a href="#Expression-456"><span class="linenos">456</span></a> -</span><span id="Expression-457"><a href="#Expression-457"><span class="linenos">457</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-458"><a href="#Expression-458"><span class="linenos">458</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-459"><a href="#Expression-459"><span class="linenos">459</span></a><span class="sd"> Returns unnested operands as a tuple.</span> -</span><span id="Expression-460"><a href="#Expression-460"><span class="linenos">460</span></a><span class="sd"> """</span> -</span><span id="Expression-461"><a href="#Expression-461"><span class="linenos">461</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">_</span><span class="p">,</span> <span class="n">arg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">iter_expressions</span><span class="p">())</span> -</span><span id="Expression-462"><a href="#Expression-462"><span class="linenos">462</span></a> -</span><span id="Expression-463"><a href="#Expression-463"><span class="linenos">463</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-464"><a href="#Expression-464"><span class="linenos">464</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-465"><a href="#Expression-465"><span class="linenos">465</span></a><span class="sd"> Returns a generator which yields child nodes who's parents are the same class.</span> -</span><span id="Expression-466"><a href="#Expression-466"><span class="linenos">466</span></a> -</span><span id="Expression-467"><a href="#Expression-467"><span class="linenos">467</span></a><span class="sd"> A AND B AND C -> [A, B, C]</span> -</span><span id="Expression-468"><a href="#Expression-468"><span class="linenos">468</span></a><span class="sd"> """</span> -</span><span id="Expression-469"><a href="#Expression-469"><span class="linenos">469</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">type</span><span class="p">(</span><span class="n">n</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">):</span> -</span><span id="Expression-470"><a href="#Expression-470"><span class="linenos">470</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">node</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">:</span> -</span><span id="Expression-471"><a href="#Expression-471"><span class="linenos">471</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-437"><a href="#Expression-437"><span class="linenos">437</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-438"><a href="#Expression-438"><span class="linenos">438</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-439"><a href="#Expression-439"><span class="linenos">439</span></a><span class="sd"> Returns the first non parenthesis child or self.</span> +</span><span id="Expression-440"><a href="#Expression-440"><span class="linenos">440</span></a><span class="sd"> """</span> +</span><span id="Expression-441"><a href="#Expression-441"><span class="linenos">441</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="Expression-442"><a href="#Expression-442"><span class="linenos">442</span></a> <span class="k">while</span> <span class="nb">type</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> <span class="ow">is</span> <span class="n">Paren</span><span class="p">:</span> +</span><span id="Expression-443"><a href="#Expression-443"><span class="linenos">443</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-444"><a href="#Expression-444"><span class="linenos">444</span></a> <span class="k">return</span> <span class="n">expression</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">unalias</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-447"><a href="#Expression-447"><span class="linenos">447</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-448"><a href="#Expression-448"><span class="linenos">448</span></a><span class="sd"> Returns the inner expression if this is an Alias.</span> +</span><span id="Expression-449"><a href="#Expression-449"><span class="linenos">449</span></a><span class="sd"> """</span> +</span><span id="Expression-450"><a href="#Expression-450"><span class="linenos">450</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-451"><a href="#Expression-451"><span class="linenos">451</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-452"><a href="#Expression-452"><span class="linenos">452</span></a> <span class="k">return</span> <span class="bp">self</span> +</span><span id="Expression-453"><a href="#Expression-453"><span class="linenos">453</span></a> +</span><span id="Expression-454"><a href="#Expression-454"><span class="linenos">454</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-455"><a href="#Expression-455"><span class="linenos">455</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-456"><a href="#Expression-456"><span class="linenos">456</span></a><span class="sd"> Returns unnested operands as a tuple.</span> +</span><span id="Expression-457"><a href="#Expression-457"><span class="linenos">457</span></a><span class="sd"> """</span> +</span><span id="Expression-458"><a href="#Expression-458"><span class="linenos">458</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">_</span><span class="p">,</span> <span class="n">arg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">iter_expressions</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">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-461"><a href="#Expression-461"><span class="linenos">461</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-462"><a href="#Expression-462"><span class="linenos">462</span></a><span class="sd"> Returns a generator which yields child nodes who's parents are the same class.</span> +</span><span id="Expression-463"><a href="#Expression-463"><span class="linenos">463</span></a> +</span><span id="Expression-464"><a href="#Expression-464"><span class="linenos">464</span></a><span class="sd"> A AND B AND C -> [A, B, C]</span> +</span><span id="Expression-465"><a href="#Expression-465"><span class="linenos">465</span></a><span class="sd"> """</span> +</span><span id="Expression-466"><a href="#Expression-466"><span class="linenos">466</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">type</span><span class="p">(</span><span class="n">n</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">):</span> +</span><span id="Expression-467"><a href="#Expression-467"><span class="linenos">467</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">node</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">:</span> +</span><span id="Expression-468"><a href="#Expression-468"><span class="linenos">468</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-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="fm">__str__</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-471"><a href="#Expression-471"><span class="linenos">471</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-472"><a href="#Expression-472"><span class="linenos">472</span></a> -</span><span id="Expression-473"><a href="#Expression-473"><span class="linenos">473</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Expression-474"><a href="#Expression-474"><span class="linenos">474</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-473"><a href="#Expression-473"><span class="linenos">473</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Expression-474"><a href="#Expression-474"><span class="linenos">474</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-475"><a href="#Expression-475"><span class="linenos">475</span></a> -</span><span id="Expression-476"><a href="#Expression-476"><span class="linenos">476</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Expression-477"><a href="#Expression-477"><span class="linenos">477</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-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="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-480"><a href="#Expression-480"><span class="linenos">480</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-481"><a href="#Expression-481"><span class="linenos">481</span></a><span class="sd"> Returns SQL string representation of this tree.</span> -</span><span id="Expression-482"><a href="#Expression-482"><span class="linenos">482</span></a> -</span><span id="Expression-483"><a href="#Expression-483"><span class="linenos">483</span></a><span class="sd"> Args:</span> -</span><span id="Expression-484"><a href="#Expression-484"><span class="linenos">484</span></a><span class="sd"> dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").</span> -</span><span id="Expression-485"><a href="#Expression-485"><span class="linenos">485</span></a><span class="sd"> opts: other `sqlglot.generator.Generator` options.</span> -</span><span id="Expression-486"><a href="#Expression-486"><span class="linenos">486</span></a> -</span><span id="Expression-487"><a href="#Expression-487"><span class="linenos">487</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-488"><a href="#Expression-488"><span class="linenos">488</span></a><span class="sd"> The SQL string.</span> -</span><span id="Expression-489"><a href="#Expression-489"><span class="linenos">489</span></a><span class="sd"> """</span> -</span><span id="Expression-490"><a href="#Expression-490"><span class="linenos">490</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-491"><a href="#Expression-491"><span class="linenos">491</span></a> -</span><span id="Expression-492"><a href="#Expression-492"><span class="linenos">492</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-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="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-495"><a href="#Expression-495"><span class="linenos">495</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-496"><a href="#Expression-496"><span class="linenos">496</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-497"><a href="#Expression-497"><span class="linenos">497</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-498"><a href="#Expression-498"><span class="linenos">498</span></a> -</span><span id="Expression-499"><a href="#Expression-499"><span class="linenos">499</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-500"><a href="#Expression-500"><span class="linenos">500</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-501"><a href="#Expression-501"><span class="linenos">501</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-502"><a href="#Expression-502"><span class="linenos">502</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-503"><a href="#Expression-503"><span class="linenos">503</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-504"><a href="#Expression-504"><span class="linenos">504</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">ensure_list</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> -</span><span id="Expression-505"><a href="#Expression-505"><span class="linenos">505</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-506"><a href="#Expression-506"><span class="linenos">506</span></a> <span class="p">)</span> -</span><span id="Expression-507"><a href="#Expression-507"><span class="linenos">507</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-508"><a href="#Expression-508"><span class="linenos">508</span></a> <span class="p">}</span> -</span><span id="Expression-509"><a href="#Expression-509"><span class="linenos">509</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-510"><a href="#Expression-510"><span class="linenos">510</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-511"><a href="#Expression-511"><span class="linenos">511</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-476"><a href="#Expression-476"><span class="linenos">476</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-477"><a href="#Expression-477"><span class="linenos">477</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-478"><a href="#Expression-478"><span class="linenos">478</span></a><span class="sd"> Returns SQL string representation of this tree.</span> +</span><span id="Expression-479"><a href="#Expression-479"><span class="linenos">479</span></a> +</span><span id="Expression-480"><a href="#Expression-480"><span class="linenos">480</span></a><span class="sd"> Args:</span> +</span><span id="Expression-481"><a href="#Expression-481"><span class="linenos">481</span></a><span class="sd"> dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").</span> +</span><span id="Expression-482"><a href="#Expression-482"><span class="linenos">482</span></a><span class="sd"> opts: other `sqlglot.generator.Generator` options.</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="sd"> Returns:</span> +</span><span id="Expression-485"><a href="#Expression-485"><span class="linenos">485</span></a><span class="sd"> The SQL string.</span> +</span><span id="Expression-486"><a href="#Expression-486"><span class="linenos">486</span></a><span class="sd"> """</span> +</span><span id="Expression-487"><a href="#Expression-487"><span class="linenos">487</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-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="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-490"><a href="#Expression-490"><span class="linenos">490</span></a> +</span><span id="Expression-491"><a href="#Expression-491"><span class="linenos">491</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-492"><a href="#Expression-492"><span class="linenos">492</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-493"><a href="#Expression-493"><span class="linenos">493</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-494"><a href="#Expression-494"><span class="linenos">494</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-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="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-497"><a href="#Expression-497"><span class="linenos">497</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-498"><a href="#Expression-498"><span class="linenos">498</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-499"><a href="#Expression-499"><span class="linenos">499</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-500"><a href="#Expression-500"><span class="linenos">500</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-501"><a href="#Expression-501"><span class="linenos">501</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">ensure_list</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> +</span><span id="Expression-502"><a href="#Expression-502"><span class="linenos">502</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-503"><a href="#Expression-503"><span class="linenos">503</span></a> <span class="p">)</span> +</span><span id="Expression-504"><a href="#Expression-504"><span class="linenos">504</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-505"><a href="#Expression-505"><span class="linenos">505</span></a> <span class="p">}</span> +</span><span id="Expression-506"><a href="#Expression-506"><span class="linenos">506</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-507"><a href="#Expression-507"><span class="linenos">507</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-508"><a href="#Expression-508"><span class="linenos">508</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-509"><a href="#Expression-509"><span class="linenos">509</span></a> +</span><span id="Expression-510"><a href="#Expression-510"><span class="linenos">510</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-511"><a href="#Expression-511"><span class="linenos">511</span></a> <span class="n">right</span> <span class="o">+=</span> <span class="s2">")"</span> </span><span id="Expression-512"><a href="#Expression-512"><span class="linenos">512</span></a> -</span><span id="Expression-513"><a href="#Expression-513"><span class="linenos">513</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-514"><a href="#Expression-514"><span class="linenos">514</span></a> <span class="n">right</span> <span class="o">+=</span> <span class="s2">")"</span> -</span><span id="Expression-515"><a href="#Expression-515"><span class="linenos">515</span></a> -</span><span id="Expression-516"><a href="#Expression-516"><span class="linenos">516</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-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="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-519"><a href="#Expression-519"><span class="linenos">519</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-520"><a href="#Expression-520"><span class="linenos">520</span></a><span class="sd"> Recursively visits all tree nodes (excluding already transformed ones)</span> -</span><span id="Expression-521"><a href="#Expression-521"><span class="linenos">521</span></a><span class="sd"> and applies the given transformation function to each node.</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"> fun (function): a function which takes a node as an argument and returns a</span> -</span><span id="Expression-525"><a href="#Expression-525"><span class="linenos">525</span></a><span class="sd"> new transformed node or the same node without modifications. If the function</span> -</span><span id="Expression-526"><a href="#Expression-526"><span class="linenos">526</span></a><span class="sd"> returns None, then the corresponding node will be removed from the syntax tree.</span> -</span><span id="Expression-527"><a href="#Expression-527"><span class="linenos">527</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-528"><a href="#Expression-528"><span class="linenos">528</span></a><span class="sd"> modified in place.</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="sd"> Returns:</span> -</span><span id="Expression-531"><a href="#Expression-531"><span class="linenos">531</span></a><span class="sd"> The transformed tree.</span> -</span><span id="Expression-532"><a href="#Expression-532"><span class="linenos">532</span></a><span class="sd"> """</span> -</span><span id="Expression-533"><a href="#Expression-533"><span class="linenos">533</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-534"><a href="#Expression-534"><span class="linenos">534</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-535"><a href="#Expression-535"><span class="linenos">535</span></a> -</span><span id="Expression-536"><a href="#Expression-536"><span class="linenos">536</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-513"><a href="#Expression-513"><span class="linenos">513</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-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="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-516"><a href="#Expression-516"><span class="linenos">516</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-517"><a href="#Expression-517"><span class="linenos">517</span></a><span class="sd"> Recursively visits all tree nodes (excluding already transformed ones)</span> +</span><span id="Expression-518"><a href="#Expression-518"><span class="linenos">518</span></a><span class="sd"> and applies the given transformation function to each node.</span> +</span><span id="Expression-519"><a href="#Expression-519"><span class="linenos">519</span></a> +</span><span id="Expression-520"><a href="#Expression-520"><span class="linenos">520</span></a><span class="sd"> Args:</span> +</span><span id="Expression-521"><a href="#Expression-521"><span class="linenos">521</span></a><span class="sd"> fun (function): a function which takes a node as an argument and returns a</span> +</span><span id="Expression-522"><a href="#Expression-522"><span class="linenos">522</span></a><span class="sd"> new transformed node or the same node without modifications. If the function</span> +</span><span id="Expression-523"><a href="#Expression-523"><span class="linenos">523</span></a><span class="sd"> returns None, then the corresponding node will be removed from the syntax tree.</span> +</span><span id="Expression-524"><a href="#Expression-524"><span class="linenos">524</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-525"><a href="#Expression-525"><span class="linenos">525</span></a><span class="sd"> modified in place.</span> +</span><span id="Expression-526"><a href="#Expression-526"><span class="linenos">526</span></a> +</span><span id="Expression-527"><a href="#Expression-527"><span class="linenos">527</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-528"><a href="#Expression-528"><span class="linenos">528</span></a><span class="sd"> The transformed tree.</span> +</span><span id="Expression-529"><a href="#Expression-529"><span class="linenos">529</span></a><span class="sd"> """</span> +</span><span id="Expression-530"><a href="#Expression-530"><span class="linenos">530</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-531"><a href="#Expression-531"><span class="linenos">531</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-532"><a href="#Expression-532"><span class="linenos">532</span></a> +</span><span id="Expression-533"><a href="#Expression-533"><span class="linenos">533</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-534"><a href="#Expression-534"><span class="linenos">534</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="Expression-535"><a href="#Expression-535"><span class="linenos">535</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-536"><a href="#Expression-536"><span class="linenos">536</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-537"><a href="#Expression-537"><span class="linenos">537</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="Expression-538"><a href="#Expression-538"><span class="linenos">538</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-539"><a href="#Expression-539"><span class="linenos">539</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-540"><a href="#Expression-540"><span class="linenos">540</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="Expression-538"><a href="#Expression-538"><span class="linenos">538</span></a> +</span><span id="Expression-539"><a href="#Expression-539"><span class="linenos">539</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-540"><a href="#Expression-540"><span class="linenos">540</span></a> <span class="k">return</span> <span class="n">new_node</span> </span><span id="Expression-541"><a href="#Expression-541"><span class="linenos">541</span></a> -</span><span id="Expression-542"><a href="#Expression-542"><span class="linenos">542</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-543"><a href="#Expression-543"><span class="linenos">543</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="Expression-544"><a href="#Expression-544"><span class="linenos">544</span></a> -</span><span id="Expression-545"><a href="#Expression-545"><span class="linenos">545</span></a> <span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="Expression-546"><a href="#Expression-546"><span class="linenos">546</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 class="n">E</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> -</span><span id="Expression-547"><a href="#Expression-547"><span class="linenos">547</span></a> <span class="o">...</span> -</span><span id="Expression-548"><a href="#Expression-548"><span class="linenos">548</span></a> -</span><span id="Expression-549"><a href="#Expression-549"><span class="linenos">549</span></a> <span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="Expression-550"><a href="#Expression-550"><span class="linenos">550</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 class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> -</span><span id="Expression-551"><a href="#Expression-551"><span class="linenos">551</span></a> <span class="o">...</span> -</span><span id="Expression-552"><a href="#Expression-552"><span class="linenos">552</span></a> -</span><span id="Expression-553"><a href="#Expression-553"><span class="linenos">553</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-554"><a href="#Expression-554"><span class="linenos">554</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-555"><a href="#Expression-555"><span class="linenos">555</span></a><span class="sd"> Swap out this expression with a new expression.</span> -</span><span id="Expression-556"><a href="#Expression-556"><span class="linenos">556</span></a> -</span><span id="Expression-557"><a href="#Expression-557"><span class="linenos">557</span></a><span class="sd"> For example::</span> -</span><span id="Expression-558"><a href="#Expression-558"><span class="linenos">558</span></a> -</span><span id="Expression-559"><a href="#Expression-559"><span class="linenos">559</span></a><span class="sd"> >>> tree = Select().select("x").from_("tbl")</span> -</span><span id="Expression-560"><a href="#Expression-560"><span class="linenos">560</span></a><span class="sd"> >>> tree.find(Column).replace(Column(this="y"))</span> -</span><span id="Expression-561"><a href="#Expression-561"><span class="linenos">561</span></a><span class="sd"> (COLUMN this: y)</span> -</span><span id="Expression-562"><a href="#Expression-562"><span class="linenos">562</span></a><span class="sd"> >>> tree.sql()</span> -</span><span id="Expression-563"><a href="#Expression-563"><span class="linenos">563</span></a><span class="sd"> 'SELECT y FROM tbl'</span> +</span><span id="Expression-542"><a href="#Expression-542"><span class="linenos">542</span></a> <span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> +</span><span id="Expression-543"><a href="#Expression-543"><span class="linenos">543</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 class="n">E</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="Expression-544"><a href="#Expression-544"><span class="linenos">544</span></a> <span class="o">...</span> +</span><span id="Expression-545"><a href="#Expression-545"><span class="linenos">545</span></a> +</span><span id="Expression-546"><a href="#Expression-546"><span class="linenos">546</span></a> <span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> +</span><span id="Expression-547"><a href="#Expression-547"><span class="linenos">547</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 class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> +</span><span id="Expression-548"><a href="#Expression-548"><span class="linenos">548</span></a> <span class="o">...</span> +</span><span id="Expression-549"><a href="#Expression-549"><span class="linenos">549</span></a> +</span><span id="Expression-550"><a href="#Expression-550"><span class="linenos">550</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-551"><a href="#Expression-551"><span class="linenos">551</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-552"><a href="#Expression-552"><span class="linenos">552</span></a><span class="sd"> Swap out this expression with a new expression.</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"> For example::</span> +</span><span id="Expression-555"><a href="#Expression-555"><span class="linenos">555</span></a> +</span><span id="Expression-556"><a href="#Expression-556"><span class="linenos">556</span></a><span class="sd"> >>> tree = Select().select("x").from_("tbl")</span> +</span><span id="Expression-557"><a href="#Expression-557"><span class="linenos">557</span></a><span class="sd"> >>> tree.find(Column).replace(Column(this="y"))</span> +</span><span id="Expression-558"><a href="#Expression-558"><span class="linenos">558</span></a><span class="sd"> (COLUMN this: y)</span> +</span><span id="Expression-559"><a href="#Expression-559"><span class="linenos">559</span></a><span class="sd"> >>> tree.sql()</span> +</span><span id="Expression-560"><a href="#Expression-560"><span class="linenos">560</span></a><span class="sd"> 'SELECT y FROM tbl'</span> +</span><span id="Expression-561"><a href="#Expression-561"><span class="linenos">561</span></a> +</span><span id="Expression-562"><a href="#Expression-562"><span class="linenos">562</span></a><span class="sd"> Args:</span> +</span><span id="Expression-563"><a href="#Expression-563"><span class="linenos">563</span></a><span class="sd"> expression: new node</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"> expression: new node</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="sd"> Returns:</span> -</span><span id="Expression-569"><a href="#Expression-569"><span class="linenos">569</span></a><span class="sd"> The new expression or expressions.</span> -</span><span id="Expression-570"><a href="#Expression-570"><span class="linenos">570</span></a><span class="sd"> """</span> -</span><span id="Expression-571"><a href="#Expression-571"><span class="linenos">571</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-572"><a href="#Expression-572"><span class="linenos">572</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="Expression-565"><a href="#Expression-565"><span class="linenos">565</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-566"><a href="#Expression-566"><span class="linenos">566</span></a><span class="sd"> The new expression or expressions.</span> +</span><span id="Expression-567"><a href="#Expression-567"><span class="linenos">567</span></a><span class="sd"> """</span> +</span><span id="Expression-568"><a href="#Expression-568"><span class="linenos">568</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-569"><a href="#Expression-569"><span class="linenos">569</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="Expression-570"><a href="#Expression-570"><span class="linenos">570</span></a> +</span><span id="Expression-571"><a href="#Expression-571"><span class="linenos">571</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-572"><a href="#Expression-572"><span class="linenos">572</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-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="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-575"><a href="#Expression-575"><span class="linenos">575</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-574"><a href="#Expression-574"><span class="linenos">574</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-575"><a href="#Expression-575"><span class="linenos">575</span></a> <span class="k">return</span> <span class="n">expression</span> </span><span id="Expression-576"><a href="#Expression-576"><span class="linenos">576</span></a> -</span><span id="Expression-577"><a href="#Expression-577"><span class="linenos">577</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-578"><a href="#Expression-578"><span class="linenos">578</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="Expression-579"><a href="#Expression-579"><span class="linenos">579</span></a> -</span><span id="Expression-580"><a href="#Expression-580"><span class="linenos">580</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 class="n">E</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> -</span><span id="Expression-581"><a href="#Expression-581"><span class="linenos">581</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-582"><a href="#Expression-582"><span class="linenos">582</span></a><span class="sd"> Remove this expression from its AST.</span> -</span><span id="Expression-583"><a href="#Expression-583"><span class="linenos">583</span></a> -</span><span id="Expression-584"><a href="#Expression-584"><span class="linenos">584</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-585"><a href="#Expression-585"><span class="linenos">585</span></a><span class="sd"> The popped expression.</span> -</span><span id="Expression-586"><a href="#Expression-586"><span class="linenos">586</span></a><span class="sd"> """</span> -</span><span id="Expression-587"><a href="#Expression-587"><span class="linenos">587</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-588"><a href="#Expression-588"><span class="linenos">588</span></a> <span class="k">return</span> <span class="bp">self</span> -</span><span id="Expression-589"><a href="#Expression-589"><span class="linenos">589</span></a> -</span><span id="Expression-590"><a href="#Expression-590"><span class="linenos">590</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 class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">])</span> <span class="o">-></span> <span class="n">E</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"> Assert that this `Expression` is an instance of `type_`.</span> +</span><span id="Expression-577"><a href="#Expression-577"><span class="linenos">577</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 class="n">E</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="Expression-578"><a href="#Expression-578"><span class="linenos">578</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-579"><a href="#Expression-579"><span class="linenos">579</span></a><span class="sd"> Remove this expression from its AST.</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="sd"> Returns:</span> +</span><span id="Expression-582"><a href="#Expression-582"><span class="linenos">582</span></a><span class="sd"> The popped expression.</span> +</span><span id="Expression-583"><a href="#Expression-583"><span class="linenos">583</span></a><span class="sd"> """</span> +</span><span id="Expression-584"><a href="#Expression-584"><span class="linenos">584</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-585"><a href="#Expression-585"><span class="linenos">585</span></a> <span class="k">return</span> <span class="bp">self</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">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 class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">])</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="Expression-588"><a href="#Expression-588"><span class="linenos">588</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-589"><a href="#Expression-589"><span class="linenos">589</span></a><span class="sd"> Assert that this `Expression` is an instance of `type_`.</span> +</span><span id="Expression-590"><a href="#Expression-590"><span class="linenos">590</span></a> +</span><span id="Expression-591"><a href="#Expression-591"><span class="linenos">591</span></a><span class="sd"> If it is NOT an instance of `type_`, this raises an assertion error.</span> +</span><span id="Expression-592"><a href="#Expression-592"><span class="linenos">592</span></a><span class="sd"> Otherwise, this returns this expression.</span> </span><span id="Expression-593"><a href="#Expression-593"><span class="linenos">593</span></a> -</span><span id="Expression-594"><a href="#Expression-594"><span class="linenos">594</span></a><span class="sd"> If it is NOT an instance of `type_`, this raises an assertion error.</span> -</span><span id="Expression-595"><a href="#Expression-595"><span class="linenos">595</span></a><span class="sd"> Otherwise, this returns this expression.</span> +</span><span id="Expression-594"><a href="#Expression-594"><span class="linenos">594</span></a><span class="sd"> Examples:</span> +</span><span id="Expression-595"><a href="#Expression-595"><span class="linenos">595</span></a><span class="sd"> This is useful for type security in chained expressions:</span> </span><span id="Expression-596"><a href="#Expression-596"><span class="linenos">596</span></a> -</span><span id="Expression-597"><a href="#Expression-597"><span class="linenos">597</span></a><span class="sd"> Examples:</span> -</span><span id="Expression-598"><a href="#Expression-598"><span class="linenos">598</span></a><span class="sd"> This is useful for type security in chained expressions:</span> -</span><span id="Expression-599"><a href="#Expression-599"><span class="linenos">599</span></a> -</span><span id="Expression-600"><a href="#Expression-600"><span class="linenos">600</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Expression-601"><a href="#Expression-601"><span class="linenos">601</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()</span> -</span><span id="Expression-602"><a href="#Expression-602"><span class="linenos">602</span></a><span class="sd"> 'SELECT x, z FROM y'</span> -</span><span id="Expression-603"><a href="#Expression-603"><span class="linenos">603</span></a><span class="sd"> """</span> -</span><span id="Expression-604"><a href="#Expression-604"><span class="linenos">604</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-605"><a href="#Expression-605"><span class="linenos">605</span></a> <span class="k">return</span> <span class="bp">self</span> -</span><span id="Expression-606"><a href="#Expression-606"><span class="linenos">606</span></a> -</span><span id="Expression-607"><a href="#Expression-607"><span class="linenos">607</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-608"><a href="#Expression-608"><span class="linenos">608</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-609"><a href="#Expression-609"><span class="linenos">609</span></a><span class="sd"> Checks if this expression is valid (e.g. all mandatory args are set).</span> -</span><span id="Expression-610"><a href="#Expression-610"><span class="linenos">610</span></a> -</span><span id="Expression-611"><a href="#Expression-611"><span class="linenos">611</span></a><span class="sd"> Args:</span> -</span><span id="Expression-612"><a href="#Expression-612"><span class="linenos">612</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-613"><a href="#Expression-613"><span class="linenos">613</span></a><span class="sd"> to check that the provided arguments don't exceed the function argument limit.</span> -</span><span id="Expression-614"><a href="#Expression-614"><span class="linenos">614</span></a> -</span><span id="Expression-615"><a href="#Expression-615"><span class="linenos">615</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-616"><a href="#Expression-616"><span class="linenos">616</span></a><span class="sd"> A list of error messages for all possible errors that were found.</span> -</span><span id="Expression-617"><a href="#Expression-617"><span class="linenos">617</span></a><span class="sd"> """</span> -</span><span id="Expression-618"><a href="#Expression-618"><span class="linenos">618</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-619"><a href="#Expression-619"><span class="linenos">619</span></a> -</span><span id="Expression-620"><a href="#Expression-620"><span class="linenos">620</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-621"><a href="#Expression-621"><span class="linenos">621</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-622"><a href="#Expression-622"><span class="linenos">622</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-623"><a href="#Expression-623"><span class="linenos">623</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-624"><a href="#Expression-624"><span class="linenos">624</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-625"><a href="#Expression-625"><span class="linenos">625</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-626"><a href="#Expression-626"><span class="linenos">626</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-627"><a href="#Expression-627"><span class="linenos">627</span></a> -</span><span id="Expression-628"><a href="#Expression-628"><span class="linenos">628</span></a> <span class="k">if</span> <span class="p">(</span> -</span><span id="Expression-629"><a href="#Expression-629"><span class="linenos">629</span></a> <span class="n">args</span> -</span><span id="Expression-630"><a href="#Expression-630"><span class="linenos">630</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-631"><a href="#Expression-631"><span class="linenos">631</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-632"><a href="#Expression-632"><span class="linenos">632</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-633"><a href="#Expression-633"><span class="linenos">633</span></a> <span class="p">):</span> -</span><span id="Expression-634"><a href="#Expression-634"><span class="linenos">634</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> -</span><span id="Expression-635"><a href="#Expression-635"><span class="linenos">635</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-636"><a href="#Expression-636"><span class="linenos">636</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-637"><a href="#Expression-637"><span class="linenos">637</span></a> <span class="p">)</span> -</span><span id="Expression-638"><a href="#Expression-638"><span class="linenos">638</span></a> -</span><span id="Expression-639"><a href="#Expression-639"><span class="linenos">639</span></a> <span class="k">return</span> <span class="n">errors</span> -</span><span id="Expression-640"><a href="#Expression-640"><span class="linenos">640</span></a> -</span><span id="Expression-641"><a href="#Expression-641"><span class="linenos">641</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-642"><a href="#Expression-642"><span class="linenos">642</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-643"><a href="#Expression-643"><span class="linenos">643</span></a><span class="sd"> Dump this Expression to a JSON-serializable dict.</span> -</span><span id="Expression-644"><a href="#Expression-644"><span class="linenos">644</span></a><span class="sd"> """</span> -</span><span id="Expression-645"><a href="#Expression-645"><span class="linenos">645</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-646"><a href="#Expression-646"><span class="linenos">646</span></a> -</span><span id="Expression-647"><a href="#Expression-647"><span class="linenos">647</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-648"><a href="#Expression-648"><span class="linenos">648</span></a> -</span><span id="Expression-649"><a href="#Expression-649"><span class="linenos">649</span></a> <span class="nd">@classmethod</span> -</span><span id="Expression-650"><a href="#Expression-650"><span class="linenos">650</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-651"><a href="#Expression-651"><span class="linenos">651</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-652"><a href="#Expression-652"><span class="linenos">652</span></a><span class="sd"> Load a dict (as returned by `Expression.dump`) into an Expression instance.</span> -</span><span id="Expression-653"><a href="#Expression-653"><span class="linenos">653</span></a><span class="sd"> """</span> -</span><span id="Expression-654"><a href="#Expression-654"><span class="linenos">654</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-655"><a href="#Expression-655"><span class="linenos">655</span></a> -</span><span id="Expression-656"><a href="#Expression-656"><span class="linenos">656</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-597"><a href="#Expression-597"><span class="linenos">597</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Expression-598"><a href="#Expression-598"><span class="linenos">598</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()</span> +</span><span id="Expression-599"><a href="#Expression-599"><span class="linenos">599</span></a><span class="sd"> 'SELECT x, z FROM y'</span> +</span><span id="Expression-600"><a href="#Expression-600"><span class="linenos">600</span></a><span class="sd"> """</span> +</span><span id="Expression-601"><a href="#Expression-601"><span class="linenos">601</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-602"><a href="#Expression-602"><span class="linenos">602</span></a> <span class="k">return</span> <span class="bp">self</span> +</span><span id="Expression-603"><a href="#Expression-603"><span class="linenos">603</span></a> +</span><span id="Expression-604"><a href="#Expression-604"><span class="linenos">604</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-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"> Checks if this expression is valid (e.g. all mandatory args are set).</span> +</span><span id="Expression-607"><a href="#Expression-607"><span class="linenos">607</span></a> +</span><span id="Expression-608"><a href="#Expression-608"><span class="linenos">608</span></a><span class="sd"> Args:</span> +</span><span id="Expression-609"><a href="#Expression-609"><span class="linenos">609</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-610"><a href="#Expression-610"><span class="linenos">610</span></a><span class="sd"> to check that the provided arguments don't exceed the function argument limit.</span> +</span><span id="Expression-611"><a href="#Expression-611"><span class="linenos">611</span></a> +</span><span id="Expression-612"><a href="#Expression-612"><span class="linenos">612</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-613"><a href="#Expression-613"><span class="linenos">613</span></a><span class="sd"> A list of error messages for all possible errors that were found.</span> +</span><span id="Expression-614"><a href="#Expression-614"><span class="linenos">614</span></a><span class="sd"> """</span> +</span><span id="Expression-615"><a href="#Expression-615"><span class="linenos">615</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-616"><a href="#Expression-616"><span class="linenos">616</span></a> +</span><span id="Expression-617"><a href="#Expression-617"><span class="linenos">617</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-618"><a href="#Expression-618"><span class="linenos">618</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-619"><a href="#Expression-619"><span class="linenos">619</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-620"><a href="#Expression-620"><span class="linenos">620</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-621"><a href="#Expression-621"><span class="linenos">621</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-622"><a href="#Expression-622"><span class="linenos">622</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-623"><a href="#Expression-623"><span class="linenos">623</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-624"><a href="#Expression-624"><span class="linenos">624</span></a> +</span><span id="Expression-625"><a href="#Expression-625"><span class="linenos">625</span></a> <span class="k">if</span> <span class="p">(</span> +</span><span id="Expression-626"><a href="#Expression-626"><span class="linenos">626</span></a> <span class="n">args</span> +</span><span id="Expression-627"><a href="#Expression-627"><span class="linenos">627</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-628"><a href="#Expression-628"><span class="linenos">628</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-629"><a href="#Expression-629"><span class="linenos">629</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-630"><a href="#Expression-630"><span class="linenos">630</span></a> <span class="p">):</span> +</span><span id="Expression-631"><a href="#Expression-631"><span class="linenos">631</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> +</span><span id="Expression-632"><a href="#Expression-632"><span class="linenos">632</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-633"><a href="#Expression-633"><span class="linenos">633</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-634"><a href="#Expression-634"><span class="linenos">634</span></a> <span class="p">)</span> +</span><span id="Expression-635"><a href="#Expression-635"><span class="linenos">635</span></a> +</span><span id="Expression-636"><a href="#Expression-636"><span class="linenos">636</span></a> <span class="k">return</span> <span class="n">errors</span> +</span><span id="Expression-637"><a href="#Expression-637"><span class="linenos">637</span></a> +</span><span id="Expression-638"><a href="#Expression-638"><span class="linenos">638</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-639"><a href="#Expression-639"><span class="linenos">639</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-640"><a href="#Expression-640"><span class="linenos">640</span></a><span class="sd"> Dump this Expression to a JSON-serializable dict.</span> +</span><span id="Expression-641"><a href="#Expression-641"><span class="linenos">641</span></a><span class="sd"> """</span> +</span><span id="Expression-642"><a href="#Expression-642"><span class="linenos">642</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-643"><a href="#Expression-643"><span class="linenos">643</span></a> +</span><span id="Expression-644"><a href="#Expression-644"><span class="linenos">644</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-645"><a href="#Expression-645"><span class="linenos">645</span></a> +</span><span id="Expression-646"><a href="#Expression-646"><span class="linenos">646</span></a> <span class="nd">@classmethod</span> +</span><span id="Expression-647"><a href="#Expression-647"><span class="linenos">647</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-648"><a href="#Expression-648"><span class="linenos">648</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-649"><a href="#Expression-649"><span class="linenos">649</span></a><span class="sd"> Load a dict (as returned by `Expression.dump`) into an Expression instance.</span> +</span><span id="Expression-650"><a href="#Expression-650"><span class="linenos">650</span></a><span class="sd"> """</span> +</span><span id="Expression-651"><a href="#Expression-651"><span class="linenos">651</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-652"><a href="#Expression-652"><span class="linenos">652</span></a> +</span><span id="Expression-653"><a href="#Expression-653"><span class="linenos">653</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> @@ -12401,19 +12410,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-142"><a href="#Expression.text-142"><span class="linenos">142</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-143"><a href="#Expression.text-143"><span class="linenos">143</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.text-144"><a href="#Expression.text-144"><span class="linenos">144</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-145"><a href="#Expression.text-145"><span class="linenos">145</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-146"><a href="#Expression.text-146"><span class="linenos">146</span></a><span class="sd"> """</span> -</span><span id="Expression.text-147"><a href="#Expression.text-147"><span class="linenos">147</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-148"><a href="#Expression.text-148"><span class="linenos">148</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-149"><a href="#Expression.text-149"><span class="linenos">149</span></a> <span class="k">return</span> <span class="n">field</span> -</span><span id="Expression.text-150"><a href="#Expression.text-150"><span class="linenos">150</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-151"><a href="#Expression.text-151"><span class="linenos">151</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-152"><a href="#Expression.text-152"><span class="linenos">152</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-153"><a href="#Expression.text-153"><span class="linenos">153</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-154"><a href="#Expression.text-154"><span class="linenos">154</span></a> <span class="k">return</span> <span class="s2">""</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.text-139"><a href="#Expression.text-139"><span class="linenos">139</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-140"><a href="#Expression.text-140"><span class="linenos">140</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.text-141"><a href="#Expression.text-141"><span class="linenos">141</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-142"><a href="#Expression.text-142"><span class="linenos">142</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-143"><a href="#Expression.text-143"><span class="linenos">143</span></a><span class="sd"> """</span> +</span><span id="Expression.text-144"><a href="#Expression.text-144"><span class="linenos">144</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-145"><a href="#Expression.text-145"><span class="linenos">145</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-146"><a href="#Expression.text-146"><span class="linenos">146</span></a> <span class="k">return</span> <span class="n">field</span> +</span><span id="Expression.text-147"><a href="#Expression.text-147"><span class="linenos">147</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-148"><a href="#Expression.text-148"><span class="linenos">148</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-149"><a href="#Expression.text-149"><span class="linenos">149</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-150"><a href="#Expression.text-150"><span class="linenos">150</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-151"><a href="#Expression.text-151"><span class="linenos">151</span></a> <span class="k">return</span> <span class="s2">""</span> </span></pre></div> @@ -12573,13 +12582,13 @@ 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-252"><a href="#Expression.copy-252"><span class="linenos">252</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-253"><a href="#Expression.copy-253"><span class="linenos">253</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.copy-254"><a href="#Expression.copy-254"><span class="linenos">254</span></a><span class="sd"> Returns a deep copy of the expression.</span> -</span><span id="Expression.copy-255"><a href="#Expression.copy-255"><span class="linenos">255</span></a><span class="sd"> """</span> -</span><span id="Expression.copy-256"><a href="#Expression.copy-256"><span class="linenos">256</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-257"><a href="#Expression.copy-257"><span class="linenos">257</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-258"><a href="#Expression.copy-258"><span class="linenos">258</span></a> <span class="k">return</span> <span class="n">new</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.copy-249"><a href="#Expression.copy-249"><span class="linenos">249</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-250"><a href="#Expression.copy-250"><span class="linenos">250</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.copy-251"><a href="#Expression.copy-251"><span class="linenos">251</span></a><span class="sd"> Returns a deep copy of the expression.</span> +</span><span id="Expression.copy-252"><a href="#Expression.copy-252"><span class="linenos">252</span></a><span class="sd"> """</span> +</span><span id="Expression.copy-253"><a href="#Expression.copy-253"><span class="linenos">253</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-254"><a href="#Expression.copy-254"><span class="linenos">254</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-255"><a href="#Expression.copy-255"><span class="linenos">255</span></a> <span class="k">return</span> <span class="n">new</span> </span></pre></div> @@ -12599,11 +12608,11 @@ for args that are strings or leaf Expression instances, such as identifiers and </div> <a class="headerlink" href="#Expression.add_comments"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.add_comments-260"><a href="#Expression.add_comments-260"><span class="linenos">260</span></a> <span class="k">def</span> <span class="nf">add_comments</span><span class="p">(</span><span class="bp">self</span><span class="p">,</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 class="p">:</span> -</span><span id="Expression.add_comments-261"><a href="#Expression.add_comments-261"><span class="linenos">261</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="kc">None</span><span class="p">:</span> -</span><span id="Expression.add_comments-262"><a href="#Expression.add_comments-262"><span class="linenos">262</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="Expression.add_comments-263"><a href="#Expression.add_comments-263"><span class="linenos">263</span></a> <span class="k">if</span> <span class="n">comments</span><span class="p">:</span> -</span><span id="Expression.add_comments-264"><a href="#Expression.add_comments-264"><span class="linenos">264</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">comments</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.add_comments-257"><a href="#Expression.add_comments-257"><span class="linenos">257</span></a> <span class="k">def</span> <span class="nf">add_comments</span><span class="p">(</span><span class="bp">self</span><span class="p">,</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 class="p">:</span> +</span><span id="Expression.add_comments-258"><a href="#Expression.add_comments-258"><span class="linenos">258</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="kc">None</span><span class="p">:</span> +</span><span id="Expression.add_comments-259"><a href="#Expression.add_comments-259"><span class="linenos">259</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="Expression.add_comments-260"><a href="#Expression.add_comments-260"><span class="linenos">260</span></a> <span class="k">if</span> <span class="n">comments</span><span class="p">:</span> +</span><span id="Expression.add_comments-261"><a href="#Expression.add_comments-261"><span class="linenos">261</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">comments</span><span class="p">)</span> </span></pre></div> @@ -12621,18 +12630,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-266"><a href="#Expression.append-266"><span class="linenos">266</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> -</span><span id="Expression.append-267"><a href="#Expression.append-267"><span class="linenos">267</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.append-268"><a href="#Expression.append-268"><span class="linenos">268</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-269"><a href="#Expression.append-269"><span class="linenos">269</span></a> -</span><span id="Expression.append-270"><a href="#Expression.append-270"><span class="linenos">270</span></a><span class="sd"> Args:</span> -</span><span id="Expression.append-271"><a href="#Expression.append-271"><span class="linenos">271</span></a><span class="sd"> arg_key (str): name of the list expression arg</span> -</span><span id="Expression.append-272"><a href="#Expression.append-272"><span class="linenos">272</span></a><span class="sd"> value (Any): value to append to the list</span> -</span><span id="Expression.append-273"><a href="#Expression.append-273"><span class="linenos">273</span></a><span class="sd"> """</span> -</span><span id="Expression.append-274"><a href="#Expression.append-274"><span class="linenos">274</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-275"><a href="#Expression.append-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="p">[]</span> -</span><span id="Expression.append-276"><a href="#Expression.append-276"><span class="linenos">276</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-277"><a href="#Expression.append-277"><span class="linenos">277</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-263"><a href="#Expression.append-263"><span class="linenos">263</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> +</span><span id="Expression.append-264"><a href="#Expression.append-264"><span class="linenos">264</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.append-265"><a href="#Expression.append-265"><span class="linenos">265</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-266"><a href="#Expression.append-266"><span class="linenos">266</span></a> +</span><span id="Expression.append-267"><a href="#Expression.append-267"><span class="linenos">267</span></a><span class="sd"> Args:</span> +</span><span id="Expression.append-268"><a href="#Expression.append-268"><span class="linenos">268</span></a><span class="sd"> arg_key (str): name of the list expression arg</span> +</span><span id="Expression.append-269"><a href="#Expression.append-269"><span class="linenos">269</span></a><span class="sd"> value (Any): value to append to the list</span> +</span><span id="Expression.append-270"><a href="#Expression.append-270"><span class="linenos">270</span></a><span class="sd"> """</span> +</span><span id="Expression.append-271"><a href="#Expression.append-271"><span class="linenos">271</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-272"><a href="#Expression.append-272"><span class="linenos">272</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-273"><a href="#Expression.append-273"><span class="linenos">273</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-274"><a href="#Expression.append-274"><span class="linenos">274</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> @@ -12659,16 +12668,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-279"><a href="#Expression.set-279"><span class="linenos">279</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> -</span><span id="Expression.set-280"><a href="#Expression.set-280"><span class="linenos">280</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.set-281"><a href="#Expression.set-281"><span class="linenos">281</span></a><span class="sd"> Sets `arg_key` to `value`.</span> -</span><span id="Expression.set-282"><a href="#Expression.set-282"><span class="linenos">282</span></a> -</span><span id="Expression.set-283"><a href="#Expression.set-283"><span class="linenos">283</span></a><span class="sd"> Args:</span> -</span><span id="Expression.set-284"><a href="#Expression.set-284"><span class="linenos">284</span></a><span class="sd"> arg_key (str): name of the expression arg.</span> -</span><span id="Expression.set-285"><a href="#Expression.set-285"><span class="linenos">285</span></a><span class="sd"> value: value to set the arg to.</span> -</span><span id="Expression.set-286"><a href="#Expression.set-286"><span class="linenos">286</span></a><span class="sd"> """</span> -</span><span id="Expression.set-287"><a href="#Expression.set-287"><span class="linenos">287</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-288"><a href="#Expression.set-288"><span class="linenos">288</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-276"><a href="#Expression.set-276"><span class="linenos">276</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="nb">str</span><span class="p">,</span> <span class="n">value</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 class="p">:</span> +</span><span id="Expression.set-277"><a href="#Expression.set-277"><span class="linenos">277</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.set-278"><a href="#Expression.set-278"><span class="linenos">278</span></a><span class="sd"> Sets `arg_key` to `value`.</span> +</span><span id="Expression.set-279"><a href="#Expression.set-279"><span class="linenos">279</span></a> +</span><span id="Expression.set-280"><a href="#Expression.set-280"><span class="linenos">280</span></a><span class="sd"> Args:</span> +</span><span id="Expression.set-281"><a href="#Expression.set-281"><span class="linenos">281</span></a><span class="sd"> arg_key (str): name of the expression arg.</span> +</span><span id="Expression.set-282"><a href="#Expression.set-282"><span class="linenos">282</span></a><span class="sd"> value: value to set the arg to.</span> +</span><span id="Expression.set-283"><a href="#Expression.set-283"><span class="linenos">283</span></a><span class="sd"> """</span> +</span><span id="Expression.set-284"><a href="#Expression.set-284"><span class="linenos">284</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-285"><a href="#Expression.set-285"><span class="linenos">285</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> @@ -12708,16 +12717,16 @@ for args that are strings or leaf Expression instances, such as identifiers and </div> <a class="headerlink" href="#Expression.iter_expressions"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.iter_expressions-309"><a href="#Expression.iter_expressions-309"><span class="linenos">309</span></a> <span class="k">def</span> <span class="nf">iter_expressions</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">Iterator</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="nb">str</span><span class="p">,</span> <span class="n">Expression</span><span class="p">]]:</span> -</span><span id="Expression.iter_expressions-310"><a href="#Expression.iter_expressions-310"><span class="linenos">310</span></a><span class="w"> </span><span class="sd">"""Yields the key and expression for all arguments, exploding list args."""</span> -</span><span id="Expression.iter_expressions-311"><a href="#Expression.iter_expressions-311"><span class="linenos">311</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.iter_expressions-312"><a href="#Expression.iter_expressions-312"><span class="linenos">312</span></a> <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span> -</span><span id="Expression.iter_expressions-313"><a href="#Expression.iter_expressions-313"><span class="linenos">313</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">vs</span><span class="p">:</span> -</span><span id="Expression.iter_expressions-314"><a href="#Expression.iter_expressions-314"><span class="linenos">314</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">"parent"</span><span class="p">):</span> -</span><span id="Expression.iter_expressions-315"><a href="#Expression.iter_expressions-315"><span class="linenos">315</span></a> <span class="k">yield</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> -</span><span id="Expression.iter_expressions-316"><a href="#Expression.iter_expressions-316"><span class="linenos">316</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Expression.iter_expressions-317"><a href="#Expression.iter_expressions-317"><span class="linenos">317</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">vs</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">):</span> -</span><span id="Expression.iter_expressions-318"><a href="#Expression.iter_expressions-318"><span class="linenos">318</span></a> <span class="k">yield</span> <span class="n">k</span><span class="p">,</span> <span class="n">vs</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.iter_expressions-306"><a href="#Expression.iter_expressions-306"><span class="linenos">306</span></a> <span class="k">def</span> <span class="nf">iter_expressions</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">Iterator</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="nb">str</span><span class="p">,</span> <span class="n">Expression</span><span class="p">]]:</span> +</span><span id="Expression.iter_expressions-307"><a href="#Expression.iter_expressions-307"><span class="linenos">307</span></a><span class="w"> </span><span class="sd">"""Yields the key and expression for all arguments, exploding list args."""</span> +</span><span id="Expression.iter_expressions-308"><a href="#Expression.iter_expressions-308"><span class="linenos">308</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.iter_expressions-309"><a href="#Expression.iter_expressions-309"><span class="linenos">309</span></a> <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span> +</span><span id="Expression.iter_expressions-310"><a href="#Expression.iter_expressions-310"><span class="linenos">310</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">vs</span><span class="p">:</span> +</span><span id="Expression.iter_expressions-311"><a href="#Expression.iter_expressions-311"><span class="linenos">311</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">"parent"</span><span class="p">):</span> +</span><span id="Expression.iter_expressions-312"><a href="#Expression.iter_expressions-312"><span class="linenos">312</span></a> <span class="k">yield</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> +</span><span id="Expression.iter_expressions-313"><a href="#Expression.iter_expressions-313"><span class="linenos">313</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Expression.iter_expressions-314"><a href="#Expression.iter_expressions-314"><span class="linenos">314</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">vs</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">):</span> +</span><span id="Expression.iter_expressions-315"><a href="#Expression.iter_expressions-315"><span class="linenos">315</span></a> <span class="k">yield</span> <span class="n">k</span><span class="p">,</span> <span class="n">vs</span> </span></pre></div> @@ -12737,19 +12746,19 @@ 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-320"><a href="#Expression.find-320"><span class="linenos">320</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">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">],</span> <span class="n">bfs</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">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">E</span><span class="p">]:</span> -</span><span id="Expression.find-321"><a href="#Expression.find-321"><span class="linenos">321</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.find-322"><a href="#Expression.find-322"><span class="linenos">322</span></a><span class="sd"> Returns the first node in this tree which matches at least one of</span> -</span><span id="Expression.find-323"><a href="#Expression.find-323"><span class="linenos">323</span></a><span class="sd"> the specified types.</span> -</span><span id="Expression.find-324"><a href="#Expression.find-324"><span class="linenos">324</span></a> -</span><span id="Expression.find-325"><a href="#Expression.find-325"><span class="linenos">325</span></a><span class="sd"> Args:</span> -</span><span id="Expression.find-326"><a href="#Expression.find-326"><span class="linenos">326</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> -</span><span id="Expression.find-327"><a href="#Expression.find-327"><span class="linenos">327</span></a><span class="sd"> bfs: whether to search the AST using the BFS algorithm (DFS is used if false).</span> -</span><span id="Expression.find-328"><a href="#Expression.find-328"><span class="linenos">328</span></a> -</span><span id="Expression.find-329"><a href="#Expression.find-329"><span class="linenos">329</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.find-330"><a href="#Expression.find-330"><span class="linenos">330</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-331"><a href="#Expression.find-331"><span class="linenos">331</span></a><span class="sd"> """</span> -</span><span id="Expression.find-332"><a href="#Expression.find-332"><span class="linenos">332</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-317"><a href="#Expression.find-317"><span class="linenos">317</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">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">],</span> <span class="n">bfs</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">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">E</span><span class="p">]:</span> +</span><span id="Expression.find-318"><a href="#Expression.find-318"><span class="linenos">318</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.find-319"><a href="#Expression.find-319"><span class="linenos">319</span></a><span class="sd"> Returns the first node in this tree which matches at least one of</span> +</span><span id="Expression.find-320"><a href="#Expression.find-320"><span class="linenos">320</span></a><span class="sd"> the specified types.</span> +</span><span id="Expression.find-321"><a href="#Expression.find-321"><span class="linenos">321</span></a> +</span><span id="Expression.find-322"><a href="#Expression.find-322"><span class="linenos">322</span></a><span class="sd"> Args:</span> +</span><span id="Expression.find-323"><a href="#Expression.find-323"><span class="linenos">323</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> +</span><span id="Expression.find-324"><a href="#Expression.find-324"><span class="linenos">324</span></a><span class="sd"> bfs: whether to search the AST using the BFS algorithm (DFS is used if false).</span> +</span><span id="Expression.find-325"><a href="#Expression.find-325"><span class="linenos">325</span></a> +</span><span id="Expression.find-326"><a href="#Expression.find-326"><span class="linenos">326</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.find-327"><a href="#Expression.find-327"><span class="linenos">327</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-328"><a href="#Expression.find-328"><span class="linenos">328</span></a><span class="sd"> """</span> +</span><span id="Expression.find-329"><a href="#Expression.find-329"><span class="linenos">329</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> @@ -12783,21 +12792,21 @@ 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-334"><a href="#Expression.find_all-334"><span class="linenos">334</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">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">],</span> <span class="n">bfs</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">t</span><span class="o">.</span><span class="n">Iterator</span><span class="p">[</span><span class="n">E</span><span class="p">]:</span> -</span><span id="Expression.find_all-335"><a href="#Expression.find_all-335"><span class="linenos">335</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.find_all-336"><a href="#Expression.find_all-336"><span class="linenos">336</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-337"><a href="#Expression.find_all-337"><span class="linenos">337</span></a><span class="sd"> yields those that match at least one of the specified expression types.</span> -</span><span id="Expression.find_all-338"><a href="#Expression.find_all-338"><span class="linenos">338</span></a> -</span><span id="Expression.find_all-339"><a href="#Expression.find_all-339"><span class="linenos">339</span></a><span class="sd"> Args:</span> -</span><span id="Expression.find_all-340"><a href="#Expression.find_all-340"><span class="linenos">340</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> -</span><span id="Expression.find_all-341"><a href="#Expression.find_all-341"><span class="linenos">341</span></a><span class="sd"> bfs: whether to search the AST using the BFS algorithm (DFS is used if false).</span> -</span><span id="Expression.find_all-342"><a href="#Expression.find_all-342"><span class="linenos">342</span></a> -</span><span id="Expression.find_all-343"><a href="#Expression.find_all-343"><span class="linenos">343</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.find_all-344"><a href="#Expression.find_all-344"><span class="linenos">344</span></a><span class="sd"> The generator object.</span> -</span><span id="Expression.find_all-345"><a href="#Expression.find_all-345"><span class="linenos">345</span></a><span class="sd"> """</span> -</span><span id="Expression.find_all-346"><a href="#Expression.find_all-346"><span class="linenos">346</span></a> <span class="k">for</span> <span class="n">expression</span><span class="p">,</span> <span class="o">*</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-347"><a href="#Expression.find_all-347"><span class="linenos">347</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-348"><a href="#Expression.find_all-348"><span class="linenos">348</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-331"><a href="#Expression.find_all-331"><span class="linenos">331</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">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">],</span> <span class="n">bfs</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">t</span><span class="o">.</span><span class="n">Iterator</span><span class="p">[</span><span class="n">E</span><span class="p">]:</span> +</span><span id="Expression.find_all-332"><a href="#Expression.find_all-332"><span class="linenos">332</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.find_all-333"><a href="#Expression.find_all-333"><span class="linenos">333</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-334"><a href="#Expression.find_all-334"><span class="linenos">334</span></a><span class="sd"> yields those that match at least one of the specified expression types.</span> +</span><span id="Expression.find_all-335"><a href="#Expression.find_all-335"><span class="linenos">335</span></a> +</span><span id="Expression.find_all-336"><a href="#Expression.find_all-336"><span class="linenos">336</span></a><span class="sd"> Args:</span> +</span><span id="Expression.find_all-337"><a href="#Expression.find_all-337"><span class="linenos">337</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> +</span><span id="Expression.find_all-338"><a href="#Expression.find_all-338"><span class="linenos">338</span></a><span class="sd"> bfs: whether to search the AST using the BFS algorithm (DFS is used if false).</span> +</span><span id="Expression.find_all-339"><a href="#Expression.find_all-339"><span class="linenos">339</span></a> +</span><span id="Expression.find_all-340"><a href="#Expression.find_all-340"><span class="linenos">340</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.find_all-341"><a href="#Expression.find_all-341"><span class="linenos">341</span></a><span class="sd"> The generator object.</span> +</span><span id="Expression.find_all-342"><a href="#Expression.find_all-342"><span class="linenos">342</span></a><span class="sd"> """</span> +</span><span id="Expression.find_all-343"><a href="#Expression.find_all-343"><span class="linenos">343</span></a> <span class="k">for</span> <span class="n">expression</span><span class="p">,</span> <span class="o">*</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-344"><a href="#Expression.find_all-344"><span class="linenos">344</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-345"><a href="#Expression.find_all-345"><span class="linenos">345</span></a> <span class="k">yield</span> <span class="n">expression</span> </span></pre></div> @@ -12831,20 +12840,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-350"><a href="#Expression.find_ancestor-350"><span class="linenos">350</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 class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</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">E</span><span class="p">]:</span> -</span><span id="Expression.find_ancestor-351"><a href="#Expression.find_ancestor-351"><span class="linenos">351</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.find_ancestor-352"><a href="#Expression.find_ancestor-352"><span class="linenos">352</span></a><span class="sd"> Returns a nearest parent matching expression_types.</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.find_ancestor-347"><a href="#Expression.find_ancestor-347"><span class="linenos">347</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 class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</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">E</span><span class="p">]:</span> +</span><span id="Expression.find_ancestor-348"><a href="#Expression.find_ancestor-348"><span class="linenos">348</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.find_ancestor-349"><a href="#Expression.find_ancestor-349"><span class="linenos">349</span></a><span class="sd"> Returns a nearest parent matching expression_types.</span> +</span><span id="Expression.find_ancestor-350"><a href="#Expression.find_ancestor-350"><span class="linenos">350</span></a> +</span><span id="Expression.find_ancestor-351"><a href="#Expression.find_ancestor-351"><span class="linenos">351</span></a><span class="sd"> Args:</span> +</span><span id="Expression.find_ancestor-352"><a href="#Expression.find_ancestor-352"><span class="linenos">352</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> </span><span id="Expression.find_ancestor-353"><a href="#Expression.find_ancestor-353"><span class="linenos">353</span></a> -</span><span id="Expression.find_ancestor-354"><a href="#Expression.find_ancestor-354"><span class="linenos">354</span></a><span class="sd"> Args:</span> -</span><span id="Expression.find_ancestor-355"><a href="#Expression.find_ancestor-355"><span class="linenos">355</span></a><span class="sd"> expression_types: the expression type(s) to match.</span> -</span><span id="Expression.find_ancestor-356"><a href="#Expression.find_ancestor-356"><span class="linenos">356</span></a> -</span><span id="Expression.find_ancestor-357"><a href="#Expression.find_ancestor-357"><span class="linenos">357</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.find_ancestor-358"><a href="#Expression.find_ancestor-358"><span class="linenos">358</span></a><span class="sd"> The parent node.</span> -</span><span id="Expression.find_ancestor-359"><a href="#Expression.find_ancestor-359"><span class="linenos">359</span></a><span class="sd"> """</span> -</span><span id="Expression.find_ancestor-360"><a href="#Expression.find_ancestor-360"><span class="linenos">360</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-361"><a href="#Expression.find_ancestor-361"><span class="linenos">361</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-362"><a href="#Expression.find_ancestor-362"><span class="linenos">362</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-363"><a href="#Expression.find_ancestor-363"><span class="linenos">363</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">E</span><span class="p">,</span> <span class="n">ancestor</span><span class="p">)</span> +</span><span id="Expression.find_ancestor-354"><a href="#Expression.find_ancestor-354"><span class="linenos">354</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.find_ancestor-355"><a href="#Expression.find_ancestor-355"><span class="linenos">355</span></a><span class="sd"> The parent node.</span> +</span><span id="Expression.find_ancestor-356"><a href="#Expression.find_ancestor-356"><span class="linenos">356</span></a><span class="sd"> """</span> +</span><span id="Expression.find_ancestor-357"><a href="#Expression.find_ancestor-357"><span class="linenos">357</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-358"><a href="#Expression.find_ancestor-358"><span class="linenos">358</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-359"><a href="#Expression.find_ancestor-359"><span class="linenos">359</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-360"><a href="#Expression.find_ancestor-360"><span class="linenos">360</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">E</span><span class="p">,</span> <span class="n">ancestor</span><span class="p">)</span> </span></pre></div> @@ -12902,14 +12911,14 @@ yields those that match at least one of the specified expression types.</p> </div> <a class="headerlink" href="#Expression.root"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.root-377"><a href="#Expression.root-377"><span class="linenos">377</span></a> <span class="k">def</span> <span class="nf">root</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="Expression.root-378"><a href="#Expression.root-378"><span class="linenos">378</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.root-379"><a href="#Expression.root-379"><span class="linenos">379</span></a><span class="sd"> Returns the root expression of this tree.</span> -</span><span id="Expression.root-380"><a href="#Expression.root-380"><span class="linenos">380</span></a><span class="sd"> """</span> -</span><span id="Expression.root-381"><a href="#Expression.root-381"><span class="linenos">381</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="Expression.root-382"><a href="#Expression.root-382"><span class="linenos">382</span></a> <span class="k">while</span> <span class="n">expression</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> -</span><span id="Expression.root-383"><a href="#Expression.root-383"><span class="linenos">383</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression.root-384"><a href="#Expression.root-384"><span class="linenos">384</span></a> <span class="k">return</span> <span class="n">expression</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.root-374"><a href="#Expression.root-374"><span class="linenos">374</span></a> <span class="k">def</span> <span class="nf">root</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="Expression.root-375"><a href="#Expression.root-375"><span class="linenos">375</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.root-376"><a href="#Expression.root-376"><span class="linenos">376</span></a><span class="sd"> Returns the root expression of this tree.</span> +</span><span id="Expression.root-377"><a href="#Expression.root-377"><span class="linenos">377</span></a><span class="sd"> """</span> +</span><span id="Expression.root-378"><a href="#Expression.root-378"><span class="linenos">378</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="Expression.root-379"><a href="#Expression.root-379"><span class="linenos">379</span></a> <span class="k">while</span> <span class="n">expression</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> +</span><span id="Expression.root-380"><a href="#Expression.root-380"><span class="linenos">380</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression.root-381"><a href="#Expression.root-381"><span class="linenos">381</span></a> <span class="k">return</span> <span class="n">expression</span> </span></pre></div> @@ -12929,23 +12938,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-386"><a href="#Expression.walk-386"><span class="linenos">386</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-387"><a href="#Expression.walk-387"><span class="linenos">387</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.walk-388"><a href="#Expression.walk-388"><span class="linenos">388</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree.</span> -</span><span id="Expression.walk-389"><a href="#Expression.walk-389"><span class="linenos">389</span></a> -</span><span id="Expression.walk-390"><a href="#Expression.walk-390"><span class="linenos">390</span></a><span class="sd"> Args:</span> -</span><span id="Expression.walk-391"><a href="#Expression.walk-391"><span class="linenos">391</span></a><span class="sd"> bfs (bool): if set to True the BFS traversal order will be applied,</span> -</span><span id="Expression.walk-392"><a href="#Expression.walk-392"><span class="linenos">392</span></a><span class="sd"> otherwise the DFS traversal will be used instead.</span> -</span><span id="Expression.walk-393"><a href="#Expression.walk-393"><span class="linenos">393</span></a><span class="sd"> prune ((node, parent, arg_key) -> bool): callable that returns True if</span> -</span><span id="Expression.walk-394"><a href="#Expression.walk-394"><span class="linenos">394</span></a><span class="sd"> the generator should stop traversing this branch of the tree.</span> -</span><span id="Expression.walk-395"><a href="#Expression.walk-395"><span class="linenos">395</span></a> -</span><span id="Expression.walk-396"><a href="#Expression.walk-396"><span class="linenos">396</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.walk-397"><a href="#Expression.walk-397"><span class="linenos">397</span></a><span class="sd"> the generator object.</span> -</span><span id="Expression.walk-398"><a href="#Expression.walk-398"><span class="linenos">398</span></a><span class="sd"> """</span> -</span><span id="Expression.walk-399"><a href="#Expression.walk-399"><span class="linenos">399</span></a> <span class="k">if</span> <span class="n">bfs</span><span class="p">:</span> -</span><span id="Expression.walk-400"><a href="#Expression.walk-400"><span class="linenos">400</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-401"><a href="#Expression.walk-401"><span class="linenos">401</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Expression.walk-402"><a href="#Expression.walk-402"><span class="linenos">402</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-383"><a href="#Expression.walk-383"><span class="linenos">383</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-384"><a href="#Expression.walk-384"><span class="linenos">384</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.walk-385"><a href="#Expression.walk-385"><span class="linenos">385</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree.</span> +</span><span id="Expression.walk-386"><a href="#Expression.walk-386"><span class="linenos">386</span></a> +</span><span id="Expression.walk-387"><a href="#Expression.walk-387"><span class="linenos">387</span></a><span class="sd"> Args:</span> +</span><span id="Expression.walk-388"><a href="#Expression.walk-388"><span class="linenos">388</span></a><span class="sd"> bfs (bool): if set to True the BFS traversal order will be applied,</span> +</span><span id="Expression.walk-389"><a href="#Expression.walk-389"><span class="linenos">389</span></a><span class="sd"> otherwise the DFS traversal will be used instead.</span> +</span><span id="Expression.walk-390"><a href="#Expression.walk-390"><span class="linenos">390</span></a><span class="sd"> prune ((node, parent, arg_key) -> bool): callable that returns True if</span> +</span><span id="Expression.walk-391"><a href="#Expression.walk-391"><span class="linenos">391</span></a><span class="sd"> the generator should stop traversing this branch of the tree.</span> +</span><span id="Expression.walk-392"><a href="#Expression.walk-392"><span class="linenos">392</span></a> +</span><span id="Expression.walk-393"><a href="#Expression.walk-393"><span class="linenos">393</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.walk-394"><a href="#Expression.walk-394"><span class="linenos">394</span></a><span class="sd"> the generator object.</span> +</span><span id="Expression.walk-395"><a href="#Expression.walk-395"><span class="linenos">395</span></a><span class="sd"> """</span> +</span><span id="Expression.walk-396"><a href="#Expression.walk-396"><span class="linenos">396</span></a> <span class="k">if</span> <span class="n">bfs</span><span class="p">:</span> +</span><span id="Expression.walk-397"><a href="#Expression.walk-397"><span class="linenos">397</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-398"><a href="#Expression.walk-398"><span class="linenos">398</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Expression.walk-399"><a href="#Expression.walk-399"><span class="linenos">399</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> @@ -12980,21 +12989,21 @@ 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-404"><a href="#Expression.dfs-404"><span class="linenos">404</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-405"><a href="#Expression.dfs-405"><span class="linenos">405</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.dfs-406"><a href="#Expression.dfs-406"><span class="linenos">406</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> -</span><span id="Expression.dfs-407"><a href="#Expression.dfs-407"><span class="linenos">407</span></a><span class="sd"> the DFS (Depth-first) order.</span> -</span><span id="Expression.dfs-408"><a href="#Expression.dfs-408"><span class="linenos">408</span></a> -</span><span id="Expression.dfs-409"><a href="#Expression.dfs-409"><span class="linenos">409</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.dfs-410"><a href="#Expression.dfs-410"><span class="linenos">410</span></a><span class="sd"> The generator object.</span> -</span><span id="Expression.dfs-411"><a href="#Expression.dfs-411"><span class="linenos">411</span></a><span class="sd"> """</span> -</span><span id="Expression.dfs-412"><a href="#Expression.dfs-412"><span class="linenos">412</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-413"><a href="#Expression.dfs-413"><span class="linenos">413</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-414"><a href="#Expression.dfs-414"><span class="linenos">414</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-415"><a href="#Expression.dfs-415"><span class="linenos">415</span></a> <span class="k">return</span> -</span><span id="Expression.dfs-416"><a href="#Expression.dfs-416"><span class="linenos">416</span></a> -</span><span id="Expression.dfs-417"><a href="#Expression.dfs-417"><span class="linenos">417</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">iter_expressions</span><span class="p">():</span> -</span><span id="Expression.dfs-418"><a href="#Expression.dfs-418"><span class="linenos">418</span></a> <span class="k">yield from</span> <span class="n">v</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-401"><a href="#Expression.dfs-401"><span class="linenos">401</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-402"><a href="#Expression.dfs-402"><span class="linenos">402</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.dfs-403"><a href="#Expression.dfs-403"><span class="linenos">403</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> +</span><span id="Expression.dfs-404"><a href="#Expression.dfs-404"><span class="linenos">404</span></a><span class="sd"> the DFS (Depth-first) order.</span> +</span><span id="Expression.dfs-405"><a href="#Expression.dfs-405"><span class="linenos">405</span></a> +</span><span id="Expression.dfs-406"><a href="#Expression.dfs-406"><span class="linenos">406</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.dfs-407"><a href="#Expression.dfs-407"><span class="linenos">407</span></a><span class="sd"> The generator object.</span> +</span><span id="Expression.dfs-408"><a href="#Expression.dfs-408"><span class="linenos">408</span></a><span class="sd"> """</span> +</span><span id="Expression.dfs-409"><a href="#Expression.dfs-409"><span class="linenos">409</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-410"><a href="#Expression.dfs-410"><span class="linenos">410</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-411"><a href="#Expression.dfs-411"><span class="linenos">411</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-412"><a href="#Expression.dfs-412"><span class="linenos">412</span></a> <span class="k">return</span> +</span><span id="Expression.dfs-413"><a href="#Expression.dfs-413"><span class="linenos">413</span></a> +</span><span id="Expression.dfs-414"><a href="#Expression.dfs-414"><span class="linenos">414</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">iter_expressions</span><span class="p">():</span> +</span><span id="Expression.dfs-415"><a href="#Expression.dfs-415"><span class="linenos">415</span></a> <span class="k">yield from</span> <span class="n">v</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> @@ -13021,25 +13030,25 @@ 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-420"><a href="#Expression.bfs-420"><span class="linenos">420</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-421"><a href="#Expression.bfs-421"><span class="linenos">421</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.bfs-422"><a href="#Expression.bfs-422"><span class="linenos">422</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> -</span><span id="Expression.bfs-423"><a href="#Expression.bfs-423"><span class="linenos">423</span></a><span class="sd"> the BFS (Breadth-first) order.</span> -</span><span id="Expression.bfs-424"><a href="#Expression.bfs-424"><span class="linenos">424</span></a> -</span><span id="Expression.bfs-425"><a href="#Expression.bfs-425"><span class="linenos">425</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.bfs-426"><a href="#Expression.bfs-426"><span class="linenos">426</span></a><span class="sd"> The generator object.</span> -</span><span id="Expression.bfs-427"><a href="#Expression.bfs-427"><span class="linenos">427</span></a><span class="sd"> """</span> -</span><span id="Expression.bfs-428"><a href="#Expression.bfs-428"><span class="linenos">428</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.bfs-417"><a href="#Expression.bfs-417"><span class="linenos">417</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-418"><a href="#Expression.bfs-418"><span class="linenos">418</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.bfs-419"><a href="#Expression.bfs-419"><span class="linenos">419</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> +</span><span id="Expression.bfs-420"><a href="#Expression.bfs-420"><span class="linenos">420</span></a><span class="sd"> the BFS (Breadth-first) order.</span> +</span><span id="Expression.bfs-421"><a href="#Expression.bfs-421"><span class="linenos">421</span></a> +</span><span id="Expression.bfs-422"><a href="#Expression.bfs-422"><span class="linenos">422</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.bfs-423"><a href="#Expression.bfs-423"><span class="linenos">423</span></a><span class="sd"> The generator object.</span> +</span><span id="Expression.bfs-424"><a href="#Expression.bfs-424"><span class="linenos">424</span></a><span class="sd"> """</span> +</span><span id="Expression.bfs-425"><a href="#Expression.bfs-425"><span class="linenos">425</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-426"><a href="#Expression.bfs-426"><span class="linenos">426</span></a> +</span><span id="Expression.bfs-427"><a href="#Expression.bfs-427"><span class="linenos">427</span></a> <span class="k">while</span> <span class="n">queue</span><span class="p">:</span> +</span><span id="Expression.bfs-428"><a href="#Expression.bfs-428"><span class="linenos">428</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-429"><a href="#Expression.bfs-429"><span class="linenos">429</span></a> -</span><span id="Expression.bfs-430"><a href="#Expression.bfs-430"><span class="linenos">430</span></a> <span class="k">while</span> <span class="n">queue</span><span class="p">:</span> -</span><span id="Expression.bfs-431"><a href="#Expression.bfs-431"><span class="linenos">431</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-432"><a href="#Expression.bfs-432"><span class="linenos">432</span></a> -</span><span id="Expression.bfs-433"><a href="#Expression.bfs-433"><span class="linenos">433</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-434"><a href="#Expression.bfs-434"><span class="linenos">434</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-435"><a href="#Expression.bfs-435"><span class="linenos">435</span></a> <span class="k">continue</span> -</span><span id="Expression.bfs-436"><a href="#Expression.bfs-436"><span class="linenos">436</span></a> -</span><span id="Expression.bfs-437"><a href="#Expression.bfs-437"><span class="linenos">437</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">iter_expressions</span><span class="p">():</span> -</span><span id="Expression.bfs-438"><a href="#Expression.bfs-438"><span class="linenos">438</span></a> <span class="n">queue</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">v</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.bfs-430"><a href="#Expression.bfs-430"><span class="linenos">430</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-431"><a href="#Expression.bfs-431"><span class="linenos">431</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-432"><a href="#Expression.bfs-432"><span class="linenos">432</span></a> <span class="k">continue</span> +</span><span id="Expression.bfs-433"><a href="#Expression.bfs-433"><span class="linenos">433</span></a> +</span><span id="Expression.bfs-434"><a href="#Expression.bfs-434"><span class="linenos">434</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">iter_expressions</span><span class="p">():</span> +</span><span id="Expression.bfs-435"><a href="#Expression.bfs-435"><span class="linenos">435</span></a> <span class="n">queue</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">v</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> @@ -13066,14 +13075,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-440"><a href="#Expression.unnest-440"><span class="linenos">440</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-441"><a href="#Expression.unnest-441"><span class="linenos">441</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.unnest-442"><a href="#Expression.unnest-442"><span class="linenos">442</span></a><span class="sd"> Returns the first non parenthesis child or self.</span> -</span><span id="Expression.unnest-443"><a href="#Expression.unnest-443"><span class="linenos">443</span></a><span class="sd"> """</span> -</span><span id="Expression.unnest-444"><a href="#Expression.unnest-444"><span class="linenos">444</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="Expression.unnest-445"><a href="#Expression.unnest-445"><span class="linenos">445</span></a> <span class="k">while</span> <span class="nb">type</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> <span class="ow">is</span> <span class="n">Paren</span><span class="p">:</span> -</span><span id="Expression.unnest-446"><a href="#Expression.unnest-446"><span class="linenos">446</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-447"><a href="#Expression.unnest-447"><span class="linenos">447</span></a> <span class="k">return</span> <span class="n">expression</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.unnest-437"><a href="#Expression.unnest-437"><span class="linenos">437</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-438"><a href="#Expression.unnest-438"><span class="linenos">438</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.unnest-439"><a href="#Expression.unnest-439"><span class="linenos">439</span></a><span class="sd"> Returns the first non parenthesis child or self.</span> +</span><span id="Expression.unnest-440"><a href="#Expression.unnest-440"><span class="linenos">440</span></a><span class="sd"> """</span> +</span><span id="Expression.unnest-441"><a href="#Expression.unnest-441"><span class="linenos">441</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="Expression.unnest-442"><a href="#Expression.unnest-442"><span class="linenos">442</span></a> <span class="k">while</span> <span class="nb">type</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> <span class="ow">is</span> <span class="n">Paren</span><span class="p">:</span> +</span><span id="Expression.unnest-443"><a href="#Expression.unnest-443"><span class="linenos">443</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-444"><a href="#Expression.unnest-444"><span class="linenos">444</span></a> <span class="k">return</span> <span class="n">expression</span> </span></pre></div> @@ -13093,13 +13102,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-449"><a href="#Expression.unalias-449"><span class="linenos">449</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-450"><a href="#Expression.unalias-450"><span class="linenos">450</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.unalias-451"><a href="#Expression.unalias-451"><span class="linenos">451</span></a><span class="sd"> Returns the inner expression if this is an Alias.</span> -</span><span id="Expression.unalias-452"><a href="#Expression.unalias-452"><span class="linenos">452</span></a><span class="sd"> """</span> -</span><span id="Expression.unalias-453"><a href="#Expression.unalias-453"><span class="linenos">453</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-454"><a href="#Expression.unalias-454"><span class="linenos">454</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-455"><a href="#Expression.unalias-455"><span class="linenos">455</span></a> <span class="k">return</span> <span class="bp">self</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.unalias-446"><a href="#Expression.unalias-446"><span class="linenos">446</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-447"><a href="#Expression.unalias-447"><span class="linenos">447</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.unalias-448"><a href="#Expression.unalias-448"><span class="linenos">448</span></a><span class="sd"> Returns the inner expression if this is an Alias.</span> +</span><span id="Expression.unalias-449"><a href="#Expression.unalias-449"><span class="linenos">449</span></a><span class="sd"> """</span> +</span><span id="Expression.unalias-450"><a href="#Expression.unalias-450"><span class="linenos">450</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-451"><a href="#Expression.unalias-451"><span class="linenos">451</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-452"><a href="#Expression.unalias-452"><span class="linenos">452</span></a> <span class="k">return</span> <span class="bp">self</span> </span></pre></div> @@ -13119,11 +13128,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-457"><a href="#Expression.unnest_operands-457"><span class="linenos">457</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-458"><a href="#Expression.unnest_operands-458"><span class="linenos">458</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.unnest_operands-459"><a href="#Expression.unnest_operands-459"><span class="linenos">459</span></a><span class="sd"> Returns unnested operands as a tuple.</span> -</span><span id="Expression.unnest_operands-460"><a href="#Expression.unnest_operands-460"><span class="linenos">460</span></a><span class="sd"> """</span> -</span><span id="Expression.unnest_operands-461"><a href="#Expression.unnest_operands-461"><span class="linenos">461</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">_</span><span class="p">,</span> <span class="n">arg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">iter_expressions</span><span class="p">())</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.unnest_operands-454"><a href="#Expression.unnest_operands-454"><span class="linenos">454</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-455"><a href="#Expression.unnest_operands-455"><span class="linenos">455</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.unnest_operands-456"><a href="#Expression.unnest_operands-456"><span class="linenos">456</span></a><span class="sd"> Returns unnested operands as a tuple.</span> +</span><span id="Expression.unnest_operands-457"><a href="#Expression.unnest_operands-457"><span class="linenos">457</span></a><span class="sd"> """</span> +</span><span id="Expression.unnest_operands-458"><a href="#Expression.unnest_operands-458"><span class="linenos">458</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">_</span><span class="p">,</span> <span class="n">arg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">iter_expressions</span><span class="p">())</span> </span></pre></div> @@ -13143,15 +13152,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-463"><a href="#Expression.flatten-463"><span class="linenos">463</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-464"><a href="#Expression.flatten-464"><span class="linenos">464</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.flatten-465"><a href="#Expression.flatten-465"><span class="linenos">465</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-466"><a href="#Expression.flatten-466"><span class="linenos">466</span></a> -</span><span id="Expression.flatten-467"><a href="#Expression.flatten-467"><span class="linenos">467</span></a><span class="sd"> A AND B AND C -> [A, B, C]</span> -</span><span id="Expression.flatten-468"><a href="#Expression.flatten-468"><span class="linenos">468</span></a><span class="sd"> """</span> -</span><span id="Expression.flatten-469"><a href="#Expression.flatten-469"><span class="linenos">469</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">type</span><span class="p">(</span><span class="n">n</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">):</span> -</span><span id="Expression.flatten-470"><a href="#Expression.flatten-470"><span class="linenos">470</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">node</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">:</span> -</span><span id="Expression.flatten-471"><a href="#Expression.flatten-471"><span class="linenos">471</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-460"><a href="#Expression.flatten-460"><span class="linenos">460</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-461"><a href="#Expression.flatten-461"><span class="linenos">461</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.flatten-462"><a href="#Expression.flatten-462"><span class="linenos">462</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-463"><a href="#Expression.flatten-463"><span class="linenos">463</span></a> +</span><span id="Expression.flatten-464"><a href="#Expression.flatten-464"><span class="linenos">464</span></a><span class="sd"> A AND B AND C -> [A, B, C]</span> +</span><span id="Expression.flatten-465"><a href="#Expression.flatten-465"><span class="linenos">465</span></a><span class="sd"> """</span> +</span><span id="Expression.flatten-466"><a href="#Expression.flatten-466"><span class="linenos">466</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">type</span><span class="p">(</span><span class="n">n</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">):</span> +</span><span id="Expression.flatten-467"><a href="#Expression.flatten-467"><span class="linenos">467</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">type</span><span class="p">(</span><span class="n">node</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">:</span> +</span><span id="Expression.flatten-468"><a href="#Expression.flatten-468"><span class="linenos">468</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> @@ -13173,20 +13182,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-479"><a href="#Expression.sql-479"><span class="linenos">479</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-480"><a href="#Expression.sql-480"><span class="linenos">480</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.sql-481"><a href="#Expression.sql-481"><span class="linenos">481</span></a><span class="sd"> Returns SQL string representation of this tree.</span> -</span><span id="Expression.sql-482"><a href="#Expression.sql-482"><span class="linenos">482</span></a> -</span><span id="Expression.sql-483"><a href="#Expression.sql-483"><span class="linenos">483</span></a><span class="sd"> Args:</span> -</span><span id="Expression.sql-484"><a href="#Expression.sql-484"><span class="linenos">484</span></a><span class="sd"> dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").</span> -</span><span id="Expression.sql-485"><a href="#Expression.sql-485"><span class="linenos">485</span></a><span class="sd"> opts: other `sqlglot.generator.Generator` options.</span> -</span><span id="Expression.sql-486"><a href="#Expression.sql-486"><span class="linenos">486</span></a> -</span><span id="Expression.sql-487"><a href="#Expression.sql-487"><span class="linenos">487</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.sql-488"><a href="#Expression.sql-488"><span class="linenos">488</span></a><span class="sd"> The SQL string.</span> -</span><span id="Expression.sql-489"><a href="#Expression.sql-489"><span class="linenos">489</span></a><span class="sd"> """</span> -</span><span id="Expression.sql-490"><a href="#Expression.sql-490"><span class="linenos">490</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-491"><a href="#Expression.sql-491"><span class="linenos">491</span></a> -</span><span id="Expression.sql-492"><a href="#Expression.sql-492"><span class="linenos">492</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-476"><a href="#Expression.sql-476"><span class="linenos">476</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-477"><a href="#Expression.sql-477"><span class="linenos">477</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.sql-478"><a href="#Expression.sql-478"><span class="linenos">478</span></a><span class="sd"> Returns SQL string representation of this tree.</span> +</span><span id="Expression.sql-479"><a href="#Expression.sql-479"><span class="linenos">479</span></a> +</span><span id="Expression.sql-480"><a href="#Expression.sql-480"><span class="linenos">480</span></a><span class="sd"> Args:</span> +</span><span id="Expression.sql-481"><a href="#Expression.sql-481"><span class="linenos">481</span></a><span class="sd"> dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").</span> +</span><span id="Expression.sql-482"><a href="#Expression.sql-482"><span class="linenos">482</span></a><span class="sd"> opts: other `sqlglot.generator.Generator` options.</span> +</span><span id="Expression.sql-483"><a href="#Expression.sql-483"><span class="linenos">483</span></a> +</span><span id="Expression.sql-484"><a href="#Expression.sql-484"><span class="linenos">484</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.sql-485"><a href="#Expression.sql-485"><span class="linenos">485</span></a><span class="sd"> The SQL string.</span> +</span><span id="Expression.sql-486"><a href="#Expression.sql-486"><span class="linenos">486</span></a><span class="sd"> """</span> +</span><span id="Expression.sql-487"><a href="#Expression.sql-487"><span class="linenos">487</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-488"><a href="#Expression.sql-488"><span class="linenos">488</span></a> +</span><span id="Expression.sql-489"><a href="#Expression.sql-489"><span class="linenos">489</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> @@ -13219,32 +13228,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-518"><a href="#Expression.transform-518"><span class="linenos">518</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-519"><a href="#Expression.transform-519"><span class="linenos">519</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.transform-520"><a href="#Expression.transform-520"><span class="linenos">520</span></a><span class="sd"> Recursively visits all tree nodes (excluding already transformed ones)</span> -</span><span id="Expression.transform-521"><a href="#Expression.transform-521"><span class="linenos">521</span></a><span class="sd"> and applies the given transformation function to each node.</span> -</span><span id="Expression.transform-522"><a href="#Expression.transform-522"><span class="linenos">522</span></a> -</span><span id="Expression.transform-523"><a href="#Expression.transform-523"><span class="linenos">523</span></a><span class="sd"> Args:</span> -</span><span id="Expression.transform-524"><a href="#Expression.transform-524"><span class="linenos">524</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-525"><a href="#Expression.transform-525"><span class="linenos">525</span></a><span class="sd"> new transformed node or the same node without modifications. If the function</span> -</span><span id="Expression.transform-526"><a href="#Expression.transform-526"><span class="linenos">526</span></a><span class="sd"> returns None, then the corresponding node will be removed from the syntax tree.</span> -</span><span id="Expression.transform-527"><a href="#Expression.transform-527"><span class="linenos">527</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-528"><a href="#Expression.transform-528"><span class="linenos">528</span></a><span class="sd"> modified in place.</span> -</span><span id="Expression.transform-529"><a href="#Expression.transform-529"><span class="linenos">529</span></a> -</span><span id="Expression.transform-530"><a href="#Expression.transform-530"><span class="linenos">530</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.transform-531"><a href="#Expression.transform-531"><span class="linenos">531</span></a><span class="sd"> The transformed tree.</span> -</span><span id="Expression.transform-532"><a href="#Expression.transform-532"><span class="linenos">532</span></a><span class="sd"> """</span> -</span><span id="Expression.transform-533"><a href="#Expression.transform-533"><span class="linenos">533</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-534"><a href="#Expression.transform-534"><span class="linenos">534</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-535"><a href="#Expression.transform-535"><span class="linenos">535</span></a> -</span><span id="Expression.transform-536"><a href="#Expression.transform-536"><span class="linenos">536</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.transform-515"><a href="#Expression.transform-515"><span class="linenos">515</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-516"><a href="#Expression.transform-516"><span class="linenos">516</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.transform-517"><a href="#Expression.transform-517"><span class="linenos">517</span></a><span class="sd"> Recursively visits all tree nodes (excluding already transformed ones)</span> +</span><span id="Expression.transform-518"><a href="#Expression.transform-518"><span class="linenos">518</span></a><span class="sd"> and applies the given transformation function to each node.</span> +</span><span id="Expression.transform-519"><a href="#Expression.transform-519"><span class="linenos">519</span></a> +</span><span id="Expression.transform-520"><a href="#Expression.transform-520"><span class="linenos">520</span></a><span class="sd"> Args:</span> +</span><span id="Expression.transform-521"><a href="#Expression.transform-521"><span class="linenos">521</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-522"><a href="#Expression.transform-522"><span class="linenos">522</span></a><span class="sd"> new transformed node or the same node without modifications. If the function</span> +</span><span id="Expression.transform-523"><a href="#Expression.transform-523"><span class="linenos">523</span></a><span class="sd"> returns None, then the corresponding node will be removed from the syntax tree.</span> +</span><span id="Expression.transform-524"><a href="#Expression.transform-524"><span class="linenos">524</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-525"><a href="#Expression.transform-525"><span class="linenos">525</span></a><span class="sd"> modified in place.</span> +</span><span id="Expression.transform-526"><a href="#Expression.transform-526"><span class="linenos">526</span></a> +</span><span id="Expression.transform-527"><a href="#Expression.transform-527"><span class="linenos">527</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.transform-528"><a href="#Expression.transform-528"><span class="linenos">528</span></a><span class="sd"> The transformed tree.</span> +</span><span id="Expression.transform-529"><a href="#Expression.transform-529"><span class="linenos">529</span></a><span class="sd"> """</span> +</span><span id="Expression.transform-530"><a href="#Expression.transform-530"><span class="linenos">530</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-531"><a href="#Expression.transform-531"><span class="linenos">531</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-532"><a href="#Expression.transform-532"><span class="linenos">532</span></a> +</span><span id="Expression.transform-533"><a href="#Expression.transform-533"><span class="linenos">533</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-534"><a href="#Expression.transform-534"><span class="linenos">534</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="Expression.transform-535"><a href="#Expression.transform-535"><span class="linenos">535</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-536"><a href="#Expression.transform-536"><span class="linenos">536</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-537"><a href="#Expression.transform-537"><span class="linenos">537</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="Expression.transform-538"><a href="#Expression.transform-538"><span class="linenos">538</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-539"><a href="#Expression.transform-539"><span class="linenos">539</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-540"><a href="#Expression.transform-540"><span class="linenos">540</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="Expression.transform-541"><a href="#Expression.transform-541"><span class="linenos">541</span></a> -</span><span id="Expression.transform-542"><a href="#Expression.transform-542"><span class="linenos">542</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-543"><a href="#Expression.transform-543"><span class="linenos">543</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="Expression.transform-538"><a href="#Expression.transform-538"><span class="linenos">538</span></a> +</span><span id="Expression.transform-539"><a href="#Expression.transform-539"><span class="linenos">539</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-540"><a href="#Expression.transform-540"><span class="linenos">540</span></a> <span class="k">return</span> <span class="n">new_node</span> </span></pre></div> @@ -13281,32 +13290,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-553"><a href="#Expression.replace-553"><span class="linenos">553</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-554"><a href="#Expression.replace-554"><span class="linenos">554</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.replace-555"><a href="#Expression.replace-555"><span class="linenos">555</span></a><span class="sd"> Swap out this expression with a new expression.</span> -</span><span id="Expression.replace-556"><a href="#Expression.replace-556"><span class="linenos">556</span></a> -</span><span id="Expression.replace-557"><a href="#Expression.replace-557"><span class="linenos">557</span></a><span class="sd"> For example::</span> -</span><span id="Expression.replace-558"><a href="#Expression.replace-558"><span class="linenos">558</span></a> -</span><span id="Expression.replace-559"><a href="#Expression.replace-559"><span class="linenos">559</span></a><span class="sd"> >>> tree = Select().select("x").from_("tbl")</span> -</span><span id="Expression.replace-560"><a href="#Expression.replace-560"><span class="linenos">560</span></a><span class="sd"> >>> tree.find(Column).replace(Column(this="y"))</span> -</span><span id="Expression.replace-561"><a href="#Expression.replace-561"><span class="linenos">561</span></a><span class="sd"> (COLUMN this: y)</span> -</span><span id="Expression.replace-562"><a href="#Expression.replace-562"><span class="linenos">562</span></a><span class="sd"> >>> tree.sql()</span> -</span><span id="Expression.replace-563"><a href="#Expression.replace-563"><span class="linenos">563</span></a><span class="sd"> 'SELECT y FROM tbl'</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.replace-550"><a href="#Expression.replace-550"><span class="linenos">550</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-551"><a href="#Expression.replace-551"><span class="linenos">551</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.replace-552"><a href="#Expression.replace-552"><span class="linenos">552</span></a><span class="sd"> Swap out this expression with a new expression.</span> +</span><span id="Expression.replace-553"><a href="#Expression.replace-553"><span class="linenos">553</span></a> +</span><span id="Expression.replace-554"><a href="#Expression.replace-554"><span class="linenos">554</span></a><span class="sd"> For example::</span> +</span><span id="Expression.replace-555"><a href="#Expression.replace-555"><span class="linenos">555</span></a> +</span><span id="Expression.replace-556"><a href="#Expression.replace-556"><span class="linenos">556</span></a><span class="sd"> >>> tree = Select().select("x").from_("tbl")</span> +</span><span id="Expression.replace-557"><a href="#Expression.replace-557"><span class="linenos">557</span></a><span class="sd"> >>> tree.find(Column).replace(Column(this="y"))</span> +</span><span id="Expression.replace-558"><a href="#Expression.replace-558"><span class="linenos">558</span></a><span class="sd"> (COLUMN this: y)</span> +</span><span id="Expression.replace-559"><a href="#Expression.replace-559"><span class="linenos">559</span></a><span class="sd"> >>> tree.sql()</span> +</span><span id="Expression.replace-560"><a href="#Expression.replace-560"><span class="linenos">560</span></a><span class="sd"> 'SELECT y FROM tbl'</span> +</span><span id="Expression.replace-561"><a href="#Expression.replace-561"><span class="linenos">561</span></a> +</span><span id="Expression.replace-562"><a href="#Expression.replace-562"><span class="linenos">562</span></a><span class="sd"> Args:</span> +</span><span id="Expression.replace-563"><a href="#Expression.replace-563"><span class="linenos">563</span></a><span class="sd"> expression: new node</span> </span><span id="Expression.replace-564"><a href="#Expression.replace-564"><span class="linenos">564</span></a> -</span><span id="Expression.replace-565"><a href="#Expression.replace-565"><span class="linenos">565</span></a><span class="sd"> Args:</span> -</span><span id="Expression.replace-566"><a href="#Expression.replace-566"><span class="linenos">566</span></a><span class="sd"> expression: new node</span> -</span><span id="Expression.replace-567"><a href="#Expression.replace-567"><span class="linenos">567</span></a> -</span><span id="Expression.replace-568"><a href="#Expression.replace-568"><span class="linenos">568</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.replace-569"><a href="#Expression.replace-569"><span class="linenos">569</span></a><span class="sd"> The new expression or expressions.</span> -</span><span id="Expression.replace-570"><a href="#Expression.replace-570"><span class="linenos">570</span></a><span class="sd"> """</span> -</span><span id="Expression.replace-571"><a href="#Expression.replace-571"><span class="linenos">571</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-572"><a href="#Expression.replace-572"><span class="linenos">572</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="Expression.replace-565"><a href="#Expression.replace-565"><span class="linenos">565</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.replace-566"><a href="#Expression.replace-566"><span class="linenos">566</span></a><span class="sd"> The new expression or expressions.</span> +</span><span id="Expression.replace-567"><a href="#Expression.replace-567"><span class="linenos">567</span></a><span class="sd"> """</span> +</span><span id="Expression.replace-568"><a href="#Expression.replace-568"><span class="linenos">568</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-569"><a href="#Expression.replace-569"><span class="linenos">569</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="Expression.replace-570"><a href="#Expression.replace-570"><span class="linenos">570</span></a> +</span><span id="Expression.replace-571"><a href="#Expression.replace-571"><span class="linenos">571</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-572"><a href="#Expression.replace-572"><span class="linenos">572</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-573"><a href="#Expression.replace-573"><span class="linenos">573</span></a> -</span><span id="Expression.replace-574"><a href="#Expression.replace-574"><span class="linenos">574</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-575"><a href="#Expression.replace-575"><span class="linenos">575</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-576"><a href="#Expression.replace-576"><span class="linenos">576</span></a> -</span><span id="Expression.replace-577"><a href="#Expression.replace-577"><span class="linenos">577</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-578"><a href="#Expression.replace-578"><span class="linenos">578</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="Expression.replace-574"><a href="#Expression.replace-574"><span class="linenos">574</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-575"><a href="#Expression.replace-575"><span class="linenos">575</span></a> <span class="k">return</span> <span class="n">expression</span> </span></pre></div> @@ -13347,15 +13356,15 @@ modified in place.</li> </div> <a class="headerlink" href="#Expression.pop"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.pop-580"><a href="#Expression.pop-580"><span class="linenos">580</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 class="n">E</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> -</span><span id="Expression.pop-581"><a href="#Expression.pop-581"><span class="linenos">581</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.pop-582"><a href="#Expression.pop-582"><span class="linenos">582</span></a><span class="sd"> Remove this expression from its AST.</span> -</span><span id="Expression.pop-583"><a href="#Expression.pop-583"><span class="linenos">583</span></a> -</span><span id="Expression.pop-584"><a href="#Expression.pop-584"><span class="linenos">584</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.pop-585"><a href="#Expression.pop-585"><span class="linenos">585</span></a><span class="sd"> The popped expression.</span> -</span><span id="Expression.pop-586"><a href="#Expression.pop-586"><span class="linenos">586</span></a><span class="sd"> """</span> -</span><span id="Expression.pop-587"><a href="#Expression.pop-587"><span class="linenos">587</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.pop-588"><a href="#Expression.pop-588"><span class="linenos">588</span></a> <span class="k">return</span> <span class="bp">self</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.pop-577"><a href="#Expression.pop-577"><span class="linenos">577</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 class="n">E</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="Expression.pop-578"><a href="#Expression.pop-578"><span class="linenos">578</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.pop-579"><a href="#Expression.pop-579"><span class="linenos">579</span></a><span class="sd"> Remove this expression from its AST.</span> +</span><span id="Expression.pop-580"><a href="#Expression.pop-580"><span class="linenos">580</span></a> +</span><span id="Expression.pop-581"><a href="#Expression.pop-581"><span class="linenos">581</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.pop-582"><a href="#Expression.pop-582"><span class="linenos">582</span></a><span class="sd"> The popped expression.</span> +</span><span id="Expression.pop-583"><a href="#Expression.pop-583"><span class="linenos">583</span></a><span class="sd"> """</span> +</span><span id="Expression.pop-584"><a href="#Expression.pop-584"><span class="linenos">584</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.pop-585"><a href="#Expression.pop-585"><span class="linenos">585</span></a> <span class="k">return</span> <span class="bp">self</span> </span></pre></div> @@ -13381,22 +13390,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-590"><a href="#Expression.assert_is-590"><span class="linenos">590</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 class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">])</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> -</span><span id="Expression.assert_is-591"><a href="#Expression.assert_is-591"><span class="linenos">591</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.assert_is-592"><a href="#Expression.assert_is-592"><span class="linenos">592</span></a><span class="sd"> Assert that this `Expression` is an instance of `type_`.</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.assert_is-587"><a href="#Expression.assert_is-587"><span class="linenos">587</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 class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">E</span><span class="p">])</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="Expression.assert_is-588"><a href="#Expression.assert_is-588"><span class="linenos">588</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.assert_is-589"><a href="#Expression.assert_is-589"><span class="linenos">589</span></a><span class="sd"> Assert that this `Expression` is an instance of `type_`.</span> +</span><span id="Expression.assert_is-590"><a href="#Expression.assert_is-590"><span class="linenos">590</span></a> +</span><span id="Expression.assert_is-591"><a href="#Expression.assert_is-591"><span class="linenos">591</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-592"><a href="#Expression.assert_is-592"><span class="linenos">592</span></a><span class="sd"> Otherwise, this returns this expression.</span> </span><span id="Expression.assert_is-593"><a href="#Expression.assert_is-593"><span class="linenos">593</span></a> -</span><span id="Expression.assert_is-594"><a href="#Expression.assert_is-594"><span class="linenos">594</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-595"><a href="#Expression.assert_is-595"><span class="linenos">595</span></a><span class="sd"> Otherwise, this returns this expression.</span> +</span><span id="Expression.assert_is-594"><a href="#Expression.assert_is-594"><span class="linenos">594</span></a><span class="sd"> Examples:</span> +</span><span id="Expression.assert_is-595"><a href="#Expression.assert_is-595"><span class="linenos">595</span></a><span class="sd"> This is useful for type security in chained expressions:</span> </span><span id="Expression.assert_is-596"><a href="#Expression.assert_is-596"><span class="linenos">596</span></a> -</span><span id="Expression.assert_is-597"><a href="#Expression.assert_is-597"><span class="linenos">597</span></a><span class="sd"> Examples:</span> -</span><span id="Expression.assert_is-598"><a href="#Expression.assert_is-598"><span class="linenos">598</span></a><span class="sd"> This is useful for type security in chained expressions:</span> -</span><span id="Expression.assert_is-599"><a href="#Expression.assert_is-599"><span class="linenos">599</span></a> -</span><span id="Expression.assert_is-600"><a href="#Expression.assert_is-600"><span class="linenos">600</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Expression.assert_is-601"><a href="#Expression.assert_is-601"><span class="linenos">601</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-602"><a href="#Expression.assert_is-602"><span class="linenos">602</span></a><span class="sd"> 'SELECT x, z FROM y'</span> -</span><span id="Expression.assert_is-603"><a href="#Expression.assert_is-603"><span class="linenos">603</span></a><span class="sd"> """</span> -</span><span id="Expression.assert_is-604"><a href="#Expression.assert_is-604"><span class="linenos">604</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-605"><a href="#Expression.assert_is-605"><span class="linenos">605</span></a> <span class="k">return</span> <span class="bp">self</span> +</span><span id="Expression.assert_is-597"><a href="#Expression.assert_is-597"><span class="linenos">597</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Expression.assert_is-598"><a href="#Expression.assert_is-598"><span class="linenos">598</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-599"><a href="#Expression.assert_is-599"><span class="linenos">599</span></a><span class="sd"> 'SELECT x, z FROM y'</span> +</span><span id="Expression.assert_is-600"><a href="#Expression.assert_is-600"><span class="linenos">600</span></a><span class="sd"> """</span> +</span><span id="Expression.assert_is-601"><a href="#Expression.assert_is-601"><span class="linenos">601</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-602"><a href="#Expression.assert_is-602"><span class="linenos">602</span></a> <span class="k">return</span> <span class="bp">self</span> </span></pre></div> @@ -13432,39 +13441,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-607"><a href="#Expression.error_messages-607"><span class="linenos">607</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-608"><a href="#Expression.error_messages-608"><span class="linenos">608</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.error_messages-609"><a href="#Expression.error_messages-609"><span class="linenos">609</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-610"><a href="#Expression.error_messages-610"><span class="linenos">610</span></a> -</span><span id="Expression.error_messages-611"><a href="#Expression.error_messages-611"><span class="linenos">611</span></a><span class="sd"> Args:</span> -</span><span id="Expression.error_messages-612"><a href="#Expression.error_messages-612"><span class="linenos">612</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-613"><a href="#Expression.error_messages-613"><span class="linenos">613</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-614"><a href="#Expression.error_messages-614"><span class="linenos">614</span></a> -</span><span id="Expression.error_messages-615"><a href="#Expression.error_messages-615"><span class="linenos">615</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.error_messages-616"><a href="#Expression.error_messages-616"><span class="linenos">616</span></a><span class="sd"> A list of error messages for all possible errors that were found.</span> -</span><span id="Expression.error_messages-617"><a href="#Expression.error_messages-617"><span class="linenos">617</span></a><span class="sd"> """</span> -</span><span id="Expression.error_messages-618"><a href="#Expression.error_messages-618"><span class="linenos">618</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-619"><a href="#Expression.error_messages-619"><span class="linenos">619</span></a> -</span><span id="Expression.error_messages-620"><a href="#Expression.error_messages-620"><span class="linenos">620</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-621"><a href="#Expression.error_messages-621"><span class="linenos">621</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-622"><a href="#Expression.error_messages-622"><span class="linenos">622</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-623"><a href="#Expression.error_messages-623"><span class="linenos">623</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-624"><a href="#Expression.error_messages-624"><span class="linenos">624</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-625"><a href="#Expression.error_messages-625"><span class="linenos">625</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-626"><a href="#Expression.error_messages-626"><span class="linenos">626</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-627"><a href="#Expression.error_messages-627"><span class="linenos">627</span></a> -</span><span id="Expression.error_messages-628"><a href="#Expression.error_messages-628"><span class="linenos">628</span></a> <span class="k">if</span> <span class="p">(</span> -</span><span id="Expression.error_messages-629"><a href="#Expression.error_messages-629"><span class="linenos">629</span></a> <span class="n">args</span> -</span><span id="Expression.error_messages-630"><a href="#Expression.error_messages-630"><span class="linenos">630</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-631"><a href="#Expression.error_messages-631"><span class="linenos">631</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-632"><a href="#Expression.error_messages-632"><span class="linenos">632</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-633"><a href="#Expression.error_messages-633"><span class="linenos">633</span></a> <span class="p">):</span> -</span><span id="Expression.error_messages-634"><a href="#Expression.error_messages-634"><span class="linenos">634</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-635"><a href="#Expression.error_messages-635"><span class="linenos">635</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-636"><a href="#Expression.error_messages-636"><span class="linenos">636</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-637"><a href="#Expression.error_messages-637"><span class="linenos">637</span></a> <span class="p">)</span> -</span><span id="Expression.error_messages-638"><a href="#Expression.error_messages-638"><span class="linenos">638</span></a> -</span><span id="Expression.error_messages-639"><a href="#Expression.error_messages-639"><span class="linenos">639</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-604"><a href="#Expression.error_messages-604"><span class="linenos">604</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-605"><a href="#Expression.error_messages-605"><span class="linenos">605</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.error_messages-606"><a href="#Expression.error_messages-606"><span class="linenos">606</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-607"><a href="#Expression.error_messages-607"><span class="linenos">607</span></a> +</span><span id="Expression.error_messages-608"><a href="#Expression.error_messages-608"><span class="linenos">608</span></a><span class="sd"> Args:</span> +</span><span id="Expression.error_messages-609"><a href="#Expression.error_messages-609"><span class="linenos">609</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-610"><a href="#Expression.error_messages-610"><span class="linenos">610</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-611"><a href="#Expression.error_messages-611"><span class="linenos">611</span></a> +</span><span id="Expression.error_messages-612"><a href="#Expression.error_messages-612"><span class="linenos">612</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.error_messages-613"><a href="#Expression.error_messages-613"><span class="linenos">613</span></a><span class="sd"> A list of error messages for all possible errors that were found.</span> +</span><span id="Expression.error_messages-614"><a href="#Expression.error_messages-614"><span class="linenos">614</span></a><span class="sd"> """</span> +</span><span id="Expression.error_messages-615"><a href="#Expression.error_messages-615"><span class="linenos">615</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-616"><a href="#Expression.error_messages-616"><span class="linenos">616</span></a> +</span><span id="Expression.error_messages-617"><a href="#Expression.error_messages-617"><span class="linenos">617</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-618"><a href="#Expression.error_messages-618"><span class="linenos">618</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-619"><a href="#Expression.error_messages-619"><span class="linenos">619</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-620"><a href="#Expression.error_messages-620"><span class="linenos">620</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-621"><a href="#Expression.error_messages-621"><span class="linenos">621</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-622"><a href="#Expression.error_messages-622"><span class="linenos">622</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-623"><a href="#Expression.error_messages-623"><span class="linenos">623</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-624"><a href="#Expression.error_messages-624"><span class="linenos">624</span></a> +</span><span id="Expression.error_messages-625"><a href="#Expression.error_messages-625"><span class="linenos">625</span></a> <span class="k">if</span> <span class="p">(</span> +</span><span id="Expression.error_messages-626"><a href="#Expression.error_messages-626"><span class="linenos">626</span></a> <span class="n">args</span> +</span><span id="Expression.error_messages-627"><a href="#Expression.error_messages-627"><span class="linenos">627</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-628"><a href="#Expression.error_messages-628"><span class="linenos">628</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-629"><a href="#Expression.error_messages-629"><span class="linenos">629</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-630"><a href="#Expression.error_messages-630"><span class="linenos">630</span></a> <span class="p">):</span> +</span><span id="Expression.error_messages-631"><a href="#Expression.error_messages-631"><span class="linenos">631</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-632"><a href="#Expression.error_messages-632"><span class="linenos">632</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-633"><a href="#Expression.error_messages-633"><span class="linenos">633</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-634"><a href="#Expression.error_messages-634"><span class="linenos">634</span></a> <span class="p">)</span> +</span><span id="Expression.error_messages-635"><a href="#Expression.error_messages-635"><span class="linenos">635</span></a> +</span><span id="Expression.error_messages-636"><a href="#Expression.error_messages-636"><span class="linenos">636</span></a> <span class="k">return</span> <span class="n">errors</span> </span></pre></div> @@ -13497,13 +13506,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-641"><a href="#Expression.dump-641"><span class="linenos">641</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-642"><a href="#Expression.dump-642"><span class="linenos">642</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.dump-643"><a href="#Expression.dump-643"><span class="linenos">643</span></a><span class="sd"> Dump this Expression to a JSON-serializable dict.</span> -</span><span id="Expression.dump-644"><a href="#Expression.dump-644"><span class="linenos">644</span></a><span class="sd"> """</span> -</span><span id="Expression.dump-645"><a href="#Expression.dump-645"><span class="linenos">645</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-646"><a href="#Expression.dump-646"><span class="linenos">646</span></a> -</span><span id="Expression.dump-647"><a href="#Expression.dump-647"><span class="linenos">647</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-638"><a href="#Expression.dump-638"><span class="linenos">638</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-639"><a href="#Expression.dump-639"><span class="linenos">639</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.dump-640"><a href="#Expression.dump-640"><span class="linenos">640</span></a><span class="sd"> Dump this Expression to a JSON-serializable dict.</span> +</span><span id="Expression.dump-641"><a href="#Expression.dump-641"><span class="linenos">641</span></a><span class="sd"> """</span> +</span><span id="Expression.dump-642"><a href="#Expression.dump-642"><span class="linenos">642</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-643"><a href="#Expression.dump-643"><span class="linenos">643</span></a> +</span><span id="Expression.dump-644"><a href="#Expression.dump-644"><span class="linenos">644</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> @@ -13524,14 +13533,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-649"><a href="#Expression.load-649"><span class="linenos">649</span></a> <span class="nd">@classmethod</span> -</span><span id="Expression.load-650"><a href="#Expression.load-650"><span class="linenos">650</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-651"><a href="#Expression.load-651"><span class="linenos">651</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.load-652"><a href="#Expression.load-652"><span class="linenos">652</span></a><span class="sd"> Load a dict (as returned by `Expression.dump`) into an Expression instance.</span> -</span><span id="Expression.load-653"><a href="#Expression.load-653"><span class="linenos">653</span></a><span class="sd"> """</span> -</span><span id="Expression.load-654"><a href="#Expression.load-654"><span class="linenos">654</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-655"><a href="#Expression.load-655"><span class="linenos">655</span></a> -</span><span id="Expression.load-656"><a href="#Expression.load-656"><span class="linenos">656</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-646"><a href="#Expression.load-646"><span class="linenos">646</span></a> <span class="nd">@classmethod</span> +</span><span id="Expression.load-647"><a href="#Expression.load-647"><span class="linenos">647</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-648"><a href="#Expression.load-648"><span class="linenos">648</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.load-649"><a href="#Expression.load-649"><span class="linenos">649</span></a><span class="sd"> Load a dict (as returned by `Expression.dump`) into an Expression instance.</span> +</span><span id="Expression.load-650"><a href="#Expression.load-650"><span class="linenos">650</span></a><span class="sd"> """</span> +</span><span id="Expression.load-651"><a href="#Expression.load-651"><span class="linenos">651</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-652"><a href="#Expression.load-652"><span class="linenos">652</span></a> +</span><span id="Expression.load-653"><a href="#Expression.load-653"><span class="linenos">653</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> @@ -13577,205 +13586,205 @@ 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-667"><a href="#Condition-667"><span class="linenos">667</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-668"><a href="#Condition-668"><span class="linenos">668</span></a> <span class="k">def</span> <span class="nf">and_</span><span class="p">(</span> -</span><span id="Condition-669"><a href="#Condition-669"><span class="linenos">669</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Condition-670"><a href="#Condition-670"><span class="linenos">670</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Condition-671"><a href="#Condition-671"><span class="linenos">671</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="Condition-672"><a href="#Condition-672"><span class="linenos">672</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="Condition-673"><a href="#Condition-673"><span class="linenos">673</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Condition-674"><a href="#Condition-674"><span class="linenos">674</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="Condition-675"><a href="#Condition-675"><span class="linenos">675</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Condition-676"><a href="#Condition-676"><span class="linenos">676</span></a><span class="sd"> AND this condition with one or multiple expressions.</span> -</span><span id="Condition-677"><a href="#Condition-677"><span class="linenos">677</span></a> -</span><span id="Condition-678"><a href="#Condition-678"><span class="linenos">678</span></a><span class="sd"> Example:</span> -</span><span id="Condition-679"><a href="#Condition-679"><span class="linenos">679</span></a><span class="sd"> >>> condition("x=1").and_("y=1").sql()</span> -</span><span id="Condition-680"><a href="#Condition-680"><span class="linenos">680</span></a><span class="sd"> 'x = 1 AND y = 1'</span> -</span><span id="Condition-681"><a href="#Condition-681"><span class="linenos">681</span></a> -</span><span id="Condition-682"><a href="#Condition-682"><span class="linenos">682</span></a><span class="sd"> Args:</span> -</span><span id="Condition-683"><a href="#Condition-683"><span class="linenos">683</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Condition-684"><a href="#Condition-684"><span class="linenos">684</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Condition-685"><a href="#Condition-685"><span class="linenos">685</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Condition-686"><a href="#Condition-686"><span class="linenos">686</span></a><span class="sd"> copy: whether or not to copy the involved expressions (only applies to Expressions).</span> -</span><span id="Condition-687"><a href="#Condition-687"><span class="linenos">687</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Condition-688"><a href="#Condition-688"><span class="linenos">688</span></a> -</span><span id="Condition-689"><a href="#Condition-689"><span class="linenos">689</span></a><span class="sd"> Returns:</span> -</span><span id="Condition-690"><a href="#Condition-690"><span class="linenos">690</span></a><span class="sd"> The new And condition.</span> -</span><span id="Condition-691"><a href="#Condition-691"><span class="linenos">691</span></a><span class="sd"> """</span> -</span><span id="Condition-692"><a href="#Condition-692"><span class="linenos">692</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Condition-693"><a href="#Condition-693"><span class="linenos">693</span></a> -</span><span id="Condition-694"><a href="#Condition-694"><span class="linenos">694</span></a> <span class="k">def</span> <span class="nf">or_</span><span class="p">(</span> -</span><span id="Condition-695"><a href="#Condition-695"><span class="linenos">695</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Condition-696"><a href="#Condition-696"><span class="linenos">696</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Condition-697"><a href="#Condition-697"><span class="linenos">697</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="Condition-698"><a href="#Condition-698"><span class="linenos">698</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="Condition-699"><a href="#Condition-699"><span class="linenos">699</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Condition-700"><a href="#Condition-700"><span class="linenos">700</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="Condition-701"><a href="#Condition-701"><span class="linenos">701</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Condition-702"><a href="#Condition-702"><span class="linenos">702</span></a><span class="sd"> OR this condition with one or multiple expressions.</span> -</span><span id="Condition-703"><a href="#Condition-703"><span class="linenos">703</span></a> -</span><span id="Condition-704"><a href="#Condition-704"><span class="linenos">704</span></a><span class="sd"> Example:</span> -</span><span id="Condition-705"><a href="#Condition-705"><span class="linenos">705</span></a><span class="sd"> >>> condition("x=1").or_("y=1").sql()</span> -</span><span id="Condition-706"><a href="#Condition-706"><span class="linenos">706</span></a><span class="sd"> 'x = 1 OR y = 1'</span> -</span><span id="Condition-707"><a href="#Condition-707"><span class="linenos">707</span></a> -</span><span id="Condition-708"><a href="#Condition-708"><span class="linenos">708</span></a><span class="sd"> Args:</span> -</span><span id="Condition-709"><a href="#Condition-709"><span class="linenos">709</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Condition-710"><a href="#Condition-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="Condition-711"><a href="#Condition-711"><span class="linenos">711</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Condition-712"><a href="#Condition-712"><span class="linenos">712</span></a><span class="sd"> copy: whether or not to copy the involved expressions (only applies to Expressions).</span> -</span><span id="Condition-713"><a href="#Condition-713"><span class="linenos">713</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Condition-714"><a href="#Condition-714"><span class="linenos">714</span></a> -</span><span id="Condition-715"><a href="#Condition-715"><span class="linenos">715</span></a><span class="sd"> Returns:</span> -</span><span id="Condition-716"><a href="#Condition-716"><span class="linenos">716</span></a><span class="sd"> The new Or condition.</span> -</span><span id="Condition-717"><a href="#Condition-717"><span class="linenos">717</span></a><span class="sd"> """</span> -</span><span id="Condition-718"><a href="#Condition-718"><span class="linenos">718</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Condition-719"><a href="#Condition-719"><span class="linenos">719</span></a> -</span><span id="Condition-720"><a href="#Condition-720"><span class="linenos">720</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 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="Condition-721"><a href="#Condition-721"><span class="linenos">721</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Condition-722"><a href="#Condition-722"><span class="linenos">722</span></a><span class="sd"> Wrap this condition with NOT.</span> -</span><span id="Condition-723"><a href="#Condition-723"><span class="linenos">723</span></a> -</span><span id="Condition-724"><a href="#Condition-724"><span class="linenos">724</span></a><span class="sd"> Example:</span> -</span><span id="Condition-725"><a href="#Condition-725"><span class="linenos">725</span></a><span class="sd"> >>> condition("x=1").not_().sql()</span> -</span><span id="Condition-726"><a href="#Condition-726"><span class="linenos">726</span></a><span class="sd"> 'NOT x = 1'</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition-664"><a href="#Condition-664"><span class="linenos">664</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-665"><a href="#Condition-665"><span class="linenos">665</span></a> <span class="k">def</span> <span class="nf">and_</span><span class="p">(</span> +</span><span id="Condition-666"><a href="#Condition-666"><span class="linenos">666</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Condition-667"><a href="#Condition-667"><span class="linenos">667</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Condition-668"><a href="#Condition-668"><span class="linenos">668</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="Condition-669"><a href="#Condition-669"><span class="linenos">669</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="Condition-670"><a href="#Condition-670"><span class="linenos">670</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Condition-671"><a href="#Condition-671"><span class="linenos">671</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="Condition-672"><a href="#Condition-672"><span class="linenos">672</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Condition-673"><a href="#Condition-673"><span class="linenos">673</span></a><span class="sd"> AND this condition with one or multiple expressions.</span> +</span><span id="Condition-674"><a href="#Condition-674"><span class="linenos">674</span></a> +</span><span id="Condition-675"><a href="#Condition-675"><span class="linenos">675</span></a><span class="sd"> Example:</span> +</span><span id="Condition-676"><a href="#Condition-676"><span class="linenos">676</span></a><span class="sd"> >>> condition("x=1").and_("y=1").sql()</span> +</span><span id="Condition-677"><a href="#Condition-677"><span class="linenos">677</span></a><span class="sd"> 'x = 1 AND y = 1'</span> +</span><span id="Condition-678"><a href="#Condition-678"><span class="linenos">678</span></a> +</span><span id="Condition-679"><a href="#Condition-679"><span class="linenos">679</span></a><span class="sd"> Args:</span> +</span><span id="Condition-680"><a href="#Condition-680"><span class="linenos">680</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Condition-681"><a href="#Condition-681"><span class="linenos">681</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Condition-682"><a href="#Condition-682"><span class="linenos">682</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Condition-683"><a href="#Condition-683"><span class="linenos">683</span></a><span class="sd"> copy: whether or not to copy the involved expressions (only applies to Expressions).</span> +</span><span id="Condition-684"><a href="#Condition-684"><span class="linenos">684</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Condition-685"><a href="#Condition-685"><span class="linenos">685</span></a> +</span><span id="Condition-686"><a href="#Condition-686"><span class="linenos">686</span></a><span class="sd"> Returns:</span> +</span><span id="Condition-687"><a href="#Condition-687"><span class="linenos">687</span></a><span class="sd"> The new And condition.</span> +</span><span id="Condition-688"><a href="#Condition-688"><span class="linenos">688</span></a><span class="sd"> """</span> +</span><span id="Condition-689"><a href="#Condition-689"><span class="linenos">689</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Condition-690"><a href="#Condition-690"><span class="linenos">690</span></a> +</span><span id="Condition-691"><a href="#Condition-691"><span class="linenos">691</span></a> <span class="k">def</span> <span class="nf">or_</span><span class="p">(</span> +</span><span id="Condition-692"><a href="#Condition-692"><span class="linenos">692</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Condition-693"><a href="#Condition-693"><span class="linenos">693</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Condition-694"><a href="#Condition-694"><span class="linenos">694</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="Condition-695"><a href="#Condition-695"><span class="linenos">695</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="Condition-696"><a href="#Condition-696"><span class="linenos">696</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Condition-697"><a href="#Condition-697"><span class="linenos">697</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="Condition-698"><a href="#Condition-698"><span class="linenos">698</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Condition-699"><a href="#Condition-699"><span class="linenos">699</span></a><span class="sd"> OR this condition with one or multiple expressions.</span> +</span><span id="Condition-700"><a href="#Condition-700"><span class="linenos">700</span></a> +</span><span id="Condition-701"><a href="#Condition-701"><span class="linenos">701</span></a><span class="sd"> Example:</span> +</span><span id="Condition-702"><a href="#Condition-702"><span class="linenos">702</span></a><span class="sd"> >>> condition("x=1").or_("y=1").sql()</span> +</span><span id="Condition-703"><a href="#Condition-703"><span class="linenos">703</span></a><span class="sd"> 'x = 1 OR y = 1'</span> +</span><span id="Condition-704"><a href="#Condition-704"><span class="linenos">704</span></a> +</span><span id="Condition-705"><a href="#Condition-705"><span class="linenos">705</span></a><span class="sd"> Args:</span> +</span><span id="Condition-706"><a href="#Condition-706"><span class="linenos">706</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Condition-707"><a href="#Condition-707"><span class="linenos">707</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Condition-708"><a href="#Condition-708"><span class="linenos">708</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Condition-709"><a href="#Condition-709"><span class="linenos">709</span></a><span class="sd"> copy: whether or not to copy the involved expressions (only applies to Expressions).</span> +</span><span id="Condition-710"><a href="#Condition-710"><span class="linenos">710</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Condition-711"><a href="#Condition-711"><span class="linenos">711</span></a> +</span><span id="Condition-712"><a href="#Condition-712"><span class="linenos">712</span></a><span class="sd"> Returns:</span> +</span><span id="Condition-713"><a href="#Condition-713"><span class="linenos">713</span></a><span class="sd"> The new Or condition.</span> +</span><span id="Condition-714"><a href="#Condition-714"><span class="linenos">714</span></a><span class="sd"> """</span> +</span><span id="Condition-715"><a href="#Condition-715"><span class="linenos">715</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Condition-716"><a href="#Condition-716"><span class="linenos">716</span></a> +</span><span id="Condition-717"><a href="#Condition-717"><span class="linenos">717</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 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="Condition-718"><a href="#Condition-718"><span class="linenos">718</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Condition-719"><a href="#Condition-719"><span class="linenos">719</span></a><span class="sd"> Wrap this condition with NOT.</span> +</span><span id="Condition-720"><a href="#Condition-720"><span class="linenos">720</span></a> +</span><span id="Condition-721"><a href="#Condition-721"><span class="linenos">721</span></a><span class="sd"> Example:</span> +</span><span id="Condition-722"><a href="#Condition-722"><span class="linenos">722</span></a><span class="sd"> >>> condition("x=1").not_().sql()</span> +</span><span id="Condition-723"><a href="#Condition-723"><span class="linenos">723</span></a><span class="sd"> 'NOT x = 1'</span> +</span><span id="Condition-724"><a href="#Condition-724"><span class="linenos">724</span></a> +</span><span id="Condition-725"><a href="#Condition-725"><span class="linenos">725</span></a><span class="sd"> Args:</span> +</span><span id="Condition-726"><a href="#Condition-726"><span class="linenos">726</span></a><span class="sd"> copy: whether or not to copy this object.</span> </span><span id="Condition-727"><a href="#Condition-727"><span class="linenos">727</span></a> -</span><span id="Condition-728"><a href="#Condition-728"><span class="linenos">728</span></a><span class="sd"> Args:</span> -</span><span id="Condition-729"><a href="#Condition-729"><span class="linenos">729</span></a><span class="sd"> copy: whether or not to copy this object.</span> -</span><span id="Condition-730"><a href="#Condition-730"><span class="linenos">730</span></a> -</span><span id="Condition-731"><a href="#Condition-731"><span class="linenos">731</span></a><span class="sd"> Returns:</span> -</span><span id="Condition-732"><a href="#Condition-732"><span class="linenos">732</span></a><span class="sd"> The new Not instance.</span> -</span><span id="Condition-733"><a href="#Condition-733"><span class="linenos">733</span></a><span class="sd"> """</span> -</span><span id="Condition-734"><a href="#Condition-734"><span class="linenos">734</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 class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> -</span><span id="Condition-735"><a href="#Condition-735"><span class="linenos">735</span></a> -</span><span id="Condition-736"><a href="#Condition-736"><span class="linenos">736</span></a> <span class="k">def</span> <span class="nf">as_</span><span class="p">(</span> -</span><span id="Condition-737"><a href="#Condition-737"><span class="linenos">737</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Condition-738"><a href="#Condition-738"><span class="linenos">738</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="Condition-739"><a href="#Condition-739"><span class="linenos">739</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="Condition-740"><a href="#Condition-740"><span class="linenos">740</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="Condition-741"><a href="#Condition-741"><span class="linenos">741</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="Condition-742"><a href="#Condition-742"><span class="linenos">742</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Condition-743"><a href="#Condition-743"><span class="linenos">743</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Alias</span><span class="p">:</span> -</span><span id="Condition-744"><a href="#Condition-744"><span class="linenos">744</span></a> <span class="k">return</span> <span class="n">alias_</span><span class="p">(</span><span class="bp">self</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 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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Condition-745"><a href="#Condition-745"><span class="linenos">745</span></a> -</span><span id="Condition-746"><a href="#Condition-746"><span class="linenos">746</span></a> <span class="k">def</span> <span class="nf">_binop</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">klass</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">E</span><span class="p">],</span> <span class="n">other</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="n">reverse</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> -</span><span id="Condition-747"><a href="#Condition-747"><span class="linenos">747</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><span id="Condition-748"><a href="#Condition-748"><span class="linenos">748</span></a> <span class="n">other</span> <span class="o">=</span> <span class="n">convert</span><span class="p">(</span><span class="n">other</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="Condition-749"><a href="#Condition-749"><span class="linenos">749</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">klass</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">other</span><span class="p">,</span> <span class="n">klass</span><span class="p">):</span> -</span><span id="Condition-750"><a href="#Condition-750"><span class="linenos">750</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">_wrap</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">Binary</span><span class="p">)</span> -</span><span id="Condition-751"><a href="#Condition-751"><span class="linenos">751</span></a> <span class="n">other</span> <span class="o">=</span> <span class="n">_wrap</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="n">Binary</span><span class="p">)</span> -</span><span id="Condition-752"><a href="#Condition-752"><span class="linenos">752</span></a> <span class="k">if</span> <span class="n">reverse</span><span class="p">:</span> -</span><span id="Condition-753"><a href="#Condition-753"><span class="linenos">753</span></a> <span class="k">return</span> <span class="n">klass</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">other</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">this</span><span class="p">)</span> -</span><span id="Condition-754"><a href="#Condition-754"><span class="linenos">754</span></a> <span class="k">return</span> <span class="n">klass</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">other</span><span class="p">)</span> -</span><span id="Condition-755"><a href="#Condition-755"><span class="linenos">755</span></a> -</span><span id="Condition-756"><a href="#Condition-756"><span class="linenos">756</span></a> <span class="k">def</span> <span class="fm">__getitem__</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="n">ExpOrStr</span> <span class="o">|</span> <span class="n">t</span><span class="o">.</span><span class="n">Tuple</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]):</span> -</span><span id="Condition-757"><a href="#Condition-757"><span class="linenos">757</span></a> <span class="k">return</span> <span class="n">Bracket</span><span class="p">(</span> -</span><span id="Condition-758"><a href="#Condition-758"><span class="linenos">758</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="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">e</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="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">ensure_list</span><span class="p">(</span><span class="n">other</span><span class="p">)]</span> -</span><span id="Condition-759"><a href="#Condition-759"><span class="linenos">759</span></a> <span class="p">)</span> -</span><span id="Condition-760"><a href="#Condition-760"><span class="linenos">760</span></a> -</span><span id="Condition-761"><a href="#Condition-761"><span class="linenos">761</span></a> <span class="k">def</span> <span class="nf">isin</span><span class="p">(</span> -</span><span id="Condition-762"><a href="#Condition-762"><span class="linenos">762</span></a> <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">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="n">query</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">opts</span> -</span><span id="Condition-763"><a href="#Condition-763"><span class="linenos">763</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">In</span><span class="p">:</span> -</span><span id="Condition-764"><a href="#Condition-764"><span class="linenos">764</span></a> <span class="k">return</span> <span class="n">In</span><span class="p">(</span> -</span><span id="Condition-765"><a href="#Condition-765"><span class="linenos">765</span></a> <span class="n">this</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="Condition-766"><a href="#Condition-766"><span class="linenos">766</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">e</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">],</span> -</span><span id="Condition-767"><a href="#Condition-767"><span class="linenos">767</span></a> <span class="n">query</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">if</span> <span class="n">query</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Condition-768"><a href="#Condition-768"><span class="linenos">768</span></a> <span class="p">)</span> -</span><span id="Condition-769"><a href="#Condition-769"><span class="linenos">769</span></a> -</span><span id="Condition-770"><a href="#Condition-770"><span class="linenos">770</span></a> <span class="k">def</span> <span class="nf">between</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">low</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="n">high</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="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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Between</span><span class="p">:</span> -</span><span id="Condition-771"><a href="#Condition-771"><span class="linenos">771</span></a> <span class="k">return</span> <span class="n">Between</span><span class="p">(</span> -</span><span id="Condition-772"><a href="#Condition-772"><span class="linenos">772</span></a> <span class="n">this</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="Condition-773"><a href="#Condition-773"><span class="linenos">773</span></a> <span class="n">low</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">low</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="Condition-774"><a href="#Condition-774"><span class="linenos">774</span></a> <span class="n">high</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">high</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="Condition-775"><a href="#Condition-775"><span class="linenos">775</span></a> <span class="p">)</span> +</span><span id="Condition-728"><a href="#Condition-728"><span class="linenos">728</span></a><span class="sd"> Returns:</span> +</span><span id="Condition-729"><a href="#Condition-729"><span class="linenos">729</span></a><span class="sd"> The new Not instance.</span> +</span><span id="Condition-730"><a href="#Condition-730"><span class="linenos">730</span></a><span class="sd"> """</span> +</span><span id="Condition-731"><a href="#Condition-731"><span class="linenos">731</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 class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> +</span><span id="Condition-732"><a href="#Condition-732"><span class="linenos">732</span></a> +</span><span id="Condition-733"><a href="#Condition-733"><span class="linenos">733</span></a> <span class="k">def</span> <span class="nf">as_</span><span class="p">(</span> +</span><span id="Condition-734"><a href="#Condition-734"><span class="linenos">734</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Condition-735"><a href="#Condition-735"><span class="linenos">735</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="Condition-736"><a href="#Condition-736"><span class="linenos">736</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="Condition-737"><a href="#Condition-737"><span class="linenos">737</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="Condition-738"><a href="#Condition-738"><span class="linenos">738</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="Condition-739"><a href="#Condition-739"><span class="linenos">739</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Condition-740"><a href="#Condition-740"><span class="linenos">740</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Alias</span><span class="p">:</span> +</span><span id="Condition-741"><a href="#Condition-741"><span class="linenos">741</span></a> <span class="k">return</span> <span class="n">alias_</span><span class="p">(</span><span class="bp">self</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 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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Condition-742"><a href="#Condition-742"><span class="linenos">742</span></a> +</span><span id="Condition-743"><a href="#Condition-743"><span class="linenos">743</span></a> <span class="k">def</span> <span class="nf">_binop</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">klass</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">E</span><span class="p">],</span> <span class="n">other</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="n">reverse</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-></span> <span class="n">E</span><span class="p">:</span> +</span><span id="Condition-744"><a href="#Condition-744"><span class="linenos">744</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><span id="Condition-745"><a href="#Condition-745"><span class="linenos">745</span></a> <span class="n">other</span> <span class="o">=</span> <span class="n">convert</span><span class="p">(</span><span class="n">other</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="Condition-746"><a href="#Condition-746"><span class="linenos">746</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">klass</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">other</span><span class="p">,</span> <span class="n">klass</span><span class="p">):</span> +</span><span id="Condition-747"><a href="#Condition-747"><span class="linenos">747</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">_wrap</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">Binary</span><span class="p">)</span> +</span><span id="Condition-748"><a href="#Condition-748"><span class="linenos">748</span></a> <span class="n">other</span> <span class="o">=</span> <span class="n">_wrap</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="n">Binary</span><span class="p">)</span> +</span><span id="Condition-749"><a href="#Condition-749"><span class="linenos">749</span></a> <span class="k">if</span> <span class="n">reverse</span><span class="p">:</span> +</span><span id="Condition-750"><a href="#Condition-750"><span class="linenos">750</span></a> <span class="k">return</span> <span class="n">klass</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">other</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">this</span><span class="p">)</span> +</span><span id="Condition-751"><a href="#Condition-751"><span class="linenos">751</span></a> <span class="k">return</span> <span class="n">klass</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">other</span><span class="p">)</span> +</span><span id="Condition-752"><a href="#Condition-752"><span class="linenos">752</span></a> +</span><span id="Condition-753"><a href="#Condition-753"><span class="linenos">753</span></a> <span class="k">def</span> <span class="fm">__getitem__</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="n">ExpOrStr</span> <span class="o">|</span> <span class="n">t</span><span class="o">.</span><span class="n">Tuple</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]):</span> +</span><span id="Condition-754"><a href="#Condition-754"><span class="linenos">754</span></a> <span class="k">return</span> <span class="n">Bracket</span><span class="p">(</span> +</span><span id="Condition-755"><a href="#Condition-755"><span class="linenos">755</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="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">e</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="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">ensure_list</span><span class="p">(</span><span class="n">other</span><span class="p">)]</span> +</span><span id="Condition-756"><a href="#Condition-756"><span class="linenos">756</span></a> <span class="p">)</span> +</span><span id="Condition-757"><a href="#Condition-757"><span class="linenos">757</span></a> +</span><span id="Condition-758"><a href="#Condition-758"><span class="linenos">758</span></a> <span class="k">def</span> <span class="nf">isin</span><span class="p">(</span> +</span><span id="Condition-759"><a href="#Condition-759"><span class="linenos">759</span></a> <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">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="n">query</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">opts</span> +</span><span id="Condition-760"><a href="#Condition-760"><span class="linenos">760</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">In</span><span class="p">:</span> +</span><span id="Condition-761"><a href="#Condition-761"><span class="linenos">761</span></a> <span class="k">return</span> <span class="n">In</span><span class="p">(</span> +</span><span id="Condition-762"><a href="#Condition-762"><span class="linenos">762</span></a> <span class="n">this</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="Condition-763"><a href="#Condition-763"><span class="linenos">763</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">e</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">],</span> +</span><span id="Condition-764"><a href="#Condition-764"><span class="linenos">764</span></a> <span class="n">query</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">if</span> <span class="n">query</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Condition-765"><a href="#Condition-765"><span class="linenos">765</span></a> <span class="p">)</span> +</span><span id="Condition-766"><a href="#Condition-766"><span class="linenos">766</span></a> +</span><span id="Condition-767"><a href="#Condition-767"><span class="linenos">767</span></a> <span class="k">def</span> <span class="nf">between</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">low</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="n">high</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="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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Between</span><span class="p">:</span> +</span><span id="Condition-768"><a href="#Condition-768"><span class="linenos">768</span></a> <span class="k">return</span> <span class="n">Between</span><span class="p">(</span> +</span><span id="Condition-769"><a href="#Condition-769"><span class="linenos">769</span></a> <span class="n">this</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="Condition-770"><a href="#Condition-770"><span class="linenos">770</span></a> <span class="n">low</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">low</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="Condition-771"><a href="#Condition-771"><span class="linenos">771</span></a> <span class="n">high</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">high</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="Condition-772"><a href="#Condition-772"><span class="linenos">772</span></a> <span class="p">)</span> +</span><span id="Condition-773"><a href="#Condition-773"><span class="linenos">773</span></a> +</span><span id="Condition-774"><a href="#Condition-774"><span class="linenos">774</span></a> <span class="k">def</span> <span class="nf">is_</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">Is</span><span class="p">:</span> +</span><span id="Condition-775"><a href="#Condition-775"><span class="linenos">775</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Is</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-776"><a href="#Condition-776"><span class="linenos">776</span></a> -</span><span id="Condition-777"><a href="#Condition-777"><span class="linenos">777</span></a> <span class="k">def</span> <span class="nf">is_</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">Is</span><span class="p">:</span> -</span><span id="Condition-778"><a href="#Condition-778"><span class="linenos">778</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Is</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-777"><a href="#Condition-777"><span class="linenos">777</span></a> <span class="k">def</span> <span class="nf">like</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">Like</span><span class="p">:</span> +</span><span id="Condition-778"><a href="#Condition-778"><span class="linenos">778</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Like</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-779"><a href="#Condition-779"><span class="linenos">779</span></a> -</span><span id="Condition-780"><a href="#Condition-780"><span class="linenos">780</span></a> <span class="k">def</span> <span class="nf">like</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">Like</span><span class="p">:</span> -</span><span id="Condition-781"><a href="#Condition-781"><span class="linenos">781</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Like</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-780"><a href="#Condition-780"><span class="linenos">780</span></a> <span class="k">def</span> <span class="nf">ilike</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">ILike</span><span class="p">:</span> +</span><span id="Condition-781"><a href="#Condition-781"><span class="linenos">781</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">ILike</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-782"><a href="#Condition-782"><span class="linenos">782</span></a> -</span><span id="Condition-783"><a href="#Condition-783"><span class="linenos">783</span></a> <span class="k">def</span> <span class="nf">ilike</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">ILike</span><span class="p">:</span> -</span><span id="Condition-784"><a href="#Condition-784"><span class="linenos">784</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">ILike</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-783"><a href="#Condition-783"><span class="linenos">783</span></a> <span class="k">def</span> <span class="nf">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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">EQ</span><span class="p">:</span> +</span><span id="Condition-784"><a href="#Condition-784"><span class="linenos">784</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">EQ</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-785"><a href="#Condition-785"><span class="linenos">785</span></a> -</span><span id="Condition-786"><a href="#Condition-786"><span class="linenos">786</span></a> <span class="k">def</span> <span class="nf">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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">EQ</span><span class="p">:</span> -</span><span id="Condition-787"><a href="#Condition-787"><span class="linenos">787</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">EQ</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-786"><a href="#Condition-786"><span class="linenos">786</span></a> <span class="k">def</span> <span class="nf">neq</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">NEQ</span><span class="p">:</span> +</span><span id="Condition-787"><a href="#Condition-787"><span class="linenos">787</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">NEQ</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-788"><a href="#Condition-788"><span class="linenos">788</span></a> -</span><span id="Condition-789"><a href="#Condition-789"><span class="linenos">789</span></a> <span class="k">def</span> <span class="nf">neq</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">NEQ</span><span class="p">:</span> -</span><span id="Condition-790"><a href="#Condition-790"><span class="linenos">790</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">NEQ</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-789"><a href="#Condition-789"><span class="linenos">789</span></a> <span class="k">def</span> <span class="nf">rlike</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">RegexpLike</span><span class="p">:</span> +</span><span id="Condition-790"><a href="#Condition-790"><span class="linenos">790</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">RegexpLike</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-791"><a href="#Condition-791"><span class="linenos">791</span></a> -</span><span id="Condition-792"><a href="#Condition-792"><span class="linenos">792</span></a> <span class="k">def</span> <span class="nf">rlike</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">RegexpLike</span><span class="p">:</span> -</span><span id="Condition-793"><a href="#Condition-793"><span class="linenos">793</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">RegexpLike</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-792"><a href="#Condition-792"><span class="linenos">792</span></a> <span class="k">def</span> <span class="fm">__lt__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">LT</span><span class="p">:</span> +</span><span id="Condition-793"><a href="#Condition-793"><span class="linenos">793</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">LT</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-794"><a href="#Condition-794"><span class="linenos">794</span></a> -</span><span id="Condition-795"><a href="#Condition-795"><span class="linenos">795</span></a> <span class="k">def</span> <span class="fm">__lt__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">LT</span><span class="p">:</span> -</span><span id="Condition-796"><a href="#Condition-796"><span class="linenos">796</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">LT</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-795"><a href="#Condition-795"><span class="linenos">795</span></a> <span class="k">def</span> <span class="fm">__le__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">LTE</span><span class="p">:</span> +</span><span id="Condition-796"><a href="#Condition-796"><span class="linenos">796</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">LTE</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-797"><a href="#Condition-797"><span class="linenos">797</span></a> -</span><span id="Condition-798"><a href="#Condition-798"><span class="linenos">798</span></a> <span class="k">def</span> <span class="fm">__le__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">LTE</span><span class="p">:</span> -</span><span id="Condition-799"><a href="#Condition-799"><span class="linenos">799</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">LTE</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-798"><a href="#Condition-798"><span class="linenos">798</span></a> <span class="k">def</span> <span class="fm">__gt__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">GT</span><span class="p">:</span> +</span><span id="Condition-799"><a href="#Condition-799"><span class="linenos">799</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">GT</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-800"><a href="#Condition-800"><span class="linenos">800</span></a> -</span><span id="Condition-801"><a href="#Condition-801"><span class="linenos">801</span></a> <span class="k">def</span> <span class="fm">__gt__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">GT</span><span class="p">:</span> -</span><span id="Condition-802"><a href="#Condition-802"><span class="linenos">802</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">GT</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-801"><a href="#Condition-801"><span class="linenos">801</span></a> <span class="k">def</span> <span class="fm">__ge__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">GTE</span><span class="p">:</span> +</span><span id="Condition-802"><a href="#Condition-802"><span class="linenos">802</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">GTE</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-803"><a href="#Condition-803"><span class="linenos">803</span></a> -</span><span id="Condition-804"><a href="#Condition-804"><span class="linenos">804</span></a> <span class="k">def</span> <span class="fm">__ge__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">GTE</span><span class="p">:</span> -</span><span id="Condition-805"><a href="#Condition-805"><span class="linenos">805</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">GTE</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-804"><a href="#Condition-804"><span class="linenos">804</span></a> <span class="k">def</span> <span class="fm">__add__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Add</span><span class="p">:</span> +</span><span id="Condition-805"><a href="#Condition-805"><span class="linenos">805</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Add</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-806"><a href="#Condition-806"><span class="linenos">806</span></a> -</span><span id="Condition-807"><a href="#Condition-807"><span class="linenos">807</span></a> <span class="k">def</span> <span class="fm">__add__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Add</span><span class="p">:</span> -</span><span id="Condition-808"><a href="#Condition-808"><span class="linenos">808</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Add</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-807"><a href="#Condition-807"><span class="linenos">807</span></a> <span class="k">def</span> <span class="fm">__radd__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Add</span><span class="p">:</span> +</span><span id="Condition-808"><a href="#Condition-808"><span class="linenos">808</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Add</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="Condition-809"><a href="#Condition-809"><span class="linenos">809</span></a> -</span><span id="Condition-810"><a href="#Condition-810"><span class="linenos">810</span></a> <span class="k">def</span> <span class="fm">__radd__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Add</span><span class="p">:</span> -</span><span id="Condition-811"><a href="#Condition-811"><span class="linenos">811</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Add</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Condition-810"><a href="#Condition-810"><span class="linenos">810</span></a> <span class="k">def</span> <span class="fm">__sub__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Sub</span><span class="p">:</span> +</span><span id="Condition-811"><a href="#Condition-811"><span class="linenos">811</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Sub</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-812"><a href="#Condition-812"><span class="linenos">812</span></a> -</span><span id="Condition-813"><a href="#Condition-813"><span class="linenos">813</span></a> <span class="k">def</span> <span class="fm">__sub__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Sub</span><span class="p">:</span> -</span><span id="Condition-814"><a href="#Condition-814"><span class="linenos">814</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Sub</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-813"><a href="#Condition-813"><span class="linenos">813</span></a> <span class="k">def</span> <span class="fm">__rsub__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Sub</span><span class="p">:</span> +</span><span id="Condition-814"><a href="#Condition-814"><span class="linenos">814</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Sub</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="Condition-815"><a href="#Condition-815"><span class="linenos">815</span></a> -</span><span id="Condition-816"><a href="#Condition-816"><span class="linenos">816</span></a> <span class="k">def</span> <span class="fm">__rsub__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Sub</span><span class="p">:</span> -</span><span id="Condition-817"><a href="#Condition-817"><span class="linenos">817</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Sub</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Condition-816"><a href="#Condition-816"><span class="linenos">816</span></a> <span class="k">def</span> <span class="fm">__mul__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mul</span><span class="p">:</span> +</span><span id="Condition-817"><a href="#Condition-817"><span class="linenos">817</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mul</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-818"><a href="#Condition-818"><span class="linenos">818</span></a> -</span><span id="Condition-819"><a href="#Condition-819"><span class="linenos">819</span></a> <span class="k">def</span> <span class="fm">__mul__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mul</span><span class="p">:</span> -</span><span id="Condition-820"><a href="#Condition-820"><span class="linenos">820</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mul</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-819"><a href="#Condition-819"><span class="linenos">819</span></a> <span class="k">def</span> <span class="fm">__rmul__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mul</span><span class="p">:</span> +</span><span id="Condition-820"><a href="#Condition-820"><span class="linenos">820</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mul</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="Condition-821"><a href="#Condition-821"><span class="linenos">821</span></a> -</span><span id="Condition-822"><a href="#Condition-822"><span class="linenos">822</span></a> <span class="k">def</span> <span class="fm">__rmul__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mul</span><span class="p">:</span> -</span><span id="Condition-823"><a href="#Condition-823"><span class="linenos">823</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mul</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Condition-822"><a href="#Condition-822"><span class="linenos">822</span></a> <span class="k">def</span> <span class="fm">__truediv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Div</span><span class="p">:</span> +</span><span id="Condition-823"><a href="#Condition-823"><span class="linenos">823</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Div</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-824"><a href="#Condition-824"><span class="linenos">824</span></a> -</span><span id="Condition-825"><a href="#Condition-825"><span class="linenos">825</span></a> <span class="k">def</span> <span class="fm">__truediv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Div</span><span class="p">:</span> -</span><span id="Condition-826"><a href="#Condition-826"><span class="linenos">826</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Div</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-825"><a href="#Condition-825"><span class="linenos">825</span></a> <span class="k">def</span> <span class="fm">__rtruediv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Div</span><span class="p">:</span> +</span><span id="Condition-826"><a href="#Condition-826"><span class="linenos">826</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Div</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="Condition-827"><a href="#Condition-827"><span class="linenos">827</span></a> -</span><span id="Condition-828"><a href="#Condition-828"><span class="linenos">828</span></a> <span class="k">def</span> <span class="fm">__rtruediv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Div</span><span class="p">:</span> -</span><span id="Condition-829"><a href="#Condition-829"><span class="linenos">829</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Div</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Condition-828"><a href="#Condition-828"><span class="linenos">828</span></a> <span class="k">def</span> <span class="fm">__floordiv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">IntDiv</span><span class="p">:</span> +</span><span id="Condition-829"><a href="#Condition-829"><span class="linenos">829</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">IntDiv</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-830"><a href="#Condition-830"><span class="linenos">830</span></a> -</span><span id="Condition-831"><a href="#Condition-831"><span class="linenos">831</span></a> <span class="k">def</span> <span class="fm">__floordiv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">IntDiv</span><span class="p">:</span> -</span><span id="Condition-832"><a href="#Condition-832"><span class="linenos">832</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">IntDiv</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-831"><a href="#Condition-831"><span class="linenos">831</span></a> <span class="k">def</span> <span class="fm">__rfloordiv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">IntDiv</span><span class="p">:</span> +</span><span id="Condition-832"><a href="#Condition-832"><span class="linenos">832</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">IntDiv</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="Condition-833"><a href="#Condition-833"><span class="linenos">833</span></a> -</span><span id="Condition-834"><a href="#Condition-834"><span class="linenos">834</span></a> <span class="k">def</span> <span class="fm">__rfloordiv__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">IntDiv</span><span class="p">:</span> -</span><span id="Condition-835"><a href="#Condition-835"><span class="linenos">835</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">IntDiv</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Condition-834"><a href="#Condition-834"><span class="linenos">834</span></a> <span class="k">def</span> <span class="fm">__mod__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mod</span><span class="p">:</span> +</span><span id="Condition-835"><a href="#Condition-835"><span class="linenos">835</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mod</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-836"><a href="#Condition-836"><span class="linenos">836</span></a> -</span><span id="Condition-837"><a href="#Condition-837"><span class="linenos">837</span></a> <span class="k">def</span> <span class="fm">__mod__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mod</span><span class="p">:</span> -</span><span id="Condition-838"><a href="#Condition-838"><span class="linenos">838</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mod</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-837"><a href="#Condition-837"><span class="linenos">837</span></a> <span class="k">def</span> <span class="fm">__rmod__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mod</span><span class="p">:</span> +</span><span id="Condition-838"><a href="#Condition-838"><span class="linenos">838</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mod</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="Condition-839"><a href="#Condition-839"><span class="linenos">839</span></a> -</span><span id="Condition-840"><a href="#Condition-840"><span class="linenos">840</span></a> <span class="k">def</span> <span class="fm">__rmod__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Mod</span><span class="p">:</span> -</span><span id="Condition-841"><a href="#Condition-841"><span class="linenos">841</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Mod</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Condition-840"><a href="#Condition-840"><span class="linenos">840</span></a> <span class="k">def</span> <span class="fm">__pow__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Pow</span><span class="p">:</span> +</span><span id="Condition-841"><a href="#Condition-841"><span class="linenos">841</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Pow</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-842"><a href="#Condition-842"><span class="linenos">842</span></a> -</span><span id="Condition-843"><a href="#Condition-843"><span class="linenos">843</span></a> <span class="k">def</span> <span class="fm">__pow__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Pow</span><span class="p">:</span> -</span><span id="Condition-844"><a href="#Condition-844"><span class="linenos">844</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Pow</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-843"><a href="#Condition-843"><span class="linenos">843</span></a> <span class="k">def</span> <span class="fm">__rpow__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Pow</span><span class="p">:</span> +</span><span id="Condition-844"><a href="#Condition-844"><span class="linenos">844</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Pow</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="Condition-845"><a href="#Condition-845"><span class="linenos">845</span></a> -</span><span id="Condition-846"><a href="#Condition-846"><span class="linenos">846</span></a> <span class="k">def</span> <span class="fm">__rpow__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Pow</span><span class="p">:</span> -</span><span id="Condition-847"><a href="#Condition-847"><span class="linenos">847</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Pow</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Condition-846"><a href="#Condition-846"><span class="linenos">846</span></a> <span class="k">def</span> <span class="fm">__and__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">And</span><span class="p">:</span> +</span><span id="Condition-847"><a href="#Condition-847"><span class="linenos">847</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">And</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-848"><a href="#Condition-848"><span class="linenos">848</span></a> -</span><span id="Condition-849"><a href="#Condition-849"><span class="linenos">849</span></a> <span class="k">def</span> <span class="fm">__and__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">And</span><span class="p">:</span> -</span><span id="Condition-850"><a href="#Condition-850"><span class="linenos">850</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">And</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-849"><a href="#Condition-849"><span class="linenos">849</span></a> <span class="k">def</span> <span class="fm">__rand__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">And</span><span class="p">:</span> +</span><span id="Condition-850"><a href="#Condition-850"><span class="linenos">850</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">And</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="Condition-851"><a href="#Condition-851"><span class="linenos">851</span></a> -</span><span id="Condition-852"><a href="#Condition-852"><span class="linenos">852</span></a> <span class="k">def</span> <span class="fm">__rand__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">And</span><span class="p">:</span> -</span><span id="Condition-853"><a href="#Condition-853"><span class="linenos">853</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">And</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Condition-852"><a href="#Condition-852"><span class="linenos">852</span></a> <span class="k">def</span> <span class="fm">__or__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Or</span><span class="p">:</span> +</span><span id="Condition-853"><a href="#Condition-853"><span class="linenos">853</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Or</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span><span id="Condition-854"><a href="#Condition-854"><span class="linenos">854</span></a> -</span><span id="Condition-855"><a href="#Condition-855"><span class="linenos">855</span></a> <span class="k">def</span> <span class="fm">__or__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Or</span><span class="p">:</span> -</span><span id="Condition-856"><a href="#Condition-856"><span class="linenos">856</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Or</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> +</span><span id="Condition-855"><a href="#Condition-855"><span class="linenos">855</span></a> <span class="k">def</span> <span class="fm">__ror__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Or</span><span class="p">:</span> +</span><span id="Condition-856"><a href="#Condition-856"><span class="linenos">856</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Or</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span><span id="Condition-857"><a href="#Condition-857"><span class="linenos">857</span></a> -</span><span id="Condition-858"><a href="#Condition-858"><span class="linenos">858</span></a> <span class="k">def</span> <span class="fm">__ror__</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">Or</span><span class="p">:</span> -</span><span id="Condition-859"><a href="#Condition-859"><span class="linenos">859</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Or</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Condition-858"><a href="#Condition-858"><span class="linenos">858</span></a> <span class="k">def</span> <span class="fm">__neg__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Neg</span><span class="p">:</span> +</span><span id="Condition-859"><a href="#Condition-859"><span class="linenos">859</span></a> <span class="k">return</span> <span class="n">Neg</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">_wrap</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">(),</span> <span class="n">Binary</span><span class="p">))</span> </span><span id="Condition-860"><a href="#Condition-860"><span class="linenos">860</span></a> -</span><span id="Condition-861"><a href="#Condition-861"><span class="linenos">861</span></a> <span class="k">def</span> <span class="fm">__neg__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Neg</span><span class="p">:</span> -</span><span id="Condition-862"><a href="#Condition-862"><span class="linenos">862</span></a> <span class="k">return</span> <span class="n">Neg</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">_wrap</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">(),</span> <span class="n">Binary</span><span class="p">))</span> -</span><span id="Condition-863"><a href="#Condition-863"><span class="linenos">863</span></a> -</span><span id="Condition-864"><a href="#Condition-864"><span class="linenos">864</span></a> <span class="k">def</span> <span class="fm">__invert__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Not</span><span class="p">:</span> -</span><span id="Condition-865"><a href="#Condition-865"><span class="linenos">865</span></a> <span class="k">return</span> <span class="n">not_</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">())</span> +</span><span id="Condition-861"><a href="#Condition-861"><span class="linenos">861</span></a> <span class="k">def</span> <span class="fm">__invert__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Not</span><span class="p">:</span> +</span><span id="Condition-862"><a href="#Condition-862"><span class="linenos">862</span></a> <span class="k">return</span> <span class="n">not_</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">())</span> </span></pre></div> @@ -13792,31 +13801,31 @@ 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_-668"><a href="#Condition.and_-668"><span class="linenos">668</span></a> <span class="k">def</span> <span class="nf">and_</span><span class="p">(</span> -</span><span id="Condition.and_-669"><a href="#Condition.and_-669"><span class="linenos">669</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Condition.and_-670"><a href="#Condition.and_-670"><span class="linenos">670</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Condition.and_-671"><a href="#Condition.and_-671"><span class="linenos">671</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="Condition.and_-672"><a href="#Condition.and_-672"><span class="linenos">672</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="Condition.and_-673"><a href="#Condition.and_-673"><span class="linenos">673</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Condition.and_-674"><a href="#Condition.and_-674"><span class="linenos">674</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="Condition.and_-675"><a href="#Condition.and_-675"><span class="linenos">675</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Condition.and_-676"><a href="#Condition.and_-676"><span class="linenos">676</span></a><span class="sd"> AND this condition with one or multiple expressions.</span> -</span><span id="Condition.and_-677"><a href="#Condition.and_-677"><span class="linenos">677</span></a> -</span><span id="Condition.and_-678"><a href="#Condition.and_-678"><span class="linenos">678</span></a><span class="sd"> Example:</span> -</span><span id="Condition.and_-679"><a href="#Condition.and_-679"><span class="linenos">679</span></a><span class="sd"> >>> condition("x=1").and_("y=1").sql()</span> -</span><span id="Condition.and_-680"><a href="#Condition.and_-680"><span class="linenos">680</span></a><span class="sd"> 'x = 1 AND y = 1'</span> -</span><span id="Condition.and_-681"><a href="#Condition.and_-681"><span class="linenos">681</span></a> -</span><span id="Condition.and_-682"><a href="#Condition.and_-682"><span class="linenos">682</span></a><span class="sd"> Args:</span> -</span><span id="Condition.and_-683"><a href="#Condition.and_-683"><span class="linenos">683</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Condition.and_-684"><a href="#Condition.and_-684"><span class="linenos">684</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Condition.and_-685"><a href="#Condition.and_-685"><span class="linenos">685</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Condition.and_-686"><a href="#Condition.and_-686"><span class="linenos">686</span></a><span class="sd"> copy: whether or not to copy the involved expressions (only applies to Expressions).</span> -</span><span id="Condition.and_-687"><a href="#Condition.and_-687"><span class="linenos">687</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Condition.and_-688"><a href="#Condition.and_-688"><span class="linenos">688</span></a> -</span><span id="Condition.and_-689"><a href="#Condition.and_-689"><span class="linenos">689</span></a><span class="sd"> Returns:</span> -</span><span id="Condition.and_-690"><a href="#Condition.and_-690"><span class="linenos">690</span></a><span class="sd"> The new And condition.</span> -</span><span id="Condition.and_-691"><a href="#Condition.and_-691"><span class="linenos">691</span></a><span class="sd"> """</span> -</span><span id="Condition.and_-692"><a href="#Condition.and_-692"><span class="linenos">692</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="n">copy</span><span class="o">=</span><span class="n">copy</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_-665"><a href="#Condition.and_-665"><span class="linenos">665</span></a> <span class="k">def</span> <span class="nf">and_</span><span class="p">(</span> +</span><span id="Condition.and_-666"><a href="#Condition.and_-666"><span class="linenos">666</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Condition.and_-667"><a href="#Condition.and_-667"><span class="linenos">667</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Condition.and_-668"><a href="#Condition.and_-668"><span class="linenos">668</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="Condition.and_-669"><a href="#Condition.and_-669"><span class="linenos">669</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="Condition.and_-670"><a href="#Condition.and_-670"><span class="linenos">670</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Condition.and_-671"><a href="#Condition.and_-671"><span class="linenos">671</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="Condition.and_-672"><a href="#Condition.and_-672"><span class="linenos">672</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Condition.and_-673"><a href="#Condition.and_-673"><span class="linenos">673</span></a><span class="sd"> AND this condition with one or multiple expressions.</span> +</span><span id="Condition.and_-674"><a href="#Condition.and_-674"><span class="linenos">674</span></a> +</span><span id="Condition.and_-675"><a href="#Condition.and_-675"><span class="linenos">675</span></a><span class="sd"> Example:</span> +</span><span id="Condition.and_-676"><a href="#Condition.and_-676"><span class="linenos">676</span></a><span class="sd"> >>> condition("x=1").and_("y=1").sql()</span> +</span><span id="Condition.and_-677"><a href="#Condition.and_-677"><span class="linenos">677</span></a><span class="sd"> 'x = 1 AND y = 1'</span> +</span><span id="Condition.and_-678"><a href="#Condition.and_-678"><span class="linenos">678</span></a> +</span><span id="Condition.and_-679"><a href="#Condition.and_-679"><span class="linenos">679</span></a><span class="sd"> Args:</span> +</span><span id="Condition.and_-680"><a href="#Condition.and_-680"><span class="linenos">680</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Condition.and_-681"><a href="#Condition.and_-681"><span class="linenos">681</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Condition.and_-682"><a href="#Condition.and_-682"><span class="linenos">682</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Condition.and_-683"><a href="#Condition.and_-683"><span class="linenos">683</span></a><span class="sd"> copy: whether or not to copy the involved expressions (only applies to Expressions).</span> +</span><span id="Condition.and_-684"><a href="#Condition.and_-684"><span class="linenos">684</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Condition.and_-685"><a href="#Condition.and_-685"><span class="linenos">685</span></a> +</span><span id="Condition.and_-686"><a href="#Condition.and_-686"><span class="linenos">686</span></a><span class="sd"> Returns:</span> +</span><span id="Condition.and_-687"><a href="#Condition.and_-687"><span class="linenos">687</span></a><span class="sd"> The new And condition.</span> +</span><span id="Condition.and_-688"><a href="#Condition.and_-688"><span class="linenos">688</span></a><span class="sd"> """</span> +</span><span id="Condition.and_-689"><a href="#Condition.and_-689"><span class="linenos">689</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -13862,31 +13871,31 @@ 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_-694"><a href="#Condition.or_-694"><span class="linenos">694</span></a> <span class="k">def</span> <span class="nf">or_</span><span class="p">(</span> -</span><span id="Condition.or_-695"><a href="#Condition.or_-695"><span class="linenos">695</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Condition.or_-696"><a href="#Condition.or_-696"><span class="linenos">696</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Condition.or_-697"><a href="#Condition.or_-697"><span class="linenos">697</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="Condition.or_-698"><a href="#Condition.or_-698"><span class="linenos">698</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="Condition.or_-699"><a href="#Condition.or_-699"><span class="linenos">699</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Condition.or_-700"><a href="#Condition.or_-700"><span class="linenos">700</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="Condition.or_-701"><a href="#Condition.or_-701"><span class="linenos">701</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Condition.or_-702"><a href="#Condition.or_-702"><span class="linenos">702</span></a><span class="sd"> OR this condition with one or multiple expressions.</span> -</span><span id="Condition.or_-703"><a href="#Condition.or_-703"><span class="linenos">703</span></a> -</span><span id="Condition.or_-704"><a href="#Condition.or_-704"><span class="linenos">704</span></a><span class="sd"> Example:</span> -</span><span id="Condition.or_-705"><a href="#Condition.or_-705"><span class="linenos">705</span></a><span class="sd"> >>> condition("x=1").or_("y=1").sql()</span> -</span><span id="Condition.or_-706"><a href="#Condition.or_-706"><span class="linenos">706</span></a><span class="sd"> 'x = 1 OR y = 1'</span> -</span><span id="Condition.or_-707"><a href="#Condition.or_-707"><span class="linenos">707</span></a> -</span><span id="Condition.or_-708"><a href="#Condition.or_-708"><span class="linenos">708</span></a><span class="sd"> Args:</span> -</span><span id="Condition.or_-709"><a href="#Condition.or_-709"><span class="linenos">709</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Condition.or_-710"><a href="#Condition.or_-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="Condition.or_-711"><a href="#Condition.or_-711"><span class="linenos">711</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Condition.or_-712"><a href="#Condition.or_-712"><span class="linenos">712</span></a><span class="sd"> copy: whether or not to copy the involved expressions (only applies to Expressions).</span> -</span><span id="Condition.or_-713"><a href="#Condition.or_-713"><span class="linenos">713</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Condition.or_-714"><a href="#Condition.or_-714"><span class="linenos">714</span></a> -</span><span id="Condition.or_-715"><a href="#Condition.or_-715"><span class="linenos">715</span></a><span class="sd"> Returns:</span> -</span><span id="Condition.or_-716"><a href="#Condition.or_-716"><span class="linenos">716</span></a><span class="sd"> The new Or condition.</span> -</span><span id="Condition.or_-717"><a href="#Condition.or_-717"><span class="linenos">717</span></a><span class="sd"> """</span> -</span><span id="Condition.or_-718"><a href="#Condition.or_-718"><span class="linenos">718</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="n">copy</span><span class="o">=</span><span class="n">copy</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_-691"><a href="#Condition.or_-691"><span class="linenos">691</span></a> <span class="k">def</span> <span class="nf">or_</span><span class="p">(</span> +</span><span id="Condition.or_-692"><a href="#Condition.or_-692"><span class="linenos">692</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Condition.or_-693"><a href="#Condition.or_-693"><span class="linenos">693</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Condition.or_-694"><a href="#Condition.or_-694"><span class="linenos">694</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="Condition.or_-695"><a href="#Condition.or_-695"><span class="linenos">695</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="Condition.or_-696"><a href="#Condition.or_-696"><span class="linenos">696</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Condition.or_-697"><a href="#Condition.or_-697"><span class="linenos">697</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="Condition.or_-698"><a href="#Condition.or_-698"><span class="linenos">698</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Condition.or_-699"><a href="#Condition.or_-699"><span class="linenos">699</span></a><span class="sd"> OR this condition with one or multiple expressions.</span> +</span><span id="Condition.or_-700"><a href="#Condition.or_-700"><span class="linenos">700</span></a> +</span><span id="Condition.or_-701"><a href="#Condition.or_-701"><span class="linenos">701</span></a><span class="sd"> Example:</span> +</span><span id="Condition.or_-702"><a href="#Condition.or_-702"><span class="linenos">702</span></a><span class="sd"> >>> condition("x=1").or_("y=1").sql()</span> +</span><span id="Condition.or_-703"><a href="#Condition.or_-703"><span class="linenos">703</span></a><span class="sd"> 'x = 1 OR y = 1'</span> +</span><span id="Condition.or_-704"><a href="#Condition.or_-704"><span class="linenos">704</span></a> +</span><span id="Condition.or_-705"><a href="#Condition.or_-705"><span class="linenos">705</span></a><span class="sd"> Args:</span> +</span><span id="Condition.or_-706"><a href="#Condition.or_-706"><span class="linenos">706</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Condition.or_-707"><a href="#Condition.or_-707"><span class="linenos">707</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Condition.or_-708"><a href="#Condition.or_-708"><span class="linenos">708</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Condition.or_-709"><a href="#Condition.or_-709"><span class="linenos">709</span></a><span class="sd"> copy: whether or not to copy the involved expressions (only applies to Expressions).</span> +</span><span id="Condition.or_-710"><a href="#Condition.or_-710"><span class="linenos">710</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Condition.or_-711"><a href="#Condition.or_-711"><span class="linenos">711</span></a> +</span><span id="Condition.or_-712"><a href="#Condition.or_-712"><span class="linenos">712</span></a><span class="sd"> Returns:</span> +</span><span id="Condition.or_-713"><a href="#Condition.or_-713"><span class="linenos">713</span></a><span class="sd"> The new Or condition.</span> +</span><span id="Condition.or_-714"><a href="#Condition.or_-714"><span class="linenos">714</span></a><span class="sd"> """</span> +</span><span id="Condition.or_-715"><a href="#Condition.or_-715"><span class="linenos">715</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -13932,21 +13941,21 @@ 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_-720"><a href="#Condition.not_-720"><span class="linenos">720</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 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="Condition.not_-721"><a href="#Condition.not_-721"><span class="linenos">721</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Condition.not_-722"><a href="#Condition.not_-722"><span class="linenos">722</span></a><span class="sd"> Wrap this condition with NOT.</span> -</span><span id="Condition.not_-723"><a href="#Condition.not_-723"><span class="linenos">723</span></a> -</span><span id="Condition.not_-724"><a href="#Condition.not_-724"><span class="linenos">724</span></a><span class="sd"> Example:</span> -</span><span id="Condition.not_-725"><a href="#Condition.not_-725"><span class="linenos">725</span></a><span class="sd"> >>> condition("x=1").not_().sql()</span> -</span><span id="Condition.not_-726"><a href="#Condition.not_-726"><span class="linenos">726</span></a><span class="sd"> 'NOT x = 1'</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.not_-717"><a href="#Condition.not_-717"><span class="linenos">717</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 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="Condition.not_-718"><a href="#Condition.not_-718"><span class="linenos">718</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Condition.not_-719"><a href="#Condition.not_-719"><span class="linenos">719</span></a><span class="sd"> Wrap this condition with NOT.</span> +</span><span id="Condition.not_-720"><a href="#Condition.not_-720"><span class="linenos">720</span></a> +</span><span id="Condition.not_-721"><a href="#Condition.not_-721"><span class="linenos">721</span></a><span class="sd"> Example:</span> +</span><span id="Condition.not_-722"><a href="#Condition.not_-722"><span class="linenos">722</span></a><span class="sd"> >>> condition("x=1").not_().sql()</span> +</span><span id="Condition.not_-723"><a href="#Condition.not_-723"><span class="linenos">723</span></a><span class="sd"> 'NOT x = 1'</span> +</span><span id="Condition.not_-724"><a href="#Condition.not_-724"><span class="linenos">724</span></a> +</span><span id="Condition.not_-725"><a href="#Condition.not_-725"><span class="linenos">725</span></a><span class="sd"> Args:</span> +</span><span id="Condition.not_-726"><a href="#Condition.not_-726"><span class="linenos">726</span></a><span class="sd"> copy: whether or not to copy this object.</span> </span><span id="Condition.not_-727"><a href="#Condition.not_-727"><span class="linenos">727</span></a> -</span><span id="Condition.not_-728"><a href="#Condition.not_-728"><span class="linenos">728</span></a><span class="sd"> Args:</span> -</span><span id="Condition.not_-729"><a href="#Condition.not_-729"><span class="linenos">729</span></a><span class="sd"> copy: whether or not to copy this object.</span> -</span><span id="Condition.not_-730"><a href="#Condition.not_-730"><span class="linenos">730</span></a> -</span><span id="Condition.not_-731"><a href="#Condition.not_-731"><span class="linenos">731</span></a><span class="sd"> Returns:</span> -</span><span id="Condition.not_-732"><a href="#Condition.not_-732"><span class="linenos">732</span></a><span class="sd"> The new Not instance.</span> -</span><span id="Condition.not_-733"><a href="#Condition.not_-733"><span class="linenos">733</span></a><span class="sd"> """</span> -</span><span id="Condition.not_-734"><a href="#Condition.not_-734"><span class="linenos">734</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 class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> +</span><span id="Condition.not_-728"><a href="#Condition.not_-728"><span class="linenos">728</span></a><span class="sd"> Returns:</span> +</span><span id="Condition.not_-729"><a href="#Condition.not_-729"><span class="linenos">729</span></a><span class="sd"> The new Not instance.</span> +</span><span id="Condition.not_-730"><a href="#Condition.not_-730"><span class="linenos">730</span></a><span class="sd"> """</span> +</span><span id="Condition.not_-731"><a href="#Condition.not_-731"><span class="linenos">731</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 class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> </span></pre></div> @@ -13988,15 +13997,15 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Condition.as_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.as_-736"><a href="#Condition.as_-736"><span class="linenos">736</span></a> <span class="k">def</span> <span class="nf">as_</span><span class="p">(</span> -</span><span id="Condition.as_-737"><a href="#Condition.as_-737"><span class="linenos">737</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Condition.as_-738"><a href="#Condition.as_-738"><span class="linenos">738</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="Condition.as_-739"><a href="#Condition.as_-739"><span class="linenos">739</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="Condition.as_-740"><a href="#Condition.as_-740"><span class="linenos">740</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="Condition.as_-741"><a href="#Condition.as_-741"><span class="linenos">741</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="Condition.as_-742"><a href="#Condition.as_-742"><span class="linenos">742</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Condition.as_-743"><a href="#Condition.as_-743"><span class="linenos">743</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Alias</span><span class="p">:</span> -</span><span id="Condition.as_-744"><a href="#Condition.as_-744"><span class="linenos">744</span></a> <span class="k">return</span> <span class="n">alias_</span><span class="p">(</span><span class="bp">self</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 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="n">copy</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.as_-733"><a href="#Condition.as_-733"><span class="linenos">733</span></a> <span class="k">def</span> <span class="nf">as_</span><span class="p">(</span> +</span><span id="Condition.as_-734"><a href="#Condition.as_-734"><span class="linenos">734</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Condition.as_-735"><a href="#Condition.as_-735"><span class="linenos">735</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="Condition.as_-736"><a href="#Condition.as_-736"><span class="linenos">736</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="Condition.as_-737"><a href="#Condition.as_-737"><span class="linenos">737</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="Condition.as_-738"><a href="#Condition.as_-738"><span class="linenos">738</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="Condition.as_-739"><a href="#Condition.as_-739"><span class="linenos">739</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Condition.as_-740"><a href="#Condition.as_-740"><span class="linenos">740</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Alias</span><span class="p">:</span> +</span><span id="Condition.as_-741"><a href="#Condition.as_-741"><span class="linenos">741</span></a> <span class="k">return</span> <span class="n">alias_</span><span class="p">(</span><span class="bp">self</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 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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -14014,14 +14023,14 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Condition.isin"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.isin-761"><a href="#Condition.isin-761"><span class="linenos">761</span></a> <span class="k">def</span> <span class="nf">isin</span><span class="p">(</span> -</span><span id="Condition.isin-762"><a href="#Condition.isin-762"><span class="linenos">762</span></a> <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">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="n">query</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">opts</span> -</span><span id="Condition.isin-763"><a href="#Condition.isin-763"><span class="linenos">763</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">In</span><span class="p">:</span> -</span><span id="Condition.isin-764"><a href="#Condition.isin-764"><span class="linenos">764</span></a> <span class="k">return</span> <span class="n">In</span><span class="p">(</span> -</span><span id="Condition.isin-765"><a href="#Condition.isin-765"><span class="linenos">765</span></a> <span class="n">this</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="Condition.isin-766"><a href="#Condition.isin-766"><span class="linenos">766</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">e</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">],</span> -</span><span id="Condition.isin-767"><a href="#Condition.isin-767"><span class="linenos">767</span></a> <span class="n">query</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">if</span> <span class="n">query</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Condition.isin-768"><a href="#Condition.isin-768"><span class="linenos">768</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.isin-758"><a href="#Condition.isin-758"><span class="linenos">758</span></a> <span class="k">def</span> <span class="nf">isin</span><span class="p">(</span> +</span><span id="Condition.isin-759"><a href="#Condition.isin-759"><span class="linenos">759</span></a> <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">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="n">query</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">opts</span> +</span><span id="Condition.isin-760"><a href="#Condition.isin-760"><span class="linenos">760</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">In</span><span class="p">:</span> +</span><span id="Condition.isin-761"><a href="#Condition.isin-761"><span class="linenos">761</span></a> <span class="k">return</span> <span class="n">In</span><span class="p">(</span> +</span><span id="Condition.isin-762"><a href="#Condition.isin-762"><span class="linenos">762</span></a> <span class="n">this</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="Condition.isin-763"><a href="#Condition.isin-763"><span class="linenos">763</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">e</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">],</span> +</span><span id="Condition.isin-764"><a href="#Condition.isin-764"><span class="linenos">764</span></a> <span class="n">query</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">if</span> <span class="n">query</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Condition.isin-765"><a href="#Condition.isin-765"><span class="linenos">765</span></a> <span class="p">)</span> </span></pre></div> @@ -14039,12 +14048,12 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Condition.between"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.between-770"><a href="#Condition.between-770"><span class="linenos">770</span></a> <span class="k">def</span> <span class="nf">between</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">low</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="n">high</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="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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Between</span><span class="p">:</span> -</span><span id="Condition.between-771"><a href="#Condition.between-771"><span class="linenos">771</span></a> <span class="k">return</span> <span class="n">Between</span><span class="p">(</span> -</span><span id="Condition.between-772"><a href="#Condition.between-772"><span class="linenos">772</span></a> <span class="n">this</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="Condition.between-773"><a href="#Condition.between-773"><span class="linenos">773</span></a> <span class="n">low</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">low</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="Condition.between-774"><a href="#Condition.between-774"><span class="linenos">774</span></a> <span class="n">high</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">high</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="Condition.between-775"><a href="#Condition.between-775"><span class="linenos">775</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.between-767"><a href="#Condition.between-767"><span class="linenos">767</span></a> <span class="k">def</span> <span class="nf">between</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">low</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="n">high</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="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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Between</span><span class="p">:</span> +</span><span id="Condition.between-768"><a href="#Condition.between-768"><span class="linenos">768</span></a> <span class="k">return</span> <span class="n">Between</span><span class="p">(</span> +</span><span id="Condition.between-769"><a href="#Condition.between-769"><span class="linenos">769</span></a> <span class="n">this</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="Condition.between-770"><a href="#Condition.between-770"><span class="linenos">770</span></a> <span class="n">low</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">low</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="Condition.between-771"><a href="#Condition.between-771"><span class="linenos">771</span></a> <span class="n">high</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">high</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="Condition.between-772"><a href="#Condition.between-772"><span class="linenos">772</span></a> <span class="p">)</span> </span></pre></div> @@ -14062,8 +14071,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Condition.is_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.is_-777"><a href="#Condition.is_-777"><span class="linenos">777</span></a> <span class="k">def</span> <span class="nf">is_</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">Is</span><span class="p">:</span> -</span><span id="Condition.is_-778"><a href="#Condition.is_-778"><span class="linenos">778</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Is</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.is_-774"><a href="#Condition.is_-774"><span class="linenos">774</span></a> <span class="k">def</span> <span class="nf">is_</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">Is</span><span class="p">:</span> +</span><span id="Condition.is_-775"><a href="#Condition.is_-775"><span class="linenos">775</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Is</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span></pre></div> @@ -14081,8 +14090,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Condition.like"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.like-780"><a href="#Condition.like-780"><span class="linenos">780</span></a> <span class="k">def</span> <span class="nf">like</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">Like</span><span class="p">:</span> -</span><span id="Condition.like-781"><a href="#Condition.like-781"><span class="linenos">781</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Like</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.like-777"><a href="#Condition.like-777"><span class="linenos">777</span></a> <span class="k">def</span> <span class="nf">like</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">Like</span><span class="p">:</span> +</span><span id="Condition.like-778"><a href="#Condition.like-778"><span class="linenos">778</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">Like</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span></pre></div> @@ -14100,8 +14109,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Condition.ilike"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.ilike-783"><a href="#Condition.ilike-783"><span class="linenos">783</span></a> <span class="k">def</span> <span class="nf">ilike</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">ILike</span><span class="p">:</span> -</span><span id="Condition.ilike-784"><a href="#Condition.ilike-784"><span class="linenos">784</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">ILike</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.ilike-780"><a href="#Condition.ilike-780"><span class="linenos">780</span></a> <span class="k">def</span> <span class="nf">ilike</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">ILike</span><span class="p">:</span> +</span><span id="Condition.ilike-781"><a href="#Condition.ilike-781"><span class="linenos">781</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">ILike</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span></pre></div> @@ -14119,8 +14128,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Condition.eq"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.eq-786"><a href="#Condition.eq-786"><span class="linenos">786</span></a> <span class="k">def</span> <span class="nf">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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">EQ</span><span class="p">:</span> -</span><span id="Condition.eq-787"><a href="#Condition.eq-787"><span class="linenos">787</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">EQ</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.eq-783"><a href="#Condition.eq-783"><span class="linenos">783</span></a> <span class="k">def</span> <span class="nf">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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">EQ</span><span class="p">:</span> +</span><span id="Condition.eq-784"><a href="#Condition.eq-784"><span class="linenos">784</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">EQ</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span></pre></div> @@ -14138,8 +14147,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Condition.neq"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.neq-789"><a href="#Condition.neq-789"><span class="linenos">789</span></a> <span class="k">def</span> <span class="nf">neq</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">NEQ</span><span class="p">:</span> -</span><span id="Condition.neq-790"><a href="#Condition.neq-790"><span class="linenos">790</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">NEQ</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.neq-786"><a href="#Condition.neq-786"><span class="linenos">786</span></a> <span class="k">def</span> <span class="nf">neq</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="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="n">NEQ</span><span class="p">:</span> +</span><span id="Condition.neq-787"><a href="#Condition.neq-787"><span class="linenos">787</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">NEQ</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span></pre></div> @@ -14157,8 +14166,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Condition.rlike"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.rlike-792"><a href="#Condition.rlike-792"><span class="linenos">792</span></a> <span class="k">def</span> <span class="nf">rlike</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">RegexpLike</span><span class="p">:</span> -</span><span id="Condition.rlike-793"><a href="#Condition.rlike-793"><span class="linenos">793</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">RegexpLike</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.rlike-789"><a href="#Condition.rlike-789"><span class="linenos">789</span></a> <span class="k">def</span> <span class="nf">rlike</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="n">ExpOrStr</span><span class="p">)</span> <span class="o">-></span> <span class="n">RegexpLike</span><span class="p">:</span> +</span><span id="Condition.rlike-790"><a href="#Condition.rlike-790"><span class="linenos">790</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_binop</span><span class="p">(</span><span class="n">RegexpLike</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> </span></pre></div> @@ -14245,8 +14254,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-868"><a href="#Predicate-868"><span class="linenos">868</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-869"><a href="#Predicate-869"><span class="linenos">869</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-865"><a href="#Predicate-865"><span class="linenos">865</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-866"><a href="#Predicate-866"><span class="linenos">866</span></a><span class="w"> </span><span class="sd">"""Relationships like x = y, x > 1, x >= y."""</span> </span></pre></div> @@ -14349,21 +14358,21 @@ 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-872"><a href="#DerivedTable-872"><span class="linenos">872</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-873"><a href="#DerivedTable-873"><span class="linenos">873</span></a> <span class="nd">@property</span> -</span><span id="DerivedTable-874"><a href="#DerivedTable-874"><span class="linenos">874</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 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="DerivedTable-875"><a href="#DerivedTable-875"><span class="linenos">875</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-876"><a href="#DerivedTable-876"><span class="linenos">876</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-877"><a href="#DerivedTable-877"><span class="linenos">877</span></a> <span class="k">return</span> <span class="p">[]</span> -</span><span id="DerivedTable-878"><a href="#DerivedTable-878"><span class="linenos">878</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">table_alias</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-879"><a href="#DerivedTable-879"><span class="linenos">879</span></a> -</span><span id="DerivedTable-880"><a href="#DerivedTable-880"><span class="linenos">880</span></a> <span class="nd">@property</span> -</span><span id="DerivedTable-881"><a href="#DerivedTable-881"><span class="linenos">881</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-882"><a href="#DerivedTable-882"><span class="linenos">882</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">selects</span> <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">this</span><span class="p">,</span> <span class="n">Subqueryable</span><span class="p">)</span> <span class="k">else</span> <span class="p">[]</span> -</span><span id="DerivedTable-883"><a href="#DerivedTable-883"><span class="linenos">883</span></a> -</span><span id="DerivedTable-884"><a href="#DerivedTable-884"><span class="linenos">884</span></a> <span class="nd">@property</span> -</span><span id="DerivedTable-885"><a href="#DerivedTable-885"><span class="linenos">885</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-886"><a href="#DerivedTable-886"><span class="linenos">886</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-869"><a href="#DerivedTable-869"><span class="linenos">869</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-870"><a href="#DerivedTable-870"><span class="linenos">870</span></a> <span class="nd">@property</span> +</span><span id="DerivedTable-871"><a href="#DerivedTable-871"><span class="linenos">871</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 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="DerivedTable-872"><a href="#DerivedTable-872"><span class="linenos">872</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-873"><a href="#DerivedTable-873"><span class="linenos">873</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-874"><a href="#DerivedTable-874"><span class="linenos">874</span></a> <span class="k">return</span> <span class="p">[]</span> +</span><span id="DerivedTable-875"><a href="#DerivedTable-875"><span class="linenos">875</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">table_alias</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-876"><a href="#DerivedTable-876"><span class="linenos">876</span></a> +</span><span id="DerivedTable-877"><a href="#DerivedTable-877"><span class="linenos">877</span></a> <span class="nd">@property</span> +</span><span id="DerivedTable-878"><a href="#DerivedTable-878"><span class="linenos">878</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-879"><a href="#DerivedTable-879"><span class="linenos">879</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">selects</span> <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">this</span><span class="p">,</span> <span class="n">Subqueryable</span><span class="p">)</span> <span class="k">else</span> <span class="p">[]</span> +</span><span id="DerivedTable-880"><a href="#DerivedTable-880"><span class="linenos">880</span></a> +</span><span id="DerivedTable-881"><a href="#DerivedTable-881"><span class="linenos">881</span></a> <span class="nd">@property</span> +</span><span id="DerivedTable-882"><a href="#DerivedTable-882"><span class="linenos">882</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-883"><a href="#DerivedTable-883"><span class="linenos">883</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> @@ -14482,75 +14491,75 @@ 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-889"><a href="#Unionable-889"><span class="linenos">889</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-890"><a href="#Unionable-890"><span class="linenos">890</span></a> <span class="k">def</span> <span class="nf">union</span><span class="p">(</span> -</span><span id="Unionable-891"><a href="#Unionable-891"><span class="linenos">891</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="Unionable-892"><a href="#Unionable-892"><span class="linenos">892</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> -</span><span id="Unionable-893"><a href="#Unionable-893"><span class="linenos">893</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Unionable-894"><a href="#Unionable-894"><span class="linenos">894</span></a><span class="sd"> Builds a UNION expression.</span> -</span><span id="Unionable-895"><a href="#Unionable-895"><span class="linenos">895</span></a> -</span><span id="Unionable-896"><a href="#Unionable-896"><span class="linenos">896</span></a><span class="sd"> Example:</span> -</span><span id="Unionable-897"><a href="#Unionable-897"><span class="linenos">897</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Unionable-898"><a href="#Unionable-898"><span class="linenos">898</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()</span> -</span><span id="Unionable-899"><a href="#Unionable-899"><span class="linenos">899</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> -</span><span id="Unionable-900"><a href="#Unionable-900"><span class="linenos">900</span></a> -</span><span id="Unionable-901"><a href="#Unionable-901"><span class="linenos">901</span></a><span class="sd"> Args:</span> -</span><span id="Unionable-902"><a href="#Unionable-902"><span class="linenos">902</span></a><span class="sd"> expression: the SQL code string.</span> -</span><span id="Unionable-903"><a href="#Unionable-903"><span class="linenos">903</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Unionable-904"><a href="#Unionable-904"><span class="linenos">904</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="Unionable-905"><a href="#Unionable-905"><span class="linenos">905</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Unionable-906"><a href="#Unionable-906"><span class="linenos">906</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Unionable-907"><a href="#Unionable-907"><span class="linenos">907</span></a> -</span><span id="Unionable-908"><a href="#Unionable-908"><span class="linenos">908</span></a><span class="sd"> Returns:</span> -</span><span id="Unionable-909"><a href="#Unionable-909"><span class="linenos">909</span></a><span class="sd"> The new Union expression.</span> -</span><span id="Unionable-910"><a href="#Unionable-910"><span class="linenos">910</span></a><span class="sd"> """</span> -</span><span id="Unionable-911"><a href="#Unionable-911"><span class="linenos">911</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-912"><a href="#Unionable-912"><span class="linenos">912</span></a> -</span><span id="Unionable-913"><a href="#Unionable-913"><span class="linenos">913</span></a> <span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span> -</span><span id="Unionable-914"><a href="#Unionable-914"><span class="linenos">914</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="Unionable-915"><a href="#Unionable-915"><span class="linenos">915</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> -</span><span id="Unionable-916"><a href="#Unionable-916"><span class="linenos">916</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Unionable-917"><a href="#Unionable-917"><span class="linenos">917</span></a><span class="sd"> Builds an INTERSECT expression.</span> -</span><span id="Unionable-918"><a href="#Unionable-918"><span class="linenos">918</span></a> -</span><span id="Unionable-919"><a href="#Unionable-919"><span class="linenos">919</span></a><span class="sd"> Example:</span> -</span><span id="Unionable-920"><a href="#Unionable-920"><span class="linenos">920</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Unionable-921"><a href="#Unionable-921"><span class="linenos">921</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()</span> -</span><span id="Unionable-922"><a href="#Unionable-922"><span class="linenos">922</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> -</span><span id="Unionable-923"><a href="#Unionable-923"><span class="linenos">923</span></a> -</span><span id="Unionable-924"><a href="#Unionable-924"><span class="linenos">924</span></a><span class="sd"> Args:</span> -</span><span id="Unionable-925"><a href="#Unionable-925"><span class="linenos">925</span></a><span class="sd"> expression: the SQL code string.</span> -</span><span id="Unionable-926"><a href="#Unionable-926"><span class="linenos">926</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Unionable-927"><a href="#Unionable-927"><span class="linenos">927</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="Unionable-928"><a href="#Unionable-928"><span class="linenos">928</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Unionable-929"><a href="#Unionable-929"><span class="linenos">929</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Unionable-930"><a href="#Unionable-930"><span class="linenos">930</span></a> -</span><span id="Unionable-931"><a href="#Unionable-931"><span class="linenos">931</span></a><span class="sd"> Returns:</span> -</span><span id="Unionable-932"><a href="#Unionable-932"><span class="linenos">932</span></a><span class="sd"> The new Intersect expression.</span> -</span><span id="Unionable-933"><a href="#Unionable-933"><span class="linenos">933</span></a><span class="sd"> """</span> -</span><span id="Unionable-934"><a href="#Unionable-934"><span class="linenos">934</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-935"><a href="#Unionable-935"><span class="linenos">935</span></a> -</span><span id="Unionable-936"><a href="#Unionable-936"><span class="linenos">936</span></a> <span class="k">def</span> <span class="nf">except_</span><span class="p">(</span> -</span><span id="Unionable-937"><a href="#Unionable-937"><span class="linenos">937</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="Unionable-938"><a href="#Unionable-938"><span class="linenos">938</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> -</span><span id="Unionable-939"><a href="#Unionable-939"><span class="linenos">939</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Unionable-940"><a href="#Unionable-940"><span class="linenos">940</span></a><span class="sd"> Builds an EXCEPT expression.</span> -</span><span id="Unionable-941"><a href="#Unionable-941"><span class="linenos">941</span></a> -</span><span id="Unionable-942"><a href="#Unionable-942"><span class="linenos">942</span></a><span class="sd"> Example:</span> -</span><span id="Unionable-943"><a href="#Unionable-943"><span class="linenos">943</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Unionable-944"><a href="#Unionable-944"><span class="linenos">944</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()</span> -</span><span id="Unionable-945"><a href="#Unionable-945"><span class="linenos">945</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> -</span><span id="Unionable-946"><a href="#Unionable-946"><span class="linenos">946</span></a> -</span><span id="Unionable-947"><a href="#Unionable-947"><span class="linenos">947</span></a><span class="sd"> Args:</span> -</span><span id="Unionable-948"><a href="#Unionable-948"><span class="linenos">948</span></a><span class="sd"> expression: the SQL code string.</span> -</span><span id="Unionable-949"><a href="#Unionable-949"><span class="linenos">949</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Unionable-950"><a href="#Unionable-950"><span class="linenos">950</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="Unionable-951"><a href="#Unionable-951"><span class="linenos">951</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Unionable-952"><a href="#Unionable-952"><span class="linenos">952</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Unionable-953"><a href="#Unionable-953"><span class="linenos">953</span></a> -</span><span id="Unionable-954"><a href="#Unionable-954"><span class="linenos">954</span></a><span class="sd"> Returns:</span> -</span><span id="Unionable-955"><a href="#Unionable-955"><span class="linenos">955</span></a><span class="sd"> The new Except expression.</span> -</span><span id="Unionable-956"><a href="#Unionable-956"><span class="linenos">956</span></a><span class="sd"> """</span> -</span><span id="Unionable-957"><a href="#Unionable-957"><span class="linenos">957</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-886"><a href="#Unionable-886"><span class="linenos">886</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-887"><a href="#Unionable-887"><span class="linenos">887</span></a> <span class="k">def</span> <span class="nf">union</span><span class="p">(</span> +</span><span id="Unionable-888"><a href="#Unionable-888"><span class="linenos">888</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="Unionable-889"><a href="#Unionable-889"><span class="linenos">889</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> +</span><span id="Unionable-890"><a href="#Unionable-890"><span class="linenos">890</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Unionable-891"><a href="#Unionable-891"><span class="linenos">891</span></a><span class="sd"> Builds a UNION expression.</span> +</span><span id="Unionable-892"><a href="#Unionable-892"><span class="linenos">892</span></a> +</span><span id="Unionable-893"><a href="#Unionable-893"><span class="linenos">893</span></a><span class="sd"> Example:</span> +</span><span id="Unionable-894"><a href="#Unionable-894"><span class="linenos">894</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Unionable-895"><a href="#Unionable-895"><span class="linenos">895</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()</span> +</span><span id="Unionable-896"><a href="#Unionable-896"><span class="linenos">896</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> +</span><span id="Unionable-897"><a href="#Unionable-897"><span class="linenos">897</span></a> +</span><span id="Unionable-898"><a href="#Unionable-898"><span class="linenos">898</span></a><span class="sd"> Args:</span> +</span><span id="Unionable-899"><a href="#Unionable-899"><span class="linenos">899</span></a><span class="sd"> expression: the SQL code string.</span> +</span><span id="Unionable-900"><a href="#Unionable-900"><span class="linenos">900</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Unionable-901"><a href="#Unionable-901"><span class="linenos">901</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="Unionable-902"><a href="#Unionable-902"><span class="linenos">902</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Unionable-903"><a href="#Unionable-903"><span class="linenos">903</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Unionable-904"><a href="#Unionable-904"><span class="linenos">904</span></a> +</span><span id="Unionable-905"><a href="#Unionable-905"><span class="linenos">905</span></a><span class="sd"> Returns:</span> +</span><span id="Unionable-906"><a href="#Unionable-906"><span class="linenos">906</span></a><span class="sd"> The new Union expression.</span> +</span><span id="Unionable-907"><a href="#Unionable-907"><span class="linenos">907</span></a><span class="sd"> """</span> +</span><span id="Unionable-908"><a href="#Unionable-908"><span class="linenos">908</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-909"><a href="#Unionable-909"><span class="linenos">909</span></a> +</span><span id="Unionable-910"><a href="#Unionable-910"><span class="linenos">910</span></a> <span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span> +</span><span id="Unionable-911"><a href="#Unionable-911"><span class="linenos">911</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="Unionable-912"><a href="#Unionable-912"><span class="linenos">912</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> +</span><span id="Unionable-913"><a href="#Unionable-913"><span class="linenos">913</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Unionable-914"><a href="#Unionable-914"><span class="linenos">914</span></a><span class="sd"> Builds an INTERSECT expression.</span> +</span><span id="Unionable-915"><a href="#Unionable-915"><span class="linenos">915</span></a> +</span><span id="Unionable-916"><a href="#Unionable-916"><span class="linenos">916</span></a><span class="sd"> Example:</span> +</span><span id="Unionable-917"><a href="#Unionable-917"><span class="linenos">917</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Unionable-918"><a href="#Unionable-918"><span class="linenos">918</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()</span> +</span><span id="Unionable-919"><a href="#Unionable-919"><span class="linenos">919</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> +</span><span id="Unionable-920"><a href="#Unionable-920"><span class="linenos">920</span></a> +</span><span id="Unionable-921"><a href="#Unionable-921"><span class="linenos">921</span></a><span class="sd"> Args:</span> +</span><span id="Unionable-922"><a href="#Unionable-922"><span class="linenos">922</span></a><span class="sd"> expression: the SQL code string.</span> +</span><span id="Unionable-923"><a href="#Unionable-923"><span class="linenos">923</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Unionable-924"><a href="#Unionable-924"><span class="linenos">924</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="Unionable-925"><a href="#Unionable-925"><span class="linenos">925</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Unionable-926"><a href="#Unionable-926"><span class="linenos">926</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Unionable-927"><a href="#Unionable-927"><span class="linenos">927</span></a> +</span><span id="Unionable-928"><a href="#Unionable-928"><span class="linenos">928</span></a><span class="sd"> Returns:</span> +</span><span id="Unionable-929"><a href="#Unionable-929"><span class="linenos">929</span></a><span class="sd"> The new Intersect expression.</span> +</span><span id="Unionable-930"><a href="#Unionable-930"><span class="linenos">930</span></a><span class="sd"> """</span> +</span><span id="Unionable-931"><a href="#Unionable-931"><span class="linenos">931</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-932"><a href="#Unionable-932"><span class="linenos">932</span></a> +</span><span id="Unionable-933"><a href="#Unionable-933"><span class="linenos">933</span></a> <span class="k">def</span> <span class="nf">except_</span><span class="p">(</span> +</span><span id="Unionable-934"><a href="#Unionable-934"><span class="linenos">934</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="Unionable-935"><a href="#Unionable-935"><span class="linenos">935</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> +</span><span id="Unionable-936"><a href="#Unionable-936"><span class="linenos">936</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Unionable-937"><a href="#Unionable-937"><span class="linenos">937</span></a><span class="sd"> Builds an EXCEPT expression.</span> +</span><span id="Unionable-938"><a href="#Unionable-938"><span class="linenos">938</span></a> +</span><span id="Unionable-939"><a href="#Unionable-939"><span class="linenos">939</span></a><span class="sd"> Example:</span> +</span><span id="Unionable-940"><a href="#Unionable-940"><span class="linenos">940</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Unionable-941"><a href="#Unionable-941"><span class="linenos">941</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()</span> +</span><span id="Unionable-942"><a href="#Unionable-942"><span class="linenos">942</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> +</span><span id="Unionable-943"><a href="#Unionable-943"><span class="linenos">943</span></a> +</span><span id="Unionable-944"><a href="#Unionable-944"><span class="linenos">944</span></a><span class="sd"> Args:</span> +</span><span id="Unionable-945"><a href="#Unionable-945"><span class="linenos">945</span></a><span class="sd"> expression: the SQL code string.</span> +</span><span id="Unionable-946"><a href="#Unionable-946"><span class="linenos">946</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Unionable-947"><a href="#Unionable-947"><span class="linenos">947</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="Unionable-948"><a href="#Unionable-948"><span class="linenos">948</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Unionable-949"><a href="#Unionable-949"><span class="linenos">949</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Unionable-950"><a href="#Unionable-950"><span class="linenos">950</span></a> +</span><span id="Unionable-951"><a href="#Unionable-951"><span class="linenos">951</span></a><span class="sd"> Returns:</span> +</span><span id="Unionable-952"><a href="#Unionable-952"><span class="linenos">952</span></a><span class="sd"> The new Except expression.</span> +</span><span id="Unionable-953"><a href="#Unionable-953"><span class="linenos">953</span></a><span class="sd"> """</span> +</span><span id="Unionable-954"><a href="#Unionable-954"><span class="linenos">954</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> @@ -14567,28 +14576,28 @@ 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-890"><a href="#Unionable.union-890"><span class="linenos">890</span></a> <span class="k">def</span> <span class="nf">union</span><span class="p">(</span> -</span><span id="Unionable.union-891"><a href="#Unionable.union-891"><span class="linenos">891</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="Unionable.union-892"><a href="#Unionable.union-892"><span class="linenos">892</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> -</span><span id="Unionable.union-893"><a href="#Unionable.union-893"><span class="linenos">893</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Unionable.union-894"><a href="#Unionable.union-894"><span class="linenos">894</span></a><span class="sd"> Builds a UNION expression.</span> -</span><span id="Unionable.union-895"><a href="#Unionable.union-895"><span class="linenos">895</span></a> -</span><span id="Unionable.union-896"><a href="#Unionable.union-896"><span class="linenos">896</span></a><span class="sd"> Example:</span> -</span><span id="Unionable.union-897"><a href="#Unionable.union-897"><span class="linenos">897</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Unionable.union-898"><a href="#Unionable.union-898"><span class="linenos">898</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()</span> -</span><span id="Unionable.union-899"><a href="#Unionable.union-899"><span class="linenos">899</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> -</span><span id="Unionable.union-900"><a href="#Unionable.union-900"><span class="linenos">900</span></a> -</span><span id="Unionable.union-901"><a href="#Unionable.union-901"><span class="linenos">901</span></a><span class="sd"> Args:</span> -</span><span id="Unionable.union-902"><a href="#Unionable.union-902"><span class="linenos">902</span></a><span class="sd"> expression: the SQL code string.</span> -</span><span id="Unionable.union-903"><a href="#Unionable.union-903"><span class="linenos">903</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Unionable.union-904"><a href="#Unionable.union-904"><span class="linenos">904</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="Unionable.union-905"><a href="#Unionable.union-905"><span class="linenos">905</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Unionable.union-906"><a href="#Unionable.union-906"><span class="linenos">906</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Unionable.union-907"><a href="#Unionable.union-907"><span class="linenos">907</span></a> -</span><span id="Unionable.union-908"><a href="#Unionable.union-908"><span class="linenos">908</span></a><span class="sd"> Returns:</span> -</span><span id="Unionable.union-909"><a href="#Unionable.union-909"><span class="linenos">909</span></a><span class="sd"> The new Union expression.</span> -</span><span id="Unionable.union-910"><a href="#Unionable.union-910"><span class="linenos">910</span></a><span class="sd"> """</span> -</span><span id="Unionable.union-911"><a href="#Unionable.union-911"><span class="linenos">911</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-887"><a href="#Unionable.union-887"><span class="linenos">887</span></a> <span class="k">def</span> <span class="nf">union</span><span class="p">(</span> +</span><span id="Unionable.union-888"><a href="#Unionable.union-888"><span class="linenos">888</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="Unionable.union-889"><a href="#Unionable.union-889"><span class="linenos">889</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> +</span><span id="Unionable.union-890"><a href="#Unionable.union-890"><span class="linenos">890</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Unionable.union-891"><a href="#Unionable.union-891"><span class="linenos">891</span></a><span class="sd"> Builds a UNION expression.</span> +</span><span id="Unionable.union-892"><a href="#Unionable.union-892"><span class="linenos">892</span></a> +</span><span id="Unionable.union-893"><a href="#Unionable.union-893"><span class="linenos">893</span></a><span class="sd"> Example:</span> +</span><span id="Unionable.union-894"><a href="#Unionable.union-894"><span class="linenos">894</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Unionable.union-895"><a href="#Unionable.union-895"><span class="linenos">895</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()</span> +</span><span id="Unionable.union-896"><a href="#Unionable.union-896"><span class="linenos">896</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> +</span><span id="Unionable.union-897"><a href="#Unionable.union-897"><span class="linenos">897</span></a> +</span><span id="Unionable.union-898"><a href="#Unionable.union-898"><span class="linenos">898</span></a><span class="sd"> Args:</span> +</span><span id="Unionable.union-899"><a href="#Unionable.union-899"><span class="linenos">899</span></a><span class="sd"> expression: the SQL code string.</span> +</span><span id="Unionable.union-900"><a href="#Unionable.union-900"><span class="linenos">900</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Unionable.union-901"><a href="#Unionable.union-901"><span class="linenos">901</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="Unionable.union-902"><a href="#Unionable.union-902"><span class="linenos">902</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Unionable.union-903"><a href="#Unionable.union-903"><span class="linenos">903</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Unionable.union-904"><a href="#Unionable.union-904"><span class="linenos">904</span></a> +</span><span id="Unionable.union-905"><a href="#Unionable.union-905"><span class="linenos">905</span></a><span class="sd"> Returns:</span> +</span><span id="Unionable.union-906"><a href="#Unionable.union-906"><span class="linenos">906</span></a><span class="sd"> The new Union expression.</span> +</span><span id="Unionable.union-907"><a href="#Unionable.union-907"><span class="linenos">907</span></a><span class="sd"> """</span> +</span><span id="Unionable.union-908"><a href="#Unionable.union-908"><span class="linenos">908</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> @@ -14635,28 +14644,28 @@ 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-913"><a href="#Unionable.intersect-913"><span class="linenos">913</span></a> <span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span> -</span><span id="Unionable.intersect-914"><a href="#Unionable.intersect-914"><span class="linenos">914</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="Unionable.intersect-915"><a href="#Unionable.intersect-915"><span class="linenos">915</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> -</span><span id="Unionable.intersect-916"><a href="#Unionable.intersect-916"><span class="linenos">916</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Unionable.intersect-917"><a href="#Unionable.intersect-917"><span class="linenos">917</span></a><span class="sd"> Builds an INTERSECT expression.</span> -</span><span id="Unionable.intersect-918"><a href="#Unionable.intersect-918"><span class="linenos">918</span></a> -</span><span id="Unionable.intersect-919"><a href="#Unionable.intersect-919"><span class="linenos">919</span></a><span class="sd"> Example:</span> -</span><span id="Unionable.intersect-920"><a href="#Unionable.intersect-920"><span class="linenos">920</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Unionable.intersect-921"><a href="#Unionable.intersect-921"><span class="linenos">921</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()</span> -</span><span id="Unionable.intersect-922"><a href="#Unionable.intersect-922"><span class="linenos">922</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> -</span><span id="Unionable.intersect-923"><a href="#Unionable.intersect-923"><span class="linenos">923</span></a> -</span><span id="Unionable.intersect-924"><a href="#Unionable.intersect-924"><span class="linenos">924</span></a><span class="sd"> Args:</span> -</span><span id="Unionable.intersect-925"><a href="#Unionable.intersect-925"><span class="linenos">925</span></a><span class="sd"> expression: the SQL code string.</span> -</span><span id="Unionable.intersect-926"><a href="#Unionable.intersect-926"><span class="linenos">926</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Unionable.intersect-927"><a href="#Unionable.intersect-927"><span class="linenos">927</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="Unionable.intersect-928"><a href="#Unionable.intersect-928"><span class="linenos">928</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Unionable.intersect-929"><a href="#Unionable.intersect-929"><span class="linenos">929</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Unionable.intersect-930"><a href="#Unionable.intersect-930"><span class="linenos">930</span></a> -</span><span id="Unionable.intersect-931"><a href="#Unionable.intersect-931"><span class="linenos">931</span></a><span class="sd"> Returns:</span> -</span><span id="Unionable.intersect-932"><a href="#Unionable.intersect-932"><span class="linenos">932</span></a><span class="sd"> The new Intersect expression.</span> -</span><span id="Unionable.intersect-933"><a href="#Unionable.intersect-933"><span class="linenos">933</span></a><span class="sd"> """</span> -</span><span id="Unionable.intersect-934"><a href="#Unionable.intersect-934"><span class="linenos">934</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-910"><a href="#Unionable.intersect-910"><span class="linenos">910</span></a> <span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span> +</span><span id="Unionable.intersect-911"><a href="#Unionable.intersect-911"><span class="linenos">911</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="Unionable.intersect-912"><a href="#Unionable.intersect-912"><span class="linenos">912</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> +</span><span id="Unionable.intersect-913"><a href="#Unionable.intersect-913"><span class="linenos">913</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Unionable.intersect-914"><a href="#Unionable.intersect-914"><span class="linenos">914</span></a><span class="sd"> Builds an INTERSECT expression.</span> +</span><span id="Unionable.intersect-915"><a href="#Unionable.intersect-915"><span class="linenos">915</span></a> +</span><span id="Unionable.intersect-916"><a href="#Unionable.intersect-916"><span class="linenos">916</span></a><span class="sd"> Example:</span> +</span><span id="Unionable.intersect-917"><a href="#Unionable.intersect-917"><span class="linenos">917</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Unionable.intersect-918"><a href="#Unionable.intersect-918"><span class="linenos">918</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()</span> +</span><span id="Unionable.intersect-919"><a href="#Unionable.intersect-919"><span class="linenos">919</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> +</span><span id="Unionable.intersect-920"><a href="#Unionable.intersect-920"><span class="linenos">920</span></a> +</span><span id="Unionable.intersect-921"><a href="#Unionable.intersect-921"><span class="linenos">921</span></a><span class="sd"> Args:</span> +</span><span id="Unionable.intersect-922"><a href="#Unionable.intersect-922"><span class="linenos">922</span></a><span class="sd"> expression: the SQL code string.</span> +</span><span id="Unionable.intersect-923"><a href="#Unionable.intersect-923"><span class="linenos">923</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Unionable.intersect-924"><a href="#Unionable.intersect-924"><span class="linenos">924</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="Unionable.intersect-925"><a href="#Unionable.intersect-925"><span class="linenos">925</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Unionable.intersect-926"><a href="#Unionable.intersect-926"><span class="linenos">926</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Unionable.intersect-927"><a href="#Unionable.intersect-927"><span class="linenos">927</span></a> +</span><span id="Unionable.intersect-928"><a href="#Unionable.intersect-928"><span class="linenos">928</span></a><span class="sd"> Returns:</span> +</span><span id="Unionable.intersect-929"><a href="#Unionable.intersect-929"><span class="linenos">929</span></a><span class="sd"> The new Intersect expression.</span> +</span><span id="Unionable.intersect-930"><a href="#Unionable.intersect-930"><span class="linenos">930</span></a><span class="sd"> """</span> +</span><span id="Unionable.intersect-931"><a href="#Unionable.intersect-931"><span class="linenos">931</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> @@ -14703,28 +14712,28 @@ 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_-936"><a href="#Unionable.except_-936"><span class="linenos">936</span></a> <span class="k">def</span> <span class="nf">except_</span><span class="p">(</span> -</span><span id="Unionable.except_-937"><a href="#Unionable.except_-937"><span class="linenos">937</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="Unionable.except_-938"><a href="#Unionable.except_-938"><span class="linenos">938</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> -</span><span id="Unionable.except_-939"><a href="#Unionable.except_-939"><span class="linenos">939</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Unionable.except_-940"><a href="#Unionable.except_-940"><span class="linenos">940</span></a><span class="sd"> Builds an EXCEPT expression.</span> -</span><span id="Unionable.except_-941"><a href="#Unionable.except_-941"><span class="linenos">941</span></a> -</span><span id="Unionable.except_-942"><a href="#Unionable.except_-942"><span class="linenos">942</span></a><span class="sd"> Example:</span> -</span><span id="Unionable.except_-943"><a href="#Unionable.except_-943"><span class="linenos">943</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Unionable.except_-944"><a href="#Unionable.except_-944"><span class="linenos">944</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()</span> -</span><span id="Unionable.except_-945"><a href="#Unionable.except_-945"><span class="linenos">945</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> -</span><span id="Unionable.except_-946"><a href="#Unionable.except_-946"><span class="linenos">946</span></a> -</span><span id="Unionable.except_-947"><a href="#Unionable.except_-947"><span class="linenos">947</span></a><span class="sd"> Args:</span> -</span><span id="Unionable.except_-948"><a href="#Unionable.except_-948"><span class="linenos">948</span></a><span class="sd"> expression: the SQL code string.</span> -</span><span id="Unionable.except_-949"><a href="#Unionable.except_-949"><span class="linenos">949</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Unionable.except_-950"><a href="#Unionable.except_-950"><span class="linenos">950</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="Unionable.except_-951"><a href="#Unionable.except_-951"><span class="linenos">951</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Unionable.except_-952"><a href="#Unionable.except_-952"><span class="linenos">952</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Unionable.except_-953"><a href="#Unionable.except_-953"><span class="linenos">953</span></a> -</span><span id="Unionable.except_-954"><a href="#Unionable.except_-954"><span class="linenos">954</span></a><span class="sd"> Returns:</span> -</span><span id="Unionable.except_-955"><a href="#Unionable.except_-955"><span class="linenos">955</span></a><span class="sd"> The new Except expression.</span> -</span><span id="Unionable.except_-956"><a href="#Unionable.except_-956"><span class="linenos">956</span></a><span class="sd"> """</span> -</span><span id="Unionable.except_-957"><a href="#Unionable.except_-957"><span class="linenos">957</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_-933"><a href="#Unionable.except_-933"><span class="linenos">933</span></a> <span class="k">def</span> <span class="nf">except_</span><span class="p">(</span> +</span><span id="Unionable.except_-934"><a href="#Unionable.except_-934"><span class="linenos">934</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="Unionable.except_-935"><a href="#Unionable.except_-935"><span class="linenos">935</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Unionable</span><span class="p">:</span> +</span><span id="Unionable.except_-936"><a href="#Unionable.except_-936"><span class="linenos">936</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Unionable.except_-937"><a href="#Unionable.except_-937"><span class="linenos">937</span></a><span class="sd"> Builds an EXCEPT expression.</span> +</span><span id="Unionable.except_-938"><a href="#Unionable.except_-938"><span class="linenos">938</span></a> +</span><span id="Unionable.except_-939"><a href="#Unionable.except_-939"><span class="linenos">939</span></a><span class="sd"> Example:</span> +</span><span id="Unionable.except_-940"><a href="#Unionable.except_-940"><span class="linenos">940</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Unionable.except_-941"><a href="#Unionable.except_-941"><span class="linenos">941</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()</span> +</span><span id="Unionable.except_-942"><a href="#Unionable.except_-942"><span class="linenos">942</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> +</span><span id="Unionable.except_-943"><a href="#Unionable.except_-943"><span class="linenos">943</span></a> +</span><span id="Unionable.except_-944"><a href="#Unionable.except_-944"><span class="linenos">944</span></a><span class="sd"> Args:</span> +</span><span id="Unionable.except_-945"><a href="#Unionable.except_-945"><span class="linenos">945</span></a><span class="sd"> expression: the SQL code string.</span> +</span><span id="Unionable.except_-946"><a href="#Unionable.except_-946"><span class="linenos">946</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Unionable.except_-947"><a href="#Unionable.except_-947"><span class="linenos">947</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="Unionable.except_-948"><a href="#Unionable.except_-948"><span class="linenos">948</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Unionable.except_-949"><a href="#Unionable.except_-949"><span class="linenos">949</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Unionable.except_-950"><a href="#Unionable.except_-950"><span class="linenos">950</span></a> +</span><span id="Unionable.except_-951"><a href="#Unionable.except_-951"><span class="linenos">951</span></a><span class="sd"> Returns:</span> +</span><span id="Unionable.except_-952"><a href="#Unionable.except_-952"><span class="linenos">952</span></a><span class="sd"> The new Except expression.</span> +</span><span id="Unionable.except_-953"><a href="#Unionable.except_-953"><span class="linenos">953</span></a><span class="sd"> """</span> +</span><span id="Unionable.except_-954"><a href="#Unionable.except_-954"><span class="linenos">954</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> @@ -14840,11 +14849,11 @@ 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-960"><a href="#UDTF-960"><span class="linenos">960</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-961"><a href="#UDTF-961"><span class="linenos">961</span></a> <span class="nd">@property</span> -</span><span id="UDTF-962"><a href="#UDTF-962"><span class="linenos">962</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="UDTF-963"><a href="#UDTF-963"><span class="linenos">963</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="UDTF-964"><a href="#UDTF-964"><span class="linenos">964</span></a> <span class="k">return</span> <span class="n">alias</span><span class="o">.</span><span class="n">columns</span> <span class="k">if</span> <span class="n">alias</span> <span class="k">else</span> <span class="p">[]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="UDTF-957"><a href="#UDTF-957"><span class="linenos">957</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-958"><a href="#UDTF-958"><span class="linenos">958</span></a> <span class="nd">@property</span> +</span><span id="UDTF-959"><a href="#UDTF-959"><span class="linenos">959</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="UDTF-960"><a href="#UDTF-960"><span class="linenos">960</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="UDTF-961"><a href="#UDTF-961"><span class="linenos">961</span></a> <span class="k">return</span> <span class="n">alias</span><span class="o">.</span><span class="n">columns</span> <span class="k">if</span> <span class="n">alias</span> <span class="k">else</span> <span class="p">[]</span> </span></pre></div> @@ -14952,14 +14961,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-967"><a href="#Cache-967"><span class="linenos">967</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-968"><a href="#Cache-968"><span class="linenos">968</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Cache-969"><a href="#Cache-969"><span class="linenos">969</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Cache-970"><a href="#Cache-970"><span class="linenos">970</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Cache-971"><a href="#Cache-971"><span class="linenos">971</span></a> <span class="s2">"lazy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Cache-972"><a href="#Cache-972"><span class="linenos">972</span></a> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Cache-973"><a href="#Cache-973"><span class="linenos">973</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Cache-974"><a href="#Cache-974"><span class="linenos">974</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Cache-964"><a href="#Cache-964"><span class="linenos">964</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-965"><a href="#Cache-965"><span class="linenos">965</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Cache-966"><a href="#Cache-966"><span class="linenos">966</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Cache-967"><a href="#Cache-967"><span class="linenos">967</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Cache-968"><a href="#Cache-968"><span class="linenos">968</span></a> <span class="s2">"lazy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Cache-969"><a href="#Cache-969"><span class="linenos">969</span></a> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Cache-970"><a href="#Cache-970"><span class="linenos">970</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Cache-971"><a href="#Cache-971"><span class="linenos">971</span></a> <span class="p">}</span> </span></pre></div> @@ -15056,8 +15065,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-977"><a href="#Uncache-977"><span class="linenos">977</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-978"><a href="#Uncache-978"><span class="linenos">978</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-974"><a href="#Uncache-974"><span class="linenos">974</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-975"><a href="#Uncache-975"><span class="linenos">975</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -15154,21 +15163,21 @@ 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-981"><a href="#Create-981"><span class="linenos">981</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-982"><a href="#Create-982"><span class="linenos">982</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Create-983"><a href="#Create-983"><span class="linenos">983</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-984"><a href="#Create-984"><span class="linenos">984</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Create-985"><a href="#Create-985"><span class="linenos">985</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Create-986"><a href="#Create-986"><span class="linenos">986</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-987"><a href="#Create-987"><span class="linenos">987</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-988"><a href="#Create-988"><span class="linenos">988</span></a> <span class="s2">"properties"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-989"><a href="#Create-989"><span class="linenos">989</span></a> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-990"><a href="#Create-990"><span class="linenos">990</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-991"><a href="#Create-991"><span class="linenos">991</span></a> <span class="s2">"indexes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-992"><a href="#Create-992"><span class="linenos">992</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-993"><a href="#Create-993"><span class="linenos">993</span></a> <span class="s2">"begin"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-994"><a href="#Create-994"><span class="linenos">994</span></a> <span class="s2">"clone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-995"><a href="#Create-995"><span class="linenos">995</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Create-978"><a href="#Create-978"><span class="linenos">978</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-979"><a href="#Create-979"><span class="linenos">979</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Create-980"><a href="#Create-980"><span class="linenos">980</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-981"><a href="#Create-981"><span class="linenos">981</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Create-982"><a href="#Create-982"><span class="linenos">982</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Create-983"><a href="#Create-983"><span class="linenos">983</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-984"><a href="#Create-984"><span class="linenos">984</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-985"><a href="#Create-985"><span class="linenos">985</span></a> <span class="s2">"properties"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-986"><a href="#Create-986"><span class="linenos">986</span></a> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-987"><a href="#Create-987"><span class="linenos">987</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-988"><a href="#Create-988"><span class="linenos">988</span></a> <span class="s2">"indexes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-989"><a href="#Create-989"><span class="linenos">989</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-990"><a href="#Create-990"><span class="linenos">990</span></a> <span class="s2">"begin"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-991"><a href="#Create-991"><span class="linenos">991</span></a> <span class="s2">"clone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-992"><a href="#Create-992"><span class="linenos">992</span></a> <span class="p">}</span> </span></pre></div> @@ -15266,13 +15275,13 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Clone"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Clone-999"><a href="#Clone-999"><span class="linenos"> 999</span></a><span class="k">class</span> <span class="nc">Clone</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Clone-1000"><a href="#Clone-1000"><span class="linenos">1000</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Clone-1001"><a href="#Clone-1001"><span class="linenos">1001</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Clone-1002"><a href="#Clone-1002"><span class="linenos">1002</span></a> <span class="s2">"when"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Clone-1003"><a href="#Clone-1003"><span class="linenos">1003</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Clone-1004"><a href="#Clone-1004"><span class="linenos">1004</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Clone-1005"><a href="#Clone-1005"><span class="linenos">1005</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Clone-996"><a href="#Clone-996"><span class="linenos"> 996</span></a><span class="k">class</span> <span class="nc">Clone</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Clone-997"><a href="#Clone-997"><span class="linenos"> 997</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Clone-998"><a href="#Clone-998"><span class="linenos"> 998</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Clone-999"><a href="#Clone-999"><span class="linenos"> 999</span></a> <span class="s2">"when"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Clone-1000"><a href="#Clone-1000"><span class="linenos">1000</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Clone-1001"><a href="#Clone-1001"><span class="linenos">1001</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Clone-1002"><a href="#Clone-1002"><span class="linenos">1002</span></a> <span class="p">}</span> </span></pre></div> @@ -15369,8 +15378,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-1008"><a href="#Describe-1008"><span class="linenos">1008</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-1009"><a href="#Describe-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">"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-1005"><a href="#Describe-1005"><span class="linenos">1005</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-1006"><a href="#Describe-1006"><span class="linenos">1006</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -15467,8 +15476,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Pragma"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Pragma-1012"><a href="#Pragma-1012"><span class="linenos">1012</span></a><span class="k">class</span> <span class="nc">Pragma</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Pragma-1013"><a href="#Pragma-1013"><span class="linenos">1013</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Pragma-1009"><a href="#Pragma-1009"><span class="linenos">1009</span></a><span class="k">class</span> <span class="nc">Pragma</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Pragma-1010"><a href="#Pragma-1010"><span class="linenos">1010</span></a> <span class="k">pass</span> </span></pre></div> @@ -15554,8 +15563,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-1016"><a href="#Set-1016"><span class="linenos">1016</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-1017"><a href="#Set-1017"><span class="linenos">1017</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">"unset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"tag"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Set-1013"><a href="#Set-1013"><span class="linenos">1013</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-1014"><a href="#Set-1014"><span class="linenos">1014</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">"unset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"tag"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -15652,14 +15661,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-1020"><a href="#SetItem-1020"><span class="linenos">1020</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-1021"><a href="#SetItem-1021"><span class="linenos">1021</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="SetItem-1022"><a href="#SetItem-1022"><span class="linenos">1022</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="SetItem-1023"><a href="#SetItem-1023"><span class="linenos">1023</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="SetItem-1024"><a href="#SetItem-1024"><span class="linenos">1024</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="SetItem-1025"><a href="#SetItem-1025"><span class="linenos">1025</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-1026"><a href="#SetItem-1026"><span class="linenos">1026</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="SetItem-1027"><a href="#SetItem-1027"><span class="linenos">1027</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SetItem-1017"><a href="#SetItem-1017"><span class="linenos">1017</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-1018"><a href="#SetItem-1018"><span class="linenos">1018</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="SetItem-1019"><a href="#SetItem-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="SetItem-1020"><a href="#SetItem-1020"><span class="linenos">1020</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="SetItem-1021"><a href="#SetItem-1021"><span class="linenos">1021</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="SetItem-1022"><a href="#SetItem-1022"><span class="linenos">1022</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-1023"><a href="#SetItem-1023"><span class="linenos">1023</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="SetItem-1024"><a href="#SetItem-1024"><span class="linenos">1024</span></a> <span class="p">}</span> </span></pre></div> @@ -15756,24 +15765,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-1030"><a href="#Show-1030"><span class="linenos">1030</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-1031"><a href="#Show-1031"><span class="linenos">1031</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Show-1032"><a href="#Show-1032"><span class="linenos">1032</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Show-1033"><a href="#Show-1033"><span class="linenos">1033</span></a> <span class="s2">"target"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1034"><a href="#Show-1034"><span class="linenos">1034</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1035"><a href="#Show-1035"><span class="linenos">1035</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1036"><a href="#Show-1036"><span class="linenos">1036</span></a> <span class="s2">"like"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1037"><a href="#Show-1037"><span class="linenos">1037</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1038"><a href="#Show-1038"><span class="linenos">1038</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1039"><a href="#Show-1039"><span class="linenos">1039</span></a> <span class="s2">"full"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1040"><a href="#Show-1040"><span class="linenos">1040</span></a> <span class="s2">"mutex"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1041"><a href="#Show-1041"><span class="linenos">1041</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1042"><a href="#Show-1042"><span class="linenos">1042</span></a> <span class="s2">"channel"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1043"><a href="#Show-1043"><span class="linenos">1043</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1044"><a href="#Show-1044"><span class="linenos">1044</span></a> <span class="s2">"log"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1045"><a href="#Show-1045"><span class="linenos">1045</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1046"><a href="#Show-1046"><span class="linenos">1046</span></a> <span class="s2">"types"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-1047"><a href="#Show-1047"><span class="linenos">1047</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Show-1027"><a href="#Show-1027"><span class="linenos">1027</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-1028"><a href="#Show-1028"><span class="linenos">1028</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Show-1029"><a href="#Show-1029"><span class="linenos">1029</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Show-1030"><a href="#Show-1030"><span class="linenos">1030</span></a> <span class="s2">"target"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1031"><a href="#Show-1031"><span class="linenos">1031</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1032"><a href="#Show-1032"><span class="linenos">1032</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1033"><a href="#Show-1033"><span class="linenos">1033</span></a> <span class="s2">"like"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1034"><a href="#Show-1034"><span class="linenos">1034</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1035"><a href="#Show-1035"><span class="linenos">1035</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1036"><a href="#Show-1036"><span class="linenos">1036</span></a> <span class="s2">"full"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1037"><a href="#Show-1037"><span class="linenos">1037</span></a> <span class="s2">"mutex"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1038"><a href="#Show-1038"><span class="linenos">1038</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1039"><a href="#Show-1039"><span class="linenos">1039</span></a> <span class="s2">"channel"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1040"><a href="#Show-1040"><span class="linenos">1040</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1041"><a href="#Show-1041"><span class="linenos">1041</span></a> <span class="s2">"log"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1042"><a href="#Show-1042"><span class="linenos">1042</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1043"><a href="#Show-1043"><span class="linenos">1043</span></a> <span class="s2">"types"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-1044"><a href="#Show-1044"><span class="linenos">1044</span></a> <span class="p">}</span> </span></pre></div> @@ -15871,8 +15880,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-1050"><a href="#UserDefinedFunction-1050"><span class="linenos">1050</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-1051"><a href="#UserDefinedFunction-1051"><span class="linenos">1051</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1047"><a href="#UserDefinedFunction-1047"><span class="linenos">1047</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-1048"><a href="#UserDefinedFunction-1048"><span class="linenos">1048</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -15969,8 +15978,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-1054"><a href="#CharacterSet-1054"><span class="linenos">1054</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-1055"><a href="#CharacterSet-1055"><span class="linenos">1055</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1051"><a href="#CharacterSet-1051"><span class="linenos">1051</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-1052"><a href="#CharacterSet-1052"><span class="linenos">1052</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -16067,12 +16076,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-1058"><a href="#With-1058"><span class="linenos">1058</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-1059"><a href="#With-1059"><span class="linenos">1059</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-1060"><a href="#With-1060"><span class="linenos">1060</span></a> -</span><span id="With-1061"><a href="#With-1061"><span class="linenos">1061</span></a> <span class="nd">@property</span> -</span><span id="With-1062"><a href="#With-1062"><span class="linenos">1062</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-1063"><a href="#With-1063"><span class="linenos">1063</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-1055"><a href="#With-1055"><span class="linenos">1055</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-1056"><a href="#With-1056"><span class="linenos">1056</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-1057"><a href="#With-1057"><span class="linenos">1057</span></a> +</span><span id="With-1058"><a href="#With-1058"><span class="linenos">1058</span></a> <span class="nd">@property</span> +</span><span id="With-1059"><a href="#With-1059"><span class="linenos">1059</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-1060"><a href="#With-1060"><span class="linenos">1060</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> @@ -16180,8 +16189,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-1066"><a href="#WithinGroup-1066"><span class="linenos">1066</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-1067"><a href="#WithinGroup-1067"><span class="linenos">1067</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1063"><a href="#WithinGroup-1063"><span class="linenos">1063</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-1064"><a href="#WithinGroup-1064"><span class="linenos">1064</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -16278,8 +16287,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-1070"><a href="#CTE-1070"><span class="linenos">1070</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-1071"><a href="#CTE-1071"><span class="linenos">1071</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1067"><a href="#CTE-1067"><span class="linenos">1067</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-1068"><a href="#CTE-1068"><span class="linenos">1068</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -16382,12 +16391,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-1074"><a href="#TableAlias-1074"><span class="linenos">1074</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-1075"><a href="#TableAlias-1075"><span class="linenos">1075</span></a> <span class="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-1076"><a href="#TableAlias-1076"><span class="linenos">1076</span></a> -</span><span id="TableAlias-1077"><a href="#TableAlias-1077"><span class="linenos">1077</span></a> <span class="nd">@property</span> -</span><span id="TableAlias-1078"><a href="#TableAlias-1078"><span class="linenos">1078</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-1079"><a href="#TableAlias-1079"><span class="linenos">1079</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-1071"><a href="#TableAlias-1071"><span class="linenos">1071</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-1072"><a href="#TableAlias-1072"><span class="linenos">1072</span></a> <span class="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-1073"><a href="#TableAlias-1073"><span class="linenos">1073</span></a> +</span><span id="TableAlias-1074"><a href="#TableAlias-1074"><span class="linenos">1074</span></a> <span class="nd">@property</span> +</span><span id="TableAlias-1075"><a href="#TableAlias-1075"><span class="linenos">1075</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-1076"><a href="#TableAlias-1076"><span class="linenos">1076</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> @@ -16495,8 +16504,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-1082"><a href="#BitString-1082"><span class="linenos">1082</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-1083"><a href="#BitString-1083"><span class="linenos">1083</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitString-1079"><a href="#BitString-1079"><span class="linenos">1079</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-1080"><a href="#BitString-1080"><span class="linenos">1080</span></a> <span class="k">pass</span> </span></pre></div> @@ -16597,8 +16606,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-1086"><a href="#HexString-1086"><span class="linenos">1086</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-1087"><a href="#HexString-1087"><span class="linenos">1087</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="HexString-1083"><a href="#HexString-1083"><span class="linenos">1083</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-1084"><a href="#HexString-1084"><span class="linenos">1084</span></a> <span class="k">pass</span> </span></pre></div> @@ -16699,8 +16708,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-1090"><a href="#ByteString-1090"><span class="linenos">1090</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-1091"><a href="#ByteString-1091"><span class="linenos">1091</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ByteString-1087"><a href="#ByteString-1087"><span class="linenos">1087</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-1088"><a href="#ByteString-1088"><span class="linenos">1088</span></a> <span class="k">pass</span> </span></pre></div> @@ -16801,8 +16810,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#RawString"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RawString-1094"><a href="#RawString-1094"><span class="linenos">1094</span></a><span class="k">class</span> <span class="nc">RawString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="RawString-1095"><a href="#RawString-1095"><span class="linenos">1095</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RawString-1091"><a href="#RawString-1091"><span class="linenos">1091</span></a><span class="k">class</span> <span class="nc">RawString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="RawString-1092"><a href="#RawString-1092"><span class="linenos">1092</span></a> <span class="k">pass</span> </span></pre></div> @@ -16903,45 +16912,45 @@ 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-1098"><a href="#Column-1098"><span class="linenos">1098</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-1099"><a href="#Column-1099"><span class="linenos">1099</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"join_mark"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="Column-1100"><a href="#Column-1100"><span class="linenos">1100</span></a> -</span><span id="Column-1101"><a href="#Column-1101"><span class="linenos">1101</span></a> <span class="nd">@property</span> -</span><span id="Column-1102"><a href="#Column-1102"><span class="linenos">1102</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-1103"><a href="#Column-1103"><span class="linenos">1103</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-1104"><a href="#Column-1104"><span class="linenos">1104</span></a> -</span><span id="Column-1105"><a href="#Column-1105"><span class="linenos">1105</span></a> <span class="nd">@property</span> -</span><span id="Column-1106"><a href="#Column-1106"><span class="linenos">1106</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-1107"><a href="#Column-1107"><span class="linenos">1107</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-1108"><a href="#Column-1108"><span class="linenos">1108</span></a> -</span><span id="Column-1109"><a href="#Column-1109"><span class="linenos">1109</span></a> <span class="nd">@property</span> -</span><span id="Column-1110"><a href="#Column-1110"><span class="linenos">1110</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-1111"><a href="#Column-1111"><span class="linenos">1111</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-1112"><a href="#Column-1112"><span class="linenos">1112</span></a> -</span><span id="Column-1113"><a href="#Column-1113"><span class="linenos">1113</span></a> <span class="nd">@property</span> -</span><span id="Column-1114"><a href="#Column-1114"><span class="linenos">1114</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-1115"><a href="#Column-1115"><span class="linenos">1115</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> -</span><span id="Column-1116"><a href="#Column-1116"><span class="linenos">1116</span></a> -</span><span id="Column-1117"><a href="#Column-1117"><span class="linenos">1117</span></a> <span class="nd">@property</span> -</span><span id="Column-1118"><a href="#Column-1118"><span class="linenos">1118</span></a> <span class="k">def</span> <span class="nf">parts</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">Identifier</span><span class="p">]:</span> -</span><span id="Column-1119"><a href="#Column-1119"><span class="linenos">1119</span></a><span class="w"> </span><span class="sd">"""Return the parts of a column in order catalog, db, table, name."""</span> -</span><span id="Column-1120"><a href="#Column-1120"><span class="linenos">1120</span></a> <span class="k">return</span> <span class="p">[</span> -</span><span id="Column-1121"><a href="#Column-1121"><span class="linenos">1121</span></a> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Identifier</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="n">part</span><span class="p">])</span> -</span><span id="Column-1122"><a href="#Column-1122"><span class="linenos">1122</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"catalog"</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">,</span> <span class="s2">"table"</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="Column-1123"><a href="#Column-1123"><span class="linenos">1123</span></a> <span class="k">if</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">part</span><span class="p">)</span> -</span><span id="Column-1124"><a href="#Column-1124"><span class="linenos">1124</span></a> <span class="p">]</span> -</span><span id="Column-1125"><a href="#Column-1125"><span class="linenos">1125</span></a> -</span><span id="Column-1126"><a href="#Column-1126"><span class="linenos">1126</span></a> <span class="k">def</span> <span class="nf">to_dot</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Dot</span><span class="p">:</span> -</span><span id="Column-1127"><a href="#Column-1127"><span class="linenos">1127</span></a><span class="w"> </span><span class="sd">"""Converts the column into a dot expression."""</span> -</span><span id="Column-1128"><a href="#Column-1128"><span class="linenos">1128</span></a> <span class="n">parts</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parts</span> -</span><span id="Column-1129"><a href="#Column-1129"><span class="linenos">1129</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="Column-1130"><a href="#Column-1130"><span class="linenos">1130</span></a> -</span><span id="Column-1131"><a href="#Column-1131"><span class="linenos">1131</span></a> <span class="k">while</span> <span class="n">parent</span><span class="p">:</span> -</span><span id="Column-1132"><a href="#Column-1132"><span class="linenos">1132</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="n">Dot</span><span class="p">):</span> -</span><span id="Column-1133"><a href="#Column-1133"><span class="linenos">1133</span></a> <span class="n">parts</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">parent</span><span class="o">.</span><span class="n">expression</span><span class="p">)</span> -</span><span id="Column-1134"><a href="#Column-1134"><span class="linenos">1134</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Column-1135"><a href="#Column-1135"><span class="linenos">1135</span></a> -</span><span id="Column-1136"><a href="#Column-1136"><span class="linenos">1136</span></a> <span class="k">return</span> <span class="n">Dot</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">parts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Column-1095"><a href="#Column-1095"><span class="linenos">1095</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-1096"><a href="#Column-1096"><span class="linenos">1096</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"join_mark"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Column-1097"><a href="#Column-1097"><span class="linenos">1097</span></a> +</span><span id="Column-1098"><a href="#Column-1098"><span class="linenos">1098</span></a> <span class="nd">@property</span> +</span><span id="Column-1099"><a href="#Column-1099"><span class="linenos">1099</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-1100"><a href="#Column-1100"><span class="linenos">1100</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-1101"><a href="#Column-1101"><span class="linenos">1101</span></a> +</span><span id="Column-1102"><a href="#Column-1102"><span class="linenos">1102</span></a> <span class="nd">@property</span> +</span><span id="Column-1103"><a href="#Column-1103"><span class="linenos">1103</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-1104"><a href="#Column-1104"><span class="linenos">1104</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-1105"><a href="#Column-1105"><span class="linenos">1105</span></a> +</span><span id="Column-1106"><a href="#Column-1106"><span class="linenos">1106</span></a> <span class="nd">@property</span> +</span><span id="Column-1107"><a href="#Column-1107"><span class="linenos">1107</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-1108"><a href="#Column-1108"><span class="linenos">1108</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-1109"><a href="#Column-1109"><span class="linenos">1109</span></a> +</span><span id="Column-1110"><a href="#Column-1110"><span class="linenos">1110</span></a> <span class="nd">@property</span> +</span><span id="Column-1111"><a href="#Column-1111"><span class="linenos">1111</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-1112"><a href="#Column-1112"><span class="linenos">1112</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> +</span><span id="Column-1113"><a href="#Column-1113"><span class="linenos">1113</span></a> +</span><span id="Column-1114"><a href="#Column-1114"><span class="linenos">1114</span></a> <span class="nd">@property</span> +</span><span id="Column-1115"><a href="#Column-1115"><span class="linenos">1115</span></a> <span class="k">def</span> <span class="nf">parts</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">Identifier</span><span class="p">]:</span> +</span><span id="Column-1116"><a href="#Column-1116"><span class="linenos">1116</span></a><span class="w"> </span><span class="sd">"""Return the parts of a column in order catalog, db, table, name."""</span> +</span><span id="Column-1117"><a href="#Column-1117"><span class="linenos">1117</span></a> <span class="k">return</span> <span class="p">[</span> +</span><span id="Column-1118"><a href="#Column-1118"><span class="linenos">1118</span></a> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Identifier</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="n">part</span><span class="p">])</span> +</span><span id="Column-1119"><a href="#Column-1119"><span class="linenos">1119</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"catalog"</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">,</span> <span class="s2">"table"</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="Column-1120"><a href="#Column-1120"><span class="linenos">1120</span></a> <span class="k">if</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">part</span><span class="p">)</span> +</span><span id="Column-1121"><a href="#Column-1121"><span class="linenos">1121</span></a> <span class="p">]</span> +</span><span id="Column-1122"><a href="#Column-1122"><span class="linenos">1122</span></a> +</span><span id="Column-1123"><a href="#Column-1123"><span class="linenos">1123</span></a> <span class="k">def</span> <span class="nf">to_dot</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Dot</span><span class="p">:</span> +</span><span id="Column-1124"><a href="#Column-1124"><span class="linenos">1124</span></a><span class="w"> </span><span class="sd">"""Converts the column into a dot expression."""</span> +</span><span id="Column-1125"><a href="#Column-1125"><span class="linenos">1125</span></a> <span class="n">parts</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parts</span> +</span><span id="Column-1126"><a href="#Column-1126"><span class="linenos">1126</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="Column-1127"><a href="#Column-1127"><span class="linenos">1127</span></a> +</span><span id="Column-1128"><a href="#Column-1128"><span class="linenos">1128</span></a> <span class="k">while</span> <span class="n">parent</span><span class="p">:</span> +</span><span id="Column-1129"><a href="#Column-1129"><span class="linenos">1129</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="n">Dot</span><span class="p">):</span> +</span><span id="Column-1130"><a href="#Column-1130"><span class="linenos">1130</span></a> <span class="n">parts</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">parent</span><span class="o">.</span><span class="n">expression</span><span class="p">)</span> +</span><span id="Column-1131"><a href="#Column-1131"><span class="linenos">1131</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Column-1132"><a href="#Column-1132"><span class="linenos">1132</span></a> +</span><span id="Column-1133"><a href="#Column-1133"><span class="linenos">1133</span></a> <span class="k">return</span> <span class="n">Dot</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">parts</span><span class="p">)</span> </span></pre></div> @@ -17046,17 +17055,17 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Column.to_dot"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Column.to_dot-1126"><a href="#Column.to_dot-1126"><span class="linenos">1126</span></a> <span class="k">def</span> <span class="nf">to_dot</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Dot</span><span class="p">:</span> -</span><span id="Column.to_dot-1127"><a href="#Column.to_dot-1127"><span class="linenos">1127</span></a><span class="w"> </span><span class="sd">"""Converts the column into a dot expression."""</span> -</span><span id="Column.to_dot-1128"><a href="#Column.to_dot-1128"><span class="linenos">1128</span></a> <span class="n">parts</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parts</span> -</span><span id="Column.to_dot-1129"><a href="#Column.to_dot-1129"><span class="linenos">1129</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="Column.to_dot-1130"><a href="#Column.to_dot-1130"><span class="linenos">1130</span></a> -</span><span id="Column.to_dot-1131"><a href="#Column.to_dot-1131"><span class="linenos">1131</span></a> <span class="k">while</span> <span class="n">parent</span><span class="p">:</span> -</span><span id="Column.to_dot-1132"><a href="#Column.to_dot-1132"><span class="linenos">1132</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="n">Dot</span><span class="p">):</span> -</span><span id="Column.to_dot-1133"><a href="#Column.to_dot-1133"><span class="linenos">1133</span></a> <span class="n">parts</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">parent</span><span class="o">.</span><span class="n">expression</span><span class="p">)</span> -</span><span id="Column.to_dot-1134"><a href="#Column.to_dot-1134"><span class="linenos">1134</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Column.to_dot-1135"><a href="#Column.to_dot-1135"><span class="linenos">1135</span></a> -</span><span id="Column.to_dot-1136"><a href="#Column.to_dot-1136"><span class="linenos">1136</span></a> <span class="k">return</span> <span class="n">Dot</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">parts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Column.to_dot-1123"><a href="#Column.to_dot-1123"><span class="linenos">1123</span></a> <span class="k">def</span> <span class="nf">to_dot</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Dot</span><span class="p">:</span> +</span><span id="Column.to_dot-1124"><a href="#Column.to_dot-1124"><span class="linenos">1124</span></a><span class="w"> </span><span class="sd">"""Converts the column into a dot expression."""</span> +</span><span id="Column.to_dot-1125"><a href="#Column.to_dot-1125"><span class="linenos">1125</span></a> <span class="n">parts</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parts</span> +</span><span id="Column.to_dot-1126"><a href="#Column.to_dot-1126"><span class="linenos">1126</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="Column.to_dot-1127"><a href="#Column.to_dot-1127"><span class="linenos">1127</span></a> +</span><span id="Column.to_dot-1128"><a href="#Column.to_dot-1128"><span class="linenos">1128</span></a> <span class="k">while</span> <span class="n">parent</span><span class="p">:</span> +</span><span id="Column.to_dot-1129"><a href="#Column.to_dot-1129"><span class="linenos">1129</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="n">Dot</span><span class="p">):</span> +</span><span id="Column.to_dot-1130"><a href="#Column.to_dot-1130"><span class="linenos">1130</span></a> <span class="n">parts</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">parent</span><span class="o">.</span><span class="n">expression</span><span class="p">)</span> +</span><span id="Column.to_dot-1131"><a href="#Column.to_dot-1131"><span class="linenos">1131</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Column.to_dot-1132"><a href="#Column.to_dot-1132"><span class="linenos">1132</span></a> +</span><span id="Column.to_dot-1133"><a href="#Column.to_dot-1133"><span class="linenos">1133</span></a> <span class="k">return</span> <span class="n">Dot</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">parts</span><span class="p">)</span> </span></pre></div> @@ -17158,8 +17167,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#ColumnPosition"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ColumnPosition-1139"><a href="#ColumnPosition-1139"><span class="linenos">1139</span></a><span class="k">class</span> <span class="nc">ColumnPosition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="ColumnPosition-1140"><a href="#ColumnPosition-1140"><span class="linenos">1140</span></a> <span class="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">"position"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ColumnPosition-1136"><a href="#ColumnPosition-1136"><span class="linenos">1136</span></a><span class="k">class</span> <span class="nc">ColumnPosition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="ColumnPosition-1137"><a href="#ColumnPosition-1137"><span class="linenos">1137</span></a> <span class="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">"position"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -17256,18 +17265,18 @@ 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-1143"><a href="#ColumnDef-1143"><span class="linenos">1143</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-1144"><a href="#ColumnDef-1144"><span class="linenos">1144</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="ColumnDef-1145"><a href="#ColumnDef-1145"><span class="linenos">1145</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="ColumnDef-1146"><a href="#ColumnDef-1146"><span class="linenos">1146</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ColumnDef-1147"><a href="#ColumnDef-1147"><span class="linenos">1147</span></a> <span class="s2">"constraints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ColumnDef-1148"><a href="#ColumnDef-1148"><span class="linenos">1148</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ColumnDef-1149"><a href="#ColumnDef-1149"><span class="linenos">1149</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ColumnDef-1150"><a href="#ColumnDef-1150"><span class="linenos">1150</span></a> <span class="p">}</span> -</span><span id="ColumnDef-1151"><a href="#ColumnDef-1151"><span class="linenos">1151</span></a> -</span><span id="ColumnDef-1152"><a href="#ColumnDef-1152"><span class="linenos">1152</span></a> <span class="nd">@property</span> -</span><span id="ColumnDef-1153"><a href="#ColumnDef-1153"><span class="linenos">1153</span></a> <span class="k">def</span> <span class="nf">constraints</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">ColumnConstraint</span><span class="p">]:</span> -</span><span id="ColumnDef-1154"><a href="#ColumnDef-1154"><span class="linenos">1154</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">"constraints"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ColumnDef-1140"><a href="#ColumnDef-1140"><span class="linenos">1140</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-1141"><a href="#ColumnDef-1141"><span class="linenos">1141</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="ColumnDef-1142"><a href="#ColumnDef-1142"><span class="linenos">1142</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="ColumnDef-1143"><a href="#ColumnDef-1143"><span class="linenos">1143</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ColumnDef-1144"><a href="#ColumnDef-1144"><span class="linenos">1144</span></a> <span class="s2">"constraints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ColumnDef-1145"><a href="#ColumnDef-1145"><span class="linenos">1145</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ColumnDef-1146"><a href="#ColumnDef-1146"><span class="linenos">1146</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ColumnDef-1147"><a href="#ColumnDef-1147"><span class="linenos">1147</span></a> <span class="p">}</span> +</span><span id="ColumnDef-1148"><a href="#ColumnDef-1148"><span class="linenos">1148</span></a> +</span><span id="ColumnDef-1149"><a href="#ColumnDef-1149"><span class="linenos">1149</span></a> <span class="nd">@property</span> +</span><span id="ColumnDef-1150"><a href="#ColumnDef-1150"><span class="linenos">1150</span></a> <span class="k">def</span> <span class="nf">constraints</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">ColumnConstraint</span><span class="p">]:</span> +</span><span id="ColumnDef-1151"><a href="#ColumnDef-1151"><span class="linenos">1151</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">"constraints"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> </span></pre></div> @@ -17375,15 +17384,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-1157"><a href="#AlterColumn-1157"><span class="linenos">1157</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-1158"><a href="#AlterColumn-1158"><span class="linenos">1158</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="AlterColumn-1159"><a href="#AlterColumn-1159"><span class="linenos">1159</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="AlterColumn-1160"><a href="#AlterColumn-1160"><span class="linenos">1160</span></a> <span class="s2">"dtype"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="AlterColumn-1161"><a href="#AlterColumn-1161"><span class="linenos">1161</span></a> <span class="s2">"collate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="AlterColumn-1162"><a href="#AlterColumn-1162"><span class="linenos">1162</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="AlterColumn-1163"><a href="#AlterColumn-1163"><span class="linenos">1163</span></a> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="AlterColumn-1164"><a href="#AlterColumn-1164"><span class="linenos">1164</span></a> <span class="s2">"drop"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="AlterColumn-1165"><a href="#AlterColumn-1165"><span class="linenos">1165</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="AlterColumn-1154"><a href="#AlterColumn-1154"><span class="linenos">1154</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-1155"><a href="#AlterColumn-1155"><span class="linenos">1155</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="AlterColumn-1156"><a href="#AlterColumn-1156"><span class="linenos">1156</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="AlterColumn-1157"><a href="#AlterColumn-1157"><span class="linenos">1157</span></a> <span class="s2">"dtype"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="AlterColumn-1158"><a href="#AlterColumn-1158"><span class="linenos">1158</span></a> <span class="s2">"collate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="AlterColumn-1159"><a href="#AlterColumn-1159"><span class="linenos">1159</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="AlterColumn-1160"><a href="#AlterColumn-1160"><span class="linenos">1160</span></a> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="AlterColumn-1161"><a href="#AlterColumn-1161"><span class="linenos">1161</span></a> <span class="s2">"drop"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="AlterColumn-1162"><a href="#AlterColumn-1162"><span class="linenos">1162</span></a> <span class="p">}</span> </span></pre></div> @@ -17480,8 +17489,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-1168"><a href="#RenameTable-1168"><span class="linenos">1168</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-1169"><a href="#RenameTable-1169"><span class="linenos">1169</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RenameTable-1165"><a href="#RenameTable-1165"><span class="linenos">1165</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-1166"><a href="#RenameTable-1166"><span class="linenos">1166</span></a> <span class="k">pass</span> </span></pre></div> @@ -17567,8 +17576,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Comment"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Comment-1172"><a href="#Comment-1172"><span class="linenos">1172</span></a><span class="k">class</span> <span class="nc">Comment</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Comment-1173"><a href="#Comment-1173"><span class="linenos">1173</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">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">"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="Comment-1169"><a href="#Comment-1169"><span class="linenos">1169</span></a><span class="k">class</span> <span class="nc">Comment</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Comment-1170"><a href="#Comment-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">"kind"</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">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -17665,14 +17674,14 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#MergeTreeTTLAction"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="MergeTreeTTLAction-1177"><a href="#MergeTreeTTLAction-1177"><span class="linenos">1177</span></a><span class="k">class</span> <span class="nc">MergeTreeTTLAction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="MergeTreeTTLAction-1178"><a href="#MergeTreeTTLAction-1178"><span class="linenos">1178</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="MergeTreeTTLAction-1179"><a href="#MergeTreeTTLAction-1179"><span class="linenos">1179</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="MergeTreeTTLAction-1180"><a href="#MergeTreeTTLAction-1180"><span class="linenos">1180</span></a> <span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MergeTreeTTLAction-1181"><a href="#MergeTreeTTLAction-1181"><span class="linenos">1181</span></a> <span class="s2">"recompress"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MergeTreeTTLAction-1182"><a href="#MergeTreeTTLAction-1182"><span class="linenos">1182</span></a> <span class="s2">"to_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MergeTreeTTLAction-1183"><a href="#MergeTreeTTLAction-1183"><span class="linenos">1183</span></a> <span class="s2">"to_volume"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MergeTreeTTLAction-1184"><a href="#MergeTreeTTLAction-1184"><span class="linenos">1184</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="MergeTreeTTLAction-1174"><a href="#MergeTreeTTLAction-1174"><span class="linenos">1174</span></a><span class="k">class</span> <span class="nc">MergeTreeTTLAction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="MergeTreeTTLAction-1175"><a href="#MergeTreeTTLAction-1175"><span class="linenos">1175</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="MergeTreeTTLAction-1176"><a href="#MergeTreeTTLAction-1176"><span class="linenos">1176</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="MergeTreeTTLAction-1177"><a href="#MergeTreeTTLAction-1177"><span class="linenos">1177</span></a> <span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MergeTreeTTLAction-1178"><a href="#MergeTreeTTLAction-1178"><span class="linenos">1178</span></a> <span class="s2">"recompress"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MergeTreeTTLAction-1179"><a href="#MergeTreeTTLAction-1179"><span class="linenos">1179</span></a> <span class="s2">"to_disk"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MergeTreeTTLAction-1180"><a href="#MergeTreeTTLAction-1180"><span class="linenos">1180</span></a> <span class="s2">"to_volume"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MergeTreeTTLAction-1181"><a href="#MergeTreeTTLAction-1181"><span class="linenos">1181</span></a> <span class="p">}</span> </span></pre></div> @@ -17769,13 +17778,13 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#MergeTreeTTL"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="MergeTreeTTL-1188"><a href="#MergeTreeTTL-1188"><span class="linenos">1188</span></a><span class="k">class</span> <span class="nc">MergeTreeTTL</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="MergeTreeTTL-1189"><a href="#MergeTreeTTL-1189"><span class="linenos">1189</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="MergeTreeTTL-1190"><a href="#MergeTreeTTL-1190"><span class="linenos">1190</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="MergeTreeTTL-1191"><a href="#MergeTreeTTL-1191"><span class="linenos">1191</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MergeTreeTTL-1192"><a href="#MergeTreeTTL-1192"><span class="linenos">1192</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MergeTreeTTL-1193"><a href="#MergeTreeTTL-1193"><span class="linenos">1193</span></a> <span class="s2">"aggregates"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MergeTreeTTL-1194"><a href="#MergeTreeTTL-1194"><span class="linenos">1194</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="MergeTreeTTL-1185"><a href="#MergeTreeTTL-1185"><span class="linenos">1185</span></a><span class="k">class</span> <span class="nc">MergeTreeTTL</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="MergeTreeTTL-1186"><a href="#MergeTreeTTL-1186"><span class="linenos">1186</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="MergeTreeTTL-1187"><a href="#MergeTreeTTL-1187"><span class="linenos">1187</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="MergeTreeTTL-1188"><a href="#MergeTreeTTL-1188"><span class="linenos">1188</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MergeTreeTTL-1189"><a href="#MergeTreeTTL-1189"><span class="linenos">1189</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MergeTreeTTL-1190"><a href="#MergeTreeTTL-1190"><span class="linenos">1190</span></a> <span class="s2">"aggregates"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MergeTreeTTL-1191"><a href="#MergeTreeTTL-1191"><span class="linenos">1191</span></a> <span class="p">}</span> </span></pre></div> @@ -17872,12 +17881,12 @@ 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-1197"><a href="#ColumnConstraint-1197"><span class="linenos">1197</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-1198"><a href="#ColumnConstraint-1198"><span class="linenos">1198</span></a> <span class="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="ColumnConstraint-1199"><a href="#ColumnConstraint-1199"><span class="linenos">1199</span></a> -</span><span id="ColumnConstraint-1200"><a href="#ColumnConstraint-1200"><span class="linenos">1200</span></a> <span class="nd">@property</span> -</span><span id="ColumnConstraint-1201"><a href="#ColumnConstraint-1201"><span class="linenos">1201</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 class="o">-></span> <span class="n">ColumnConstraintKind</span><span class="p">:</span> -</span><span id="ColumnConstraint-1202"><a href="#ColumnConstraint-1202"><span class="linenos">1202</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">"kind"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ColumnConstraint-1194"><a href="#ColumnConstraint-1194"><span class="linenos">1194</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-1195"><a href="#ColumnConstraint-1195"><span class="linenos">1195</span></a> <span class="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="ColumnConstraint-1196"><a href="#ColumnConstraint-1196"><span class="linenos">1196</span></a> +</span><span id="ColumnConstraint-1197"><a href="#ColumnConstraint-1197"><span class="linenos">1197</span></a> <span class="nd">@property</span> +</span><span id="ColumnConstraint-1198"><a href="#ColumnConstraint-1198"><span class="linenos">1198</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 class="o">-></span> <span class="n">ColumnConstraintKind</span><span class="p">:</span> +</span><span id="ColumnConstraint-1199"><a href="#ColumnConstraint-1199"><span class="linenos">1199</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">"kind"</span><span class="p">]</span> </span></pre></div> @@ -17985,8 +17994,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-1205"><a href="#ColumnConstraintKind-1205"><span class="linenos">1205</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-1206"><a href="#ColumnConstraintKind-1206"><span class="linenos">1206</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ColumnConstraintKind-1202"><a href="#ColumnConstraintKind-1202"><span class="linenos">1202</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-1203"><a href="#ColumnConstraintKind-1203"><span class="linenos">1203</span></a> <span class="k">pass</span> </span></pre></div> @@ -18072,8 +18081,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-1209"><a href="#AutoIncrementColumnConstraint-1209"><span class="linenos">1209</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-1210"><a href="#AutoIncrementColumnConstraint-1210"><span class="linenos">1210</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="AutoIncrementColumnConstraint-1206"><a href="#AutoIncrementColumnConstraint-1206"><span class="linenos">1206</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-1207"><a href="#AutoIncrementColumnConstraint-1207"><span class="linenos">1207</span></a> <span class="k">pass</span> </span></pre></div> @@ -18159,8 +18168,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-1213"><a href="#CaseSpecificColumnConstraint-1213"><span class="linenos">1213</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-1214"><a href="#CaseSpecificColumnConstraint-1214"><span class="linenos">1214</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-1210"><a href="#CaseSpecificColumnConstraint-1210"><span class="linenos">1210</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-1211"><a href="#CaseSpecificColumnConstraint-1211"><span class="linenos">1211</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> @@ -18257,8 +18266,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-1217"><a href="#CharacterSetColumnConstraint-1217"><span class="linenos">1217</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-1218"><a href="#CharacterSetColumnConstraint-1218"><span class="linenos">1218</span></a> <span class="n">arg_types</span> <span class="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-1214"><a href="#CharacterSetColumnConstraint-1214"><span class="linenos">1214</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-1215"><a href="#CharacterSetColumnConstraint-1215"><span class="linenos">1215</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -18355,8 +18364,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-1221"><a href="#CheckColumnConstraint-1221"><span class="linenos">1221</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-1222"><a href="#CheckColumnConstraint-1222"><span class="linenos">1222</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CheckColumnConstraint-1218"><a href="#CheckColumnConstraint-1218"><span class="linenos">1218</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-1219"><a href="#CheckColumnConstraint-1219"><span class="linenos">1219</span></a> <span class="k">pass</span> </span></pre></div> @@ -18442,8 +18451,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-1225"><a href="#CollateColumnConstraint-1225"><span class="linenos">1225</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-1226"><a href="#CollateColumnConstraint-1226"><span class="linenos">1226</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CollateColumnConstraint-1222"><a href="#CollateColumnConstraint-1222"><span class="linenos">1222</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-1223"><a href="#CollateColumnConstraint-1223"><span class="linenos">1223</span></a> <span class="k">pass</span> </span></pre></div> @@ -18529,8 +18538,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-1229"><a href="#CommentColumnConstraint-1229"><span class="linenos">1229</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-1230"><a href="#CommentColumnConstraint-1230"><span class="linenos">1230</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CommentColumnConstraint-1226"><a href="#CommentColumnConstraint-1226"><span class="linenos">1226</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-1227"><a href="#CommentColumnConstraint-1227"><span class="linenos">1227</span></a> <span class="k">pass</span> </span></pre></div> @@ -18616,8 +18625,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#CompressColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CompressColumnConstraint-1233"><a href="#CompressColumnConstraint-1233"><span class="linenos">1233</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-1234"><a href="#CompressColumnConstraint-1234"><span class="linenos">1234</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CompressColumnConstraint-1230"><a href="#CompressColumnConstraint-1230"><span class="linenos">1230</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-1231"><a href="#CompressColumnConstraint-1231"><span class="linenos">1231</span></a> <span class="k">pass</span> </span></pre></div> @@ -18703,8 +18712,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-1237"><a href="#DateFormatColumnConstraint-1237"><span class="linenos">1237</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-1238"><a href="#DateFormatColumnConstraint-1238"><span class="linenos">1238</span></a> <span class="n">arg_types</span> <span class="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-1234"><a href="#DateFormatColumnConstraint-1234"><span class="linenos">1234</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-1235"><a href="#DateFormatColumnConstraint-1235"><span class="linenos">1235</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -18801,8 +18810,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-1241"><a href="#DefaultColumnConstraint-1241"><span class="linenos">1241</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-1242"><a href="#DefaultColumnConstraint-1242"><span class="linenos">1242</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DefaultColumnConstraint-1238"><a href="#DefaultColumnConstraint-1238"><span class="linenos">1238</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-1239"><a href="#DefaultColumnConstraint-1239"><span class="linenos">1239</span></a> <span class="k">pass</span> </span></pre></div> @@ -18888,8 +18897,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-1245"><a href="#EncodeColumnConstraint-1245"><span class="linenos">1245</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-1246"><a href="#EncodeColumnConstraint-1246"><span class="linenos">1246</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="EncodeColumnConstraint-1242"><a href="#EncodeColumnConstraint-1242"><span class="linenos">1242</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-1243"><a href="#EncodeColumnConstraint-1243"><span class="linenos">1243</span></a> <span class="k">pass</span> </span></pre></div> @@ -18975,18 +18984,18 @@ 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-1249"><a href="#GeneratedAsIdentityColumnConstraint-1249"><span class="linenos">1249</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-1250"><a href="#GeneratedAsIdentityColumnConstraint-1250"><span class="linenos">1250</span></a> <span class="c1"># this: True -> ALWAYS, this: False -> BY DEFAULT</span> -</span><span id="GeneratedAsIdentityColumnConstraint-1251"><a href="#GeneratedAsIdentityColumnConstraint-1251"><span class="linenos">1251</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="GeneratedAsIdentityColumnConstraint-1252"><a href="#GeneratedAsIdentityColumnConstraint-1252"><span class="linenos">1252</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-1253"><a href="#GeneratedAsIdentityColumnConstraint-1253"><span class="linenos">1253</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-1254"><a href="#GeneratedAsIdentityColumnConstraint-1254"><span class="linenos">1254</span></a> <span class="s2">"on_null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-1255"><a href="#GeneratedAsIdentityColumnConstraint-1255"><span class="linenos">1255</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-1256"><a href="#GeneratedAsIdentityColumnConstraint-1256"><span class="linenos">1256</span></a> <span class="s2">"increment"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-1257"><a href="#GeneratedAsIdentityColumnConstraint-1257"><span class="linenos">1257</span></a> <span class="s2">"minvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-1258"><a href="#GeneratedAsIdentityColumnConstraint-1258"><span class="linenos">1258</span></a> <span class="s2">"maxvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-1259"><a href="#GeneratedAsIdentityColumnConstraint-1259"><span class="linenos">1259</span></a> <span class="s2">"cycle"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-1260"><a href="#GeneratedAsIdentityColumnConstraint-1260"><span class="linenos">1260</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="GeneratedAsIdentityColumnConstraint-1246"><a href="#GeneratedAsIdentityColumnConstraint-1246"><span class="linenos">1246</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-1247"><a href="#GeneratedAsIdentityColumnConstraint-1247"><span class="linenos">1247</span></a> <span class="c1"># this: True -> ALWAYS, this: False -> BY DEFAULT</span> +</span><span id="GeneratedAsIdentityColumnConstraint-1248"><a href="#GeneratedAsIdentityColumnConstraint-1248"><span class="linenos">1248</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="GeneratedAsIdentityColumnConstraint-1249"><a href="#GeneratedAsIdentityColumnConstraint-1249"><span class="linenos">1249</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-1250"><a href="#GeneratedAsIdentityColumnConstraint-1250"><span class="linenos">1250</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-1251"><a href="#GeneratedAsIdentityColumnConstraint-1251"><span class="linenos">1251</span></a> <span class="s2">"on_null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-1252"><a href="#GeneratedAsIdentityColumnConstraint-1252"><span class="linenos">1252</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-1253"><a href="#GeneratedAsIdentityColumnConstraint-1253"><span class="linenos">1253</span></a> <span class="s2">"increment"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-1254"><a href="#GeneratedAsIdentityColumnConstraint-1254"><span class="linenos">1254</span></a> <span class="s2">"minvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-1255"><a href="#GeneratedAsIdentityColumnConstraint-1255"><span class="linenos">1255</span></a> <span class="s2">"maxvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-1256"><a href="#GeneratedAsIdentityColumnConstraint-1256"><span class="linenos">1256</span></a> <span class="s2">"cycle"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-1257"><a href="#GeneratedAsIdentityColumnConstraint-1257"><span class="linenos">1257</span></a> <span class="p">}</span> </span></pre></div> @@ -19084,8 +19093,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#InlineLengthColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="InlineLengthColumnConstraint-1263"><a href="#InlineLengthColumnConstraint-1263"><span class="linenos">1263</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-1264"><a href="#InlineLengthColumnConstraint-1264"><span class="linenos">1264</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="InlineLengthColumnConstraint-1260"><a href="#InlineLengthColumnConstraint-1260"><span class="linenos">1260</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-1261"><a href="#InlineLengthColumnConstraint-1261"><span class="linenos">1261</span></a> <span class="k">pass</span> </span></pre></div> @@ -19171,8 +19180,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-1267"><a href="#NotNullColumnConstraint-1267"><span class="linenos">1267</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-1268"><a href="#NotNullColumnConstraint-1268"><span class="linenos">1268</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-1264"><a href="#NotNullColumnConstraint-1264"><span class="linenos">1264</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-1265"><a href="#NotNullColumnConstraint-1265"><span class="linenos">1265</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> @@ -19269,8 +19278,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#OnUpdateColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="OnUpdateColumnConstraint-1272"><a href="#OnUpdateColumnConstraint-1272"><span class="linenos">1272</span></a><span class="k">class</span> <span class="nc">OnUpdateColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="OnUpdateColumnConstraint-1273"><a href="#OnUpdateColumnConstraint-1273"><span class="linenos">1273</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="OnUpdateColumnConstraint-1269"><a href="#OnUpdateColumnConstraint-1269"><span class="linenos">1269</span></a><span class="k">class</span> <span class="nc">OnUpdateColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="OnUpdateColumnConstraint-1270"><a href="#OnUpdateColumnConstraint-1270"><span class="linenos">1270</span></a> <span class="k">pass</span> </span></pre></div> @@ -19356,8 +19365,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-1276"><a href="#PrimaryKeyColumnConstraint-1276"><span class="linenos">1276</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-1277"><a href="#PrimaryKeyColumnConstraint-1277"><span class="linenos">1277</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-1273"><a href="#PrimaryKeyColumnConstraint-1273"><span class="linenos">1273</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-1274"><a href="#PrimaryKeyColumnConstraint-1274"><span class="linenos">1274</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> @@ -19454,8 +19463,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-1280"><a href="#TitleColumnConstraint-1280"><span class="linenos">1280</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-1281"><a href="#TitleColumnConstraint-1281"><span class="linenos">1281</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TitleColumnConstraint-1277"><a href="#TitleColumnConstraint-1277"><span class="linenos">1277</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-1278"><a href="#TitleColumnConstraint-1278"><span class="linenos">1278</span></a> <span class="k">pass</span> </span></pre></div> @@ -19541,8 +19550,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-1284"><a href="#UniqueColumnConstraint-1284"><span class="linenos">1284</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-1285"><a href="#UniqueColumnConstraint-1285"><span class="linenos">1285</span></a> <span class="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="UniqueColumnConstraint-1281"><a href="#UniqueColumnConstraint-1281"><span class="linenos">1281</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-1282"><a href="#UniqueColumnConstraint-1282"><span class="linenos">1282</span></a> <span class="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> @@ -19639,8 +19648,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-1288"><a href="#UppercaseColumnConstraint-1288"><span class="linenos">1288</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-1289"><a href="#UppercaseColumnConstraint-1289"><span class="linenos">1289</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-1285"><a href="#UppercaseColumnConstraint-1285"><span class="linenos">1285</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-1286"><a href="#UppercaseColumnConstraint-1286"><span class="linenos">1286</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> @@ -19737,8 +19746,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-1292"><a href="#PathColumnConstraint-1292"><span class="linenos">1292</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-1293"><a href="#PathColumnConstraint-1293"><span class="linenos">1293</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="PathColumnConstraint-1289"><a href="#PathColumnConstraint-1289"><span class="linenos">1289</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-1290"><a href="#PathColumnConstraint-1290"><span class="linenos">1290</span></a> <span class="k">pass</span> </span></pre></div> @@ -19824,8 +19833,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-1296"><a href="#Constraint-1296"><span class="linenos">1296</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-1297"><a href="#Constraint-1297"><span class="linenos">1297</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1293"><a href="#Constraint-1293"><span class="linenos">1293</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-1294"><a href="#Constraint-1294"><span class="linenos">1294</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -19922,122 +19931,123 @@ 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-1300"><a href="#Delete-1300"><span class="linenos">1300</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-1301"><a href="#Delete-1301"><span class="linenos">1301</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Delete-1302"><a href="#Delete-1302"><span class="linenos">1302</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Delete-1303"><a href="#Delete-1303"><span class="linenos">1303</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Delete-1304"><a href="#Delete-1304"><span class="linenos">1304</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Delete-1305"><a href="#Delete-1305"><span class="linenos">1305</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Delete-1306"><a href="#Delete-1306"><span class="linenos">1306</span></a> <span class="s2">"returning"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Delete-1307"><a href="#Delete-1307"><span class="linenos">1307</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Delete-1308"><a href="#Delete-1308"><span class="linenos">1308</span></a> <span class="p">}</span> -</span><span id="Delete-1309"><a href="#Delete-1309"><span class="linenos">1309</span></a> -</span><span id="Delete-1310"><a href="#Delete-1310"><span class="linenos">1310</span></a> <span class="k">def</span> <span class="nf">delete</span><span class="p">(</span> -</span><span id="Delete-1311"><a href="#Delete-1311"><span class="linenos">1311</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Delete-1312"><a href="#Delete-1312"><span class="linenos">1312</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Delete-1313"><a href="#Delete-1313"><span class="linenos">1313</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="Delete-1314"><a href="#Delete-1314"><span class="linenos">1314</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="Delete-1315"><a href="#Delete-1315"><span class="linenos">1315</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Delete-1316"><a href="#Delete-1316"><span class="linenos">1316</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="Delete-1317"><a href="#Delete-1317"><span class="linenos">1317</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Delete-1318"><a href="#Delete-1318"><span class="linenos">1318</span></a><span class="sd"> Create a DELETE expression or replace the table on an existing DELETE expression.</span> -</span><span id="Delete-1319"><a href="#Delete-1319"><span class="linenos">1319</span></a> -</span><span id="Delete-1320"><a href="#Delete-1320"><span class="linenos">1320</span></a><span class="sd"> Example:</span> -</span><span id="Delete-1321"><a href="#Delete-1321"><span class="linenos">1321</span></a><span class="sd"> >>> delete("tbl").sql()</span> -</span><span id="Delete-1322"><a href="#Delete-1322"><span class="linenos">1322</span></a><span class="sd"> 'DELETE FROM tbl'</span> -</span><span id="Delete-1323"><a href="#Delete-1323"><span class="linenos">1323</span></a> -</span><span id="Delete-1324"><a href="#Delete-1324"><span class="linenos">1324</span></a><span class="sd"> Args:</span> -</span><span id="Delete-1325"><a href="#Delete-1325"><span class="linenos">1325</span></a><span class="sd"> table: the table from which to delete.</span> -</span><span id="Delete-1326"><a href="#Delete-1326"><span class="linenos">1326</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Delete-1327"><a href="#Delete-1327"><span class="linenos">1327</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Delete-1328"><a href="#Delete-1328"><span class="linenos">1328</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Delete-1329"><a href="#Delete-1329"><span class="linenos">1329</span></a> -</span><span id="Delete-1330"><a href="#Delete-1330"><span class="linenos">1330</span></a><span class="sd"> Returns:</span> -</span><span id="Delete-1331"><a href="#Delete-1331"><span class="linenos">1331</span></a><span class="sd"> Delete: the modified expression.</span> -</span><span id="Delete-1332"><a href="#Delete-1332"><span class="linenos">1332</span></a><span class="sd"> """</span> -</span><span id="Delete-1333"><a href="#Delete-1333"><span class="linenos">1333</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Delete-1334"><a href="#Delete-1334"><span class="linenos">1334</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">table</span><span class="p">,</span> -</span><span id="Delete-1335"><a href="#Delete-1335"><span class="linenos">1335</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Delete-1336"><a href="#Delete-1336"><span class="linenos">1336</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"this"</span><span class="p">,</span> -</span><span id="Delete-1337"><a href="#Delete-1337"><span class="linenos">1337</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Delete-1338"><a href="#Delete-1338"><span class="linenos">1338</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> -</span><span id="Delete-1339"><a href="#Delete-1339"><span class="linenos">1339</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Delete-1340"><a href="#Delete-1340"><span class="linenos">1340</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Delete-1341"><a href="#Delete-1341"><span class="linenos">1341</span></a> <span class="p">)</span> -</span><span id="Delete-1342"><a href="#Delete-1342"><span class="linenos">1342</span></a> -</span><span id="Delete-1343"><a href="#Delete-1343"><span class="linenos">1343</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span> -</span><span id="Delete-1344"><a href="#Delete-1344"><span class="linenos">1344</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Delete-1345"><a href="#Delete-1345"><span class="linenos">1345</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Delete-1346"><a href="#Delete-1346"><span class="linenos">1346</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="Delete-1347"><a href="#Delete-1347"><span class="linenos">1347</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="Delete-1348"><a href="#Delete-1348"><span class="linenos">1348</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="Delete-1349"><a href="#Delete-1349"><span class="linenos">1349</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Delete-1350"><a href="#Delete-1350"><span class="linenos">1350</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="Delete-1351"><a href="#Delete-1351"><span class="linenos">1351</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Delete-1352"><a href="#Delete-1352"><span class="linenos">1352</span></a><span class="sd"> Append to or set the WHERE expressions.</span> -</span><span id="Delete-1353"><a href="#Delete-1353"><span class="linenos">1353</span></a> -</span><span id="Delete-1354"><a href="#Delete-1354"><span class="linenos">1354</span></a><span class="sd"> Example:</span> -</span><span id="Delete-1355"><a href="#Delete-1355"><span class="linenos">1355</span></a><span class="sd"> >>> delete("tbl").where("x = 'a' OR x < 'b'").sql()</span> -</span><span id="Delete-1356"><a href="#Delete-1356"><span class="linenos">1356</span></a><span class="sd"> "DELETE FROM tbl WHERE x = 'a' OR x < 'b'"</span> -</span><span id="Delete-1357"><a href="#Delete-1357"><span class="linenos">1357</span></a> -</span><span id="Delete-1358"><a href="#Delete-1358"><span class="linenos">1358</span></a><span class="sd"> Args:</span> -</span><span id="Delete-1359"><a href="#Delete-1359"><span class="linenos">1359</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Delete-1360"><a href="#Delete-1360"><span class="linenos">1360</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Delete-1361"><a href="#Delete-1361"><span class="linenos">1361</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Delete-1362"><a href="#Delete-1362"><span class="linenos">1362</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Delete-1363"><a href="#Delete-1363"><span class="linenos">1363</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Delete-1364"><a href="#Delete-1364"><span class="linenos">1364</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Delete-1365"><a href="#Delete-1365"><span class="linenos">1365</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Delete-1366"><a href="#Delete-1366"><span class="linenos">1366</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Delete-1367"><a href="#Delete-1367"><span class="linenos">1367</span></a> -</span><span id="Delete-1368"><a href="#Delete-1368"><span class="linenos">1368</span></a><span class="sd"> Returns:</span> -</span><span id="Delete-1369"><a href="#Delete-1369"><span class="linenos">1369</span></a><span class="sd"> Delete: the modified expression.</span> -</span><span id="Delete-1370"><a href="#Delete-1370"><span class="linenos">1370</span></a><span class="sd"> """</span> -</span><span id="Delete-1371"><a href="#Delete-1371"><span class="linenos">1371</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Delete-1372"><a href="#Delete-1372"><span class="linenos">1372</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Delete-1373"><a href="#Delete-1373"><span class="linenos">1373</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Delete-1374"><a href="#Delete-1374"><span class="linenos">1374</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> -</span><span id="Delete-1375"><a href="#Delete-1375"><span class="linenos">1375</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Delete-1376"><a href="#Delete-1376"><span class="linenos">1376</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> -</span><span id="Delete-1377"><a href="#Delete-1377"><span class="linenos">1377</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Delete-1378"><a href="#Delete-1378"><span class="linenos">1378</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Delete-1379"><a href="#Delete-1379"><span class="linenos">1379</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Delete-1380"><a href="#Delete-1380"><span class="linenos">1380</span></a> <span class="p">)</span> -</span><span id="Delete-1381"><a href="#Delete-1381"><span class="linenos">1381</span></a> -</span><span id="Delete-1382"><a href="#Delete-1382"><span class="linenos">1382</span></a> <span class="k">def</span> <span class="nf">returning</span><span class="p">(</span> -</span><span id="Delete-1383"><a href="#Delete-1383"><span class="linenos">1383</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Delete-1384"><a href="#Delete-1384"><span class="linenos">1384</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Delete-1385"><a href="#Delete-1385"><span class="linenos">1385</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="Delete-1386"><a href="#Delete-1386"><span class="linenos">1386</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="Delete-1387"><a href="#Delete-1387"><span class="linenos">1387</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Delete-1388"><a href="#Delete-1388"><span class="linenos">1388</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="Delete-1389"><a href="#Delete-1389"><span class="linenos">1389</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Delete-1390"><a href="#Delete-1390"><span class="linenos">1390</span></a><span class="sd"> Set the RETURNING expression. Not supported by all dialects.</span> -</span><span id="Delete-1391"><a href="#Delete-1391"><span class="linenos">1391</span></a> -</span><span id="Delete-1392"><a href="#Delete-1392"><span class="linenos">1392</span></a><span class="sd"> Example:</span> -</span><span id="Delete-1393"><a href="#Delete-1393"><span class="linenos">1393</span></a><span class="sd"> >>> delete("tbl").returning("*", dialect="postgres").sql()</span> -</span><span id="Delete-1394"><a href="#Delete-1394"><span class="linenos">1394</span></a><span class="sd"> 'DELETE FROM tbl RETURNING *'</span> -</span><span id="Delete-1395"><a href="#Delete-1395"><span class="linenos">1395</span></a> -</span><span id="Delete-1396"><a href="#Delete-1396"><span class="linenos">1396</span></a><span class="sd"> Args:</span> -</span><span id="Delete-1397"><a href="#Delete-1397"><span class="linenos">1397</span></a><span class="sd"> expression: the SQL code strings to parse.</span> -</span><span id="Delete-1398"><a href="#Delete-1398"><span class="linenos">1398</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Delete-1399"><a href="#Delete-1399"><span class="linenos">1399</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Delete-1400"><a href="#Delete-1400"><span class="linenos">1400</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Delete-1401"><a href="#Delete-1401"><span class="linenos">1401</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Delete-1402"><a href="#Delete-1402"><span class="linenos">1402</span></a> -</span><span id="Delete-1403"><a href="#Delete-1403"><span class="linenos">1403</span></a><span class="sd"> Returns:</span> -</span><span id="Delete-1404"><a href="#Delete-1404"><span class="linenos">1404</span></a><span class="sd"> Delete: the modified expression.</span> -</span><span id="Delete-1405"><a href="#Delete-1405"><span class="linenos">1405</span></a><span class="sd"> """</span> -</span><span id="Delete-1406"><a href="#Delete-1406"><span class="linenos">1406</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Delete-1407"><a href="#Delete-1407"><span class="linenos">1407</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="Delete-1408"><a href="#Delete-1408"><span class="linenos">1408</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Delete-1409"><a href="#Delete-1409"><span class="linenos">1409</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"returning"</span><span class="p">,</span> -</span><span id="Delete-1410"><a href="#Delete-1410"><span class="linenos">1410</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"RETURNING"</span><span class="p">,</span> -</span><span id="Delete-1411"><a href="#Delete-1411"><span class="linenos">1411</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Delete-1412"><a href="#Delete-1412"><span class="linenos">1412</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Delete-1413"><a href="#Delete-1413"><span class="linenos">1413</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Returning</span><span class="p">,</span> -</span><span id="Delete-1414"><a href="#Delete-1414"><span class="linenos">1414</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Delete-1415"><a href="#Delete-1415"><span class="linenos">1415</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Delete-1297"><a href="#Delete-1297"><span class="linenos">1297</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-1298"><a href="#Delete-1298"><span class="linenos">1298</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Delete-1299"><a href="#Delete-1299"><span class="linenos">1299</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Delete-1300"><a href="#Delete-1300"><span class="linenos">1300</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Delete-1301"><a href="#Delete-1301"><span class="linenos">1301</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Delete-1302"><a href="#Delete-1302"><span class="linenos">1302</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Delete-1303"><a href="#Delete-1303"><span class="linenos">1303</span></a> <span class="s2">"returning"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Delete-1304"><a href="#Delete-1304"><span class="linenos">1304</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Delete-1305"><a href="#Delete-1305"><span class="linenos">1305</span></a> <span class="s2">"tables"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># Multiple-Table Syntax (MySQL)</span> +</span><span id="Delete-1306"><a href="#Delete-1306"><span class="linenos">1306</span></a> <span class="p">}</span> +</span><span id="Delete-1307"><a href="#Delete-1307"><span class="linenos">1307</span></a> +</span><span id="Delete-1308"><a href="#Delete-1308"><span class="linenos">1308</span></a> <span class="k">def</span> <span class="nf">delete</span><span class="p">(</span> +</span><span id="Delete-1309"><a href="#Delete-1309"><span class="linenos">1309</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Delete-1310"><a href="#Delete-1310"><span class="linenos">1310</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Delete-1311"><a href="#Delete-1311"><span class="linenos">1311</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="Delete-1312"><a href="#Delete-1312"><span class="linenos">1312</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="Delete-1313"><a href="#Delete-1313"><span class="linenos">1313</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Delete-1314"><a href="#Delete-1314"><span class="linenos">1314</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="Delete-1315"><a href="#Delete-1315"><span class="linenos">1315</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Delete-1316"><a href="#Delete-1316"><span class="linenos">1316</span></a><span class="sd"> Create a DELETE expression or replace the table on an existing DELETE expression.</span> +</span><span id="Delete-1317"><a href="#Delete-1317"><span class="linenos">1317</span></a> +</span><span id="Delete-1318"><a href="#Delete-1318"><span class="linenos">1318</span></a><span class="sd"> Example:</span> +</span><span id="Delete-1319"><a href="#Delete-1319"><span class="linenos">1319</span></a><span class="sd"> >>> delete("tbl").sql()</span> +</span><span id="Delete-1320"><a href="#Delete-1320"><span class="linenos">1320</span></a><span class="sd"> 'DELETE FROM tbl'</span> +</span><span id="Delete-1321"><a href="#Delete-1321"><span class="linenos">1321</span></a> +</span><span id="Delete-1322"><a href="#Delete-1322"><span class="linenos">1322</span></a><span class="sd"> Args:</span> +</span><span id="Delete-1323"><a href="#Delete-1323"><span class="linenos">1323</span></a><span class="sd"> table: the table from which to delete.</span> +</span><span id="Delete-1324"><a href="#Delete-1324"><span class="linenos">1324</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Delete-1325"><a href="#Delete-1325"><span class="linenos">1325</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Delete-1326"><a href="#Delete-1326"><span class="linenos">1326</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Delete-1327"><a href="#Delete-1327"><span class="linenos">1327</span></a> +</span><span id="Delete-1328"><a href="#Delete-1328"><span class="linenos">1328</span></a><span class="sd"> Returns:</span> +</span><span id="Delete-1329"><a href="#Delete-1329"><span class="linenos">1329</span></a><span class="sd"> Delete: the modified expression.</span> +</span><span id="Delete-1330"><a href="#Delete-1330"><span class="linenos">1330</span></a><span class="sd"> """</span> +</span><span id="Delete-1331"><a href="#Delete-1331"><span class="linenos">1331</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Delete-1332"><a href="#Delete-1332"><span class="linenos">1332</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">table</span><span class="p">,</span> +</span><span id="Delete-1333"><a href="#Delete-1333"><span class="linenos">1333</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Delete-1334"><a href="#Delete-1334"><span class="linenos">1334</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"this"</span><span class="p">,</span> +</span><span id="Delete-1335"><a href="#Delete-1335"><span class="linenos">1335</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Delete-1336"><a href="#Delete-1336"><span class="linenos">1336</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> +</span><span id="Delete-1337"><a href="#Delete-1337"><span class="linenos">1337</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Delete-1338"><a href="#Delete-1338"><span class="linenos">1338</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Delete-1339"><a href="#Delete-1339"><span class="linenos">1339</span></a> <span class="p">)</span> +</span><span id="Delete-1340"><a href="#Delete-1340"><span class="linenos">1340</span></a> +</span><span id="Delete-1341"><a href="#Delete-1341"><span class="linenos">1341</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span> +</span><span id="Delete-1342"><a href="#Delete-1342"><span class="linenos">1342</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Delete-1343"><a href="#Delete-1343"><span class="linenos">1343</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Delete-1344"><a href="#Delete-1344"><span class="linenos">1344</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="Delete-1345"><a href="#Delete-1345"><span class="linenos">1345</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="Delete-1346"><a href="#Delete-1346"><span class="linenos">1346</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="Delete-1347"><a href="#Delete-1347"><span class="linenos">1347</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Delete-1348"><a href="#Delete-1348"><span class="linenos">1348</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="Delete-1349"><a href="#Delete-1349"><span class="linenos">1349</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Delete-1350"><a href="#Delete-1350"><span class="linenos">1350</span></a><span class="sd"> Append to or set the WHERE expressions.</span> +</span><span id="Delete-1351"><a href="#Delete-1351"><span class="linenos">1351</span></a> +</span><span id="Delete-1352"><a href="#Delete-1352"><span class="linenos">1352</span></a><span class="sd"> Example:</span> +</span><span id="Delete-1353"><a href="#Delete-1353"><span class="linenos">1353</span></a><span class="sd"> >>> delete("tbl").where("x = 'a' OR x < 'b'").sql()</span> +</span><span id="Delete-1354"><a href="#Delete-1354"><span class="linenos">1354</span></a><span class="sd"> "DELETE FROM tbl WHERE x = 'a' OR x < 'b'"</span> +</span><span id="Delete-1355"><a href="#Delete-1355"><span class="linenos">1355</span></a> +</span><span id="Delete-1356"><a href="#Delete-1356"><span class="linenos">1356</span></a><span class="sd"> Args:</span> +</span><span id="Delete-1357"><a href="#Delete-1357"><span class="linenos">1357</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Delete-1358"><a href="#Delete-1358"><span class="linenos">1358</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Delete-1359"><a href="#Delete-1359"><span class="linenos">1359</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Delete-1360"><a href="#Delete-1360"><span class="linenos">1360</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Delete-1361"><a href="#Delete-1361"><span class="linenos">1361</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Delete-1362"><a href="#Delete-1362"><span class="linenos">1362</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Delete-1363"><a href="#Delete-1363"><span class="linenos">1363</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Delete-1364"><a href="#Delete-1364"><span class="linenos">1364</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Delete-1365"><a href="#Delete-1365"><span class="linenos">1365</span></a> +</span><span id="Delete-1366"><a href="#Delete-1366"><span class="linenos">1366</span></a><span class="sd"> Returns:</span> +</span><span id="Delete-1367"><a href="#Delete-1367"><span class="linenos">1367</span></a><span class="sd"> Delete: the modified expression.</span> +</span><span id="Delete-1368"><a href="#Delete-1368"><span class="linenos">1368</span></a><span class="sd"> """</span> +</span><span id="Delete-1369"><a href="#Delete-1369"><span class="linenos">1369</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Delete-1370"><a href="#Delete-1370"><span class="linenos">1370</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Delete-1371"><a href="#Delete-1371"><span class="linenos">1371</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Delete-1372"><a href="#Delete-1372"><span class="linenos">1372</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> +</span><span id="Delete-1373"><a href="#Delete-1373"><span class="linenos">1373</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Delete-1374"><a href="#Delete-1374"><span class="linenos">1374</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> +</span><span id="Delete-1375"><a href="#Delete-1375"><span class="linenos">1375</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Delete-1376"><a href="#Delete-1376"><span class="linenos">1376</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Delete-1377"><a href="#Delete-1377"><span class="linenos">1377</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Delete-1378"><a href="#Delete-1378"><span class="linenos">1378</span></a> <span class="p">)</span> +</span><span id="Delete-1379"><a href="#Delete-1379"><span class="linenos">1379</span></a> +</span><span id="Delete-1380"><a href="#Delete-1380"><span class="linenos">1380</span></a> <span class="k">def</span> <span class="nf">returning</span><span class="p">(</span> +</span><span id="Delete-1381"><a href="#Delete-1381"><span class="linenos">1381</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Delete-1382"><a href="#Delete-1382"><span class="linenos">1382</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Delete-1383"><a href="#Delete-1383"><span class="linenos">1383</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="Delete-1384"><a href="#Delete-1384"><span class="linenos">1384</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="Delete-1385"><a href="#Delete-1385"><span class="linenos">1385</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Delete-1386"><a href="#Delete-1386"><span class="linenos">1386</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="Delete-1387"><a href="#Delete-1387"><span class="linenos">1387</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Delete-1388"><a href="#Delete-1388"><span class="linenos">1388</span></a><span class="sd"> Set the RETURNING expression. Not supported by all dialects.</span> +</span><span id="Delete-1389"><a href="#Delete-1389"><span class="linenos">1389</span></a> +</span><span id="Delete-1390"><a href="#Delete-1390"><span class="linenos">1390</span></a><span class="sd"> Example:</span> +</span><span id="Delete-1391"><a href="#Delete-1391"><span class="linenos">1391</span></a><span class="sd"> >>> delete("tbl").returning("*", dialect="postgres").sql()</span> +</span><span id="Delete-1392"><a href="#Delete-1392"><span class="linenos">1392</span></a><span class="sd"> 'DELETE FROM tbl RETURNING *'</span> +</span><span id="Delete-1393"><a href="#Delete-1393"><span class="linenos">1393</span></a> +</span><span id="Delete-1394"><a href="#Delete-1394"><span class="linenos">1394</span></a><span class="sd"> Args:</span> +</span><span id="Delete-1395"><a href="#Delete-1395"><span class="linenos">1395</span></a><span class="sd"> expression: the SQL code strings to parse.</span> +</span><span id="Delete-1396"><a href="#Delete-1396"><span class="linenos">1396</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Delete-1397"><a href="#Delete-1397"><span class="linenos">1397</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Delete-1398"><a href="#Delete-1398"><span class="linenos">1398</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Delete-1399"><a href="#Delete-1399"><span class="linenos">1399</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Delete-1400"><a href="#Delete-1400"><span class="linenos">1400</span></a> +</span><span id="Delete-1401"><a href="#Delete-1401"><span class="linenos">1401</span></a><span class="sd"> Returns:</span> +</span><span id="Delete-1402"><a href="#Delete-1402"><span class="linenos">1402</span></a><span class="sd"> Delete: the modified expression.</span> +</span><span id="Delete-1403"><a href="#Delete-1403"><span class="linenos">1403</span></a><span class="sd"> """</span> +</span><span id="Delete-1404"><a href="#Delete-1404"><span class="linenos">1404</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Delete-1405"><a href="#Delete-1405"><span class="linenos">1405</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="Delete-1406"><a href="#Delete-1406"><span class="linenos">1406</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Delete-1407"><a href="#Delete-1407"><span class="linenos">1407</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"returning"</span><span class="p">,</span> +</span><span id="Delete-1408"><a href="#Delete-1408"><span class="linenos">1408</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"RETURNING"</span><span class="p">,</span> +</span><span id="Delete-1409"><a href="#Delete-1409"><span class="linenos">1409</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Delete-1410"><a href="#Delete-1410"><span class="linenos">1410</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Delete-1411"><a href="#Delete-1411"><span class="linenos">1411</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Returning</span><span class="p">,</span> +</span><span id="Delete-1412"><a href="#Delete-1412"><span class="linenos">1412</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Delete-1413"><a href="#Delete-1413"><span class="linenos">1413</span></a> <span class="p">)</span> </span></pre></div> @@ -20046,7 +20056,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w <div id="Delete.arg_types" class="classattr"> <div class="attr variable"> <span class="name">arg_types</span> = -<span class="default_value">{'with': False, 'this': False, 'using': False, 'where': False, 'returning': False, 'limit': False}</span> +<input id="Delete.arg_types-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <label class="view-value-button pdoc-button" for="Delete.arg_types-view-value"></label><span class="default_value">{'with': False, 'this': False, 'using': False, 'where': False, 'returning': False, 'limit': False, 'tables': False}</span> </div> @@ -20066,38 +20077,38 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Delete.delete"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Delete.delete-1310"><a href="#Delete.delete-1310"><span class="linenos">1310</span></a> <span class="k">def</span> <span class="nf">delete</span><span class="p">(</span> -</span><span id="Delete.delete-1311"><a href="#Delete.delete-1311"><span class="linenos">1311</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Delete.delete-1312"><a href="#Delete.delete-1312"><span class="linenos">1312</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Delete.delete-1313"><a href="#Delete.delete-1313"><span class="linenos">1313</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="Delete.delete-1314"><a href="#Delete.delete-1314"><span class="linenos">1314</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="Delete.delete-1315"><a href="#Delete.delete-1315"><span class="linenos">1315</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Delete.delete-1316"><a href="#Delete.delete-1316"><span class="linenos">1316</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="Delete.delete-1317"><a href="#Delete.delete-1317"><span class="linenos">1317</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Delete.delete-1318"><a href="#Delete.delete-1318"><span class="linenos">1318</span></a><span class="sd"> Create a DELETE expression or replace the table on an existing DELETE expression.</span> -</span><span id="Delete.delete-1319"><a href="#Delete.delete-1319"><span class="linenos">1319</span></a> -</span><span id="Delete.delete-1320"><a href="#Delete.delete-1320"><span class="linenos">1320</span></a><span class="sd"> Example:</span> -</span><span id="Delete.delete-1321"><a href="#Delete.delete-1321"><span class="linenos">1321</span></a><span class="sd"> >>> delete("tbl").sql()</span> -</span><span id="Delete.delete-1322"><a href="#Delete.delete-1322"><span class="linenos">1322</span></a><span class="sd"> 'DELETE FROM tbl'</span> -</span><span id="Delete.delete-1323"><a href="#Delete.delete-1323"><span class="linenos">1323</span></a> -</span><span id="Delete.delete-1324"><a href="#Delete.delete-1324"><span class="linenos">1324</span></a><span class="sd"> Args:</span> -</span><span id="Delete.delete-1325"><a href="#Delete.delete-1325"><span class="linenos">1325</span></a><span class="sd"> table: the table from which to delete.</span> -</span><span id="Delete.delete-1326"><a href="#Delete.delete-1326"><span class="linenos">1326</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Delete.delete-1327"><a href="#Delete.delete-1327"><span class="linenos">1327</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Delete.delete-1328"><a href="#Delete.delete-1328"><span class="linenos">1328</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Delete.delete-1329"><a href="#Delete.delete-1329"><span class="linenos">1329</span></a> -</span><span id="Delete.delete-1330"><a href="#Delete.delete-1330"><span class="linenos">1330</span></a><span class="sd"> Returns:</span> -</span><span id="Delete.delete-1331"><a href="#Delete.delete-1331"><span class="linenos">1331</span></a><span class="sd"> Delete: the modified expression.</span> -</span><span id="Delete.delete-1332"><a href="#Delete.delete-1332"><span class="linenos">1332</span></a><span class="sd"> """</span> -</span><span id="Delete.delete-1333"><a href="#Delete.delete-1333"><span class="linenos">1333</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Delete.delete-1334"><a href="#Delete.delete-1334"><span class="linenos">1334</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">table</span><span class="p">,</span> -</span><span id="Delete.delete-1335"><a href="#Delete.delete-1335"><span class="linenos">1335</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Delete.delete-1336"><a href="#Delete.delete-1336"><span class="linenos">1336</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"this"</span><span class="p">,</span> -</span><span id="Delete.delete-1337"><a href="#Delete.delete-1337"><span class="linenos">1337</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Delete.delete-1338"><a href="#Delete.delete-1338"><span class="linenos">1338</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> -</span><span id="Delete.delete-1339"><a href="#Delete.delete-1339"><span class="linenos">1339</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Delete.delete-1340"><a href="#Delete.delete-1340"><span class="linenos">1340</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Delete.delete-1341"><a href="#Delete.delete-1341"><span class="linenos">1341</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Delete.delete-1308"><a href="#Delete.delete-1308"><span class="linenos">1308</span></a> <span class="k">def</span> <span class="nf">delete</span><span class="p">(</span> +</span><span id="Delete.delete-1309"><a href="#Delete.delete-1309"><span class="linenos">1309</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Delete.delete-1310"><a href="#Delete.delete-1310"><span class="linenos">1310</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Delete.delete-1311"><a href="#Delete.delete-1311"><span class="linenos">1311</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="Delete.delete-1312"><a href="#Delete.delete-1312"><span class="linenos">1312</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="Delete.delete-1313"><a href="#Delete.delete-1313"><span class="linenos">1313</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Delete.delete-1314"><a href="#Delete.delete-1314"><span class="linenos">1314</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="Delete.delete-1315"><a href="#Delete.delete-1315"><span class="linenos">1315</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Delete.delete-1316"><a href="#Delete.delete-1316"><span class="linenos">1316</span></a><span class="sd"> Create a DELETE expression or replace the table on an existing DELETE expression.</span> +</span><span id="Delete.delete-1317"><a href="#Delete.delete-1317"><span class="linenos">1317</span></a> +</span><span id="Delete.delete-1318"><a href="#Delete.delete-1318"><span class="linenos">1318</span></a><span class="sd"> Example:</span> +</span><span id="Delete.delete-1319"><a href="#Delete.delete-1319"><span class="linenos">1319</span></a><span class="sd"> >>> delete("tbl").sql()</span> +</span><span id="Delete.delete-1320"><a href="#Delete.delete-1320"><span class="linenos">1320</span></a><span class="sd"> 'DELETE FROM tbl'</span> +</span><span id="Delete.delete-1321"><a href="#Delete.delete-1321"><span class="linenos">1321</span></a> +</span><span id="Delete.delete-1322"><a href="#Delete.delete-1322"><span class="linenos">1322</span></a><span class="sd"> Args:</span> +</span><span id="Delete.delete-1323"><a href="#Delete.delete-1323"><span class="linenos">1323</span></a><span class="sd"> table: the table from which to delete.</span> +</span><span id="Delete.delete-1324"><a href="#Delete.delete-1324"><span class="linenos">1324</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Delete.delete-1325"><a href="#Delete.delete-1325"><span class="linenos">1325</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Delete.delete-1326"><a href="#Delete.delete-1326"><span class="linenos">1326</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Delete.delete-1327"><a href="#Delete.delete-1327"><span class="linenos">1327</span></a> +</span><span id="Delete.delete-1328"><a href="#Delete.delete-1328"><span class="linenos">1328</span></a><span class="sd"> Returns:</span> +</span><span id="Delete.delete-1329"><a href="#Delete.delete-1329"><span class="linenos">1329</span></a><span class="sd"> Delete: the modified expression.</span> +</span><span id="Delete.delete-1330"><a href="#Delete.delete-1330"><span class="linenos">1330</span></a><span class="sd"> """</span> +</span><span id="Delete.delete-1331"><a href="#Delete.delete-1331"><span class="linenos">1331</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Delete.delete-1332"><a href="#Delete.delete-1332"><span class="linenos">1332</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">table</span><span class="p">,</span> +</span><span id="Delete.delete-1333"><a href="#Delete.delete-1333"><span class="linenos">1333</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Delete.delete-1334"><a href="#Delete.delete-1334"><span class="linenos">1334</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"this"</span><span class="p">,</span> +</span><span id="Delete.delete-1335"><a href="#Delete.delete-1335"><span class="linenos">1335</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Delete.delete-1336"><a href="#Delete.delete-1336"><span class="linenos">1336</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> +</span><span id="Delete.delete-1337"><a href="#Delete.delete-1337"><span class="linenos">1337</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Delete.delete-1338"><a href="#Delete.delete-1338"><span class="linenos">1338</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Delete.delete-1339"><a href="#Delete.delete-1339"><span class="linenos">1339</span></a> <span class="p">)</span> </span></pre></div> @@ -20142,44 +20153,44 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Delete.where"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Delete.where-1343"><a href="#Delete.where-1343"><span class="linenos">1343</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span> -</span><span id="Delete.where-1344"><a href="#Delete.where-1344"><span class="linenos">1344</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Delete.where-1345"><a href="#Delete.where-1345"><span class="linenos">1345</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Delete.where-1346"><a href="#Delete.where-1346"><span class="linenos">1346</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="Delete.where-1347"><a href="#Delete.where-1347"><span class="linenos">1347</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="Delete.where-1348"><a href="#Delete.where-1348"><span class="linenos">1348</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="Delete.where-1349"><a href="#Delete.where-1349"><span class="linenos">1349</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Delete.where-1350"><a href="#Delete.where-1350"><span class="linenos">1350</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="Delete.where-1351"><a href="#Delete.where-1351"><span class="linenos">1351</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Delete.where-1352"><a href="#Delete.where-1352"><span class="linenos">1352</span></a><span class="sd"> Append to or set the WHERE expressions.</span> -</span><span id="Delete.where-1353"><a href="#Delete.where-1353"><span class="linenos">1353</span></a> -</span><span id="Delete.where-1354"><a href="#Delete.where-1354"><span class="linenos">1354</span></a><span class="sd"> Example:</span> -</span><span id="Delete.where-1355"><a href="#Delete.where-1355"><span class="linenos">1355</span></a><span class="sd"> >>> delete("tbl").where("x = 'a' OR x < 'b'").sql()</span> -</span><span id="Delete.where-1356"><a href="#Delete.where-1356"><span class="linenos">1356</span></a><span class="sd"> "DELETE FROM tbl WHERE x = 'a' OR x < 'b'"</span> -</span><span id="Delete.where-1357"><a href="#Delete.where-1357"><span class="linenos">1357</span></a> -</span><span id="Delete.where-1358"><a href="#Delete.where-1358"><span class="linenos">1358</span></a><span class="sd"> Args:</span> -</span><span id="Delete.where-1359"><a href="#Delete.where-1359"><span class="linenos">1359</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Delete.where-1360"><a href="#Delete.where-1360"><span class="linenos">1360</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Delete.where-1361"><a href="#Delete.where-1361"><span class="linenos">1361</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Delete.where-1362"><a href="#Delete.where-1362"><span class="linenos">1362</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Delete.where-1363"><a href="#Delete.where-1363"><span class="linenos">1363</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Delete.where-1364"><a href="#Delete.where-1364"><span class="linenos">1364</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Delete.where-1365"><a href="#Delete.where-1365"><span class="linenos">1365</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Delete.where-1366"><a href="#Delete.where-1366"><span class="linenos">1366</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Delete.where-1367"><a href="#Delete.where-1367"><span class="linenos">1367</span></a> -</span><span id="Delete.where-1368"><a href="#Delete.where-1368"><span class="linenos">1368</span></a><span class="sd"> Returns:</span> -</span><span id="Delete.where-1369"><a href="#Delete.where-1369"><span class="linenos">1369</span></a><span class="sd"> Delete: the modified expression.</span> -</span><span id="Delete.where-1370"><a href="#Delete.where-1370"><span class="linenos">1370</span></a><span class="sd"> """</span> -</span><span id="Delete.where-1371"><a href="#Delete.where-1371"><span class="linenos">1371</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Delete.where-1372"><a href="#Delete.where-1372"><span class="linenos">1372</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Delete.where-1373"><a href="#Delete.where-1373"><span class="linenos">1373</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Delete.where-1374"><a href="#Delete.where-1374"><span class="linenos">1374</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> -</span><span id="Delete.where-1375"><a href="#Delete.where-1375"><span class="linenos">1375</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Delete.where-1376"><a href="#Delete.where-1376"><span class="linenos">1376</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> -</span><span id="Delete.where-1377"><a href="#Delete.where-1377"><span class="linenos">1377</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Delete.where-1378"><a href="#Delete.where-1378"><span class="linenos">1378</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Delete.where-1379"><a href="#Delete.where-1379"><span class="linenos">1379</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Delete.where-1380"><a href="#Delete.where-1380"><span class="linenos">1380</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Delete.where-1341"><a href="#Delete.where-1341"><span class="linenos">1341</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span> +</span><span id="Delete.where-1342"><a href="#Delete.where-1342"><span class="linenos">1342</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Delete.where-1343"><a href="#Delete.where-1343"><span class="linenos">1343</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Delete.where-1344"><a href="#Delete.where-1344"><span class="linenos">1344</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="Delete.where-1345"><a href="#Delete.where-1345"><span class="linenos">1345</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="Delete.where-1346"><a href="#Delete.where-1346"><span class="linenos">1346</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="Delete.where-1347"><a href="#Delete.where-1347"><span class="linenos">1347</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Delete.where-1348"><a href="#Delete.where-1348"><span class="linenos">1348</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="Delete.where-1349"><a href="#Delete.where-1349"><span class="linenos">1349</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Delete.where-1350"><a href="#Delete.where-1350"><span class="linenos">1350</span></a><span class="sd"> Append to or set the WHERE expressions.</span> +</span><span id="Delete.where-1351"><a href="#Delete.where-1351"><span class="linenos">1351</span></a> +</span><span id="Delete.where-1352"><a href="#Delete.where-1352"><span class="linenos">1352</span></a><span class="sd"> Example:</span> +</span><span id="Delete.where-1353"><a href="#Delete.where-1353"><span class="linenos">1353</span></a><span class="sd"> >>> delete("tbl").where("x = 'a' OR x < 'b'").sql()</span> +</span><span id="Delete.where-1354"><a href="#Delete.where-1354"><span class="linenos">1354</span></a><span class="sd"> "DELETE FROM tbl WHERE x = 'a' OR x < 'b'"</span> +</span><span id="Delete.where-1355"><a href="#Delete.where-1355"><span class="linenos">1355</span></a> +</span><span id="Delete.where-1356"><a href="#Delete.where-1356"><span class="linenos">1356</span></a><span class="sd"> Args:</span> +</span><span id="Delete.where-1357"><a href="#Delete.where-1357"><span class="linenos">1357</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Delete.where-1358"><a href="#Delete.where-1358"><span class="linenos">1358</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Delete.where-1359"><a href="#Delete.where-1359"><span class="linenos">1359</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Delete.where-1360"><a href="#Delete.where-1360"><span class="linenos">1360</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Delete.where-1361"><a href="#Delete.where-1361"><span class="linenos">1361</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Delete.where-1362"><a href="#Delete.where-1362"><span class="linenos">1362</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Delete.where-1363"><a href="#Delete.where-1363"><span class="linenos">1363</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Delete.where-1364"><a href="#Delete.where-1364"><span class="linenos">1364</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Delete.where-1365"><a href="#Delete.where-1365"><span class="linenos">1365</span></a> +</span><span id="Delete.where-1366"><a href="#Delete.where-1366"><span class="linenos">1366</span></a><span class="sd"> Returns:</span> +</span><span id="Delete.where-1367"><a href="#Delete.where-1367"><span class="linenos">1367</span></a><span class="sd"> Delete: the modified expression.</span> +</span><span id="Delete.where-1368"><a href="#Delete.where-1368"><span class="linenos">1368</span></a><span class="sd"> """</span> +</span><span id="Delete.where-1369"><a href="#Delete.where-1369"><span class="linenos">1369</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Delete.where-1370"><a href="#Delete.where-1370"><span class="linenos">1370</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Delete.where-1371"><a href="#Delete.where-1371"><span class="linenos">1371</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Delete.where-1372"><a href="#Delete.where-1372"><span class="linenos">1372</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> +</span><span id="Delete.where-1373"><a href="#Delete.where-1373"><span class="linenos">1373</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Delete.where-1374"><a href="#Delete.where-1374"><span class="linenos">1374</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> +</span><span id="Delete.where-1375"><a href="#Delete.where-1375"><span class="linenos">1375</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Delete.where-1376"><a href="#Delete.where-1376"><span class="linenos">1376</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Delete.where-1377"><a href="#Delete.where-1377"><span class="linenos">1377</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Delete.where-1378"><a href="#Delete.where-1378"><span class="linenos">1378</span></a> <span class="p">)</span> </span></pre></div> @@ -20228,40 +20239,40 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Delete.returning"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Delete.returning-1382"><a href="#Delete.returning-1382"><span class="linenos">1382</span></a> <span class="k">def</span> <span class="nf">returning</span><span class="p">(</span> -</span><span id="Delete.returning-1383"><a href="#Delete.returning-1383"><span class="linenos">1383</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Delete.returning-1384"><a href="#Delete.returning-1384"><span class="linenos">1384</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Delete.returning-1385"><a href="#Delete.returning-1385"><span class="linenos">1385</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="Delete.returning-1386"><a href="#Delete.returning-1386"><span class="linenos">1386</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="Delete.returning-1387"><a href="#Delete.returning-1387"><span class="linenos">1387</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Delete.returning-1388"><a href="#Delete.returning-1388"><span class="linenos">1388</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="Delete.returning-1389"><a href="#Delete.returning-1389"><span class="linenos">1389</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Delete.returning-1390"><a href="#Delete.returning-1390"><span class="linenos">1390</span></a><span class="sd"> Set the RETURNING expression. Not supported by all dialects.</span> -</span><span id="Delete.returning-1391"><a href="#Delete.returning-1391"><span class="linenos">1391</span></a> -</span><span id="Delete.returning-1392"><a href="#Delete.returning-1392"><span class="linenos">1392</span></a><span class="sd"> Example:</span> -</span><span id="Delete.returning-1393"><a href="#Delete.returning-1393"><span class="linenos">1393</span></a><span class="sd"> >>> delete("tbl").returning("*", dialect="postgres").sql()</span> -</span><span id="Delete.returning-1394"><a href="#Delete.returning-1394"><span class="linenos">1394</span></a><span class="sd"> 'DELETE FROM tbl RETURNING *'</span> -</span><span id="Delete.returning-1395"><a href="#Delete.returning-1395"><span class="linenos">1395</span></a> -</span><span id="Delete.returning-1396"><a href="#Delete.returning-1396"><span class="linenos">1396</span></a><span class="sd"> Args:</span> -</span><span id="Delete.returning-1397"><a href="#Delete.returning-1397"><span class="linenos">1397</span></a><span class="sd"> expression: the SQL code strings to parse.</span> -</span><span id="Delete.returning-1398"><a href="#Delete.returning-1398"><span class="linenos">1398</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Delete.returning-1399"><a href="#Delete.returning-1399"><span class="linenos">1399</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Delete.returning-1400"><a href="#Delete.returning-1400"><span class="linenos">1400</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Delete.returning-1401"><a href="#Delete.returning-1401"><span class="linenos">1401</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Delete.returning-1402"><a href="#Delete.returning-1402"><span class="linenos">1402</span></a> -</span><span id="Delete.returning-1403"><a href="#Delete.returning-1403"><span class="linenos">1403</span></a><span class="sd"> Returns:</span> -</span><span id="Delete.returning-1404"><a href="#Delete.returning-1404"><span class="linenos">1404</span></a><span class="sd"> Delete: the modified expression.</span> -</span><span id="Delete.returning-1405"><a href="#Delete.returning-1405"><span class="linenos">1405</span></a><span class="sd"> """</span> -</span><span id="Delete.returning-1406"><a href="#Delete.returning-1406"><span class="linenos">1406</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Delete.returning-1407"><a href="#Delete.returning-1407"><span class="linenos">1407</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="Delete.returning-1408"><a href="#Delete.returning-1408"><span class="linenos">1408</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Delete.returning-1409"><a href="#Delete.returning-1409"><span class="linenos">1409</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"returning"</span><span class="p">,</span> -</span><span id="Delete.returning-1410"><a href="#Delete.returning-1410"><span class="linenos">1410</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"RETURNING"</span><span class="p">,</span> -</span><span id="Delete.returning-1411"><a href="#Delete.returning-1411"><span class="linenos">1411</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Delete.returning-1412"><a href="#Delete.returning-1412"><span class="linenos">1412</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Delete.returning-1413"><a href="#Delete.returning-1413"><span class="linenos">1413</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Returning</span><span class="p">,</span> -</span><span id="Delete.returning-1414"><a href="#Delete.returning-1414"><span class="linenos">1414</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Delete.returning-1415"><a href="#Delete.returning-1415"><span class="linenos">1415</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Delete.returning-1380"><a href="#Delete.returning-1380"><span class="linenos">1380</span></a> <span class="k">def</span> <span class="nf">returning</span><span class="p">(</span> +</span><span id="Delete.returning-1381"><a href="#Delete.returning-1381"><span class="linenos">1381</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Delete.returning-1382"><a href="#Delete.returning-1382"><span class="linenos">1382</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Delete.returning-1383"><a href="#Delete.returning-1383"><span class="linenos">1383</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="Delete.returning-1384"><a href="#Delete.returning-1384"><span class="linenos">1384</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="Delete.returning-1385"><a href="#Delete.returning-1385"><span class="linenos">1385</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Delete.returning-1386"><a href="#Delete.returning-1386"><span class="linenos">1386</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="Delete.returning-1387"><a href="#Delete.returning-1387"><span class="linenos">1387</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Delete.returning-1388"><a href="#Delete.returning-1388"><span class="linenos">1388</span></a><span class="sd"> Set the RETURNING expression. Not supported by all dialects.</span> +</span><span id="Delete.returning-1389"><a href="#Delete.returning-1389"><span class="linenos">1389</span></a> +</span><span id="Delete.returning-1390"><a href="#Delete.returning-1390"><span class="linenos">1390</span></a><span class="sd"> Example:</span> +</span><span id="Delete.returning-1391"><a href="#Delete.returning-1391"><span class="linenos">1391</span></a><span class="sd"> >>> delete("tbl").returning("*", dialect="postgres").sql()</span> +</span><span id="Delete.returning-1392"><a href="#Delete.returning-1392"><span class="linenos">1392</span></a><span class="sd"> 'DELETE FROM tbl RETURNING *'</span> +</span><span id="Delete.returning-1393"><a href="#Delete.returning-1393"><span class="linenos">1393</span></a> +</span><span id="Delete.returning-1394"><a href="#Delete.returning-1394"><span class="linenos">1394</span></a><span class="sd"> Args:</span> +</span><span id="Delete.returning-1395"><a href="#Delete.returning-1395"><span class="linenos">1395</span></a><span class="sd"> expression: the SQL code strings to parse.</span> +</span><span id="Delete.returning-1396"><a href="#Delete.returning-1396"><span class="linenos">1396</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Delete.returning-1397"><a href="#Delete.returning-1397"><span class="linenos">1397</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Delete.returning-1398"><a href="#Delete.returning-1398"><span class="linenos">1398</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Delete.returning-1399"><a href="#Delete.returning-1399"><span class="linenos">1399</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Delete.returning-1400"><a href="#Delete.returning-1400"><span class="linenos">1400</span></a> +</span><span id="Delete.returning-1401"><a href="#Delete.returning-1401"><span class="linenos">1401</span></a><span class="sd"> Returns:</span> +</span><span id="Delete.returning-1402"><a href="#Delete.returning-1402"><span class="linenos">1402</span></a><span class="sd"> Delete: the modified expression.</span> +</span><span id="Delete.returning-1403"><a href="#Delete.returning-1403"><span class="linenos">1403</span></a><span class="sd"> """</span> +</span><span id="Delete.returning-1404"><a href="#Delete.returning-1404"><span class="linenos">1404</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Delete.returning-1405"><a href="#Delete.returning-1405"><span class="linenos">1405</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="Delete.returning-1406"><a href="#Delete.returning-1406"><span class="linenos">1406</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Delete.returning-1407"><a href="#Delete.returning-1407"><span class="linenos">1407</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"returning"</span><span class="p">,</span> +</span><span id="Delete.returning-1408"><a href="#Delete.returning-1408"><span class="linenos">1408</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"RETURNING"</span><span class="p">,</span> +</span><span id="Delete.returning-1409"><a href="#Delete.returning-1409"><span class="linenos">1409</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Delete.returning-1410"><a href="#Delete.returning-1410"><span class="linenos">1410</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Delete.returning-1411"><a href="#Delete.returning-1411"><span class="linenos">1411</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Returning</span><span class="p">,</span> +</span><span id="Delete.returning-1412"><a href="#Delete.returning-1412"><span class="linenos">1412</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Delete.returning-1413"><a href="#Delete.returning-1413"><span class="linenos">1413</span></a> <span class="p">)</span> </span></pre></div> @@ -20375,17 +20386,17 @@ 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-1418"><a href="#Drop-1418"><span class="linenos">1418</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-1419"><a href="#Drop-1419"><span class="linenos">1419</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Drop-1420"><a href="#Drop-1420"><span class="linenos">1420</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1421"><a href="#Drop-1421"><span class="linenos">1421</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1422"><a href="#Drop-1422"><span class="linenos">1422</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1423"><a href="#Drop-1423"><span class="linenos">1423</span></a> <span class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1424"><a href="#Drop-1424"><span class="linenos">1424</span></a> <span class="s2">"materialized"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1425"><a href="#Drop-1425"><span class="linenos">1425</span></a> <span class="s2">"cascade"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1426"><a href="#Drop-1426"><span class="linenos">1426</span></a> <span class="s2">"constraints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1427"><a href="#Drop-1427"><span class="linenos">1427</span></a> <span class="s2">"purge"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1428"><a href="#Drop-1428"><span class="linenos">1428</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Drop-1416"><a href="#Drop-1416"><span class="linenos">1416</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-1417"><a href="#Drop-1417"><span class="linenos">1417</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Drop-1418"><a href="#Drop-1418"><span class="linenos">1418</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1419"><a href="#Drop-1419"><span class="linenos">1419</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1420"><a href="#Drop-1420"><span class="linenos">1420</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1421"><a href="#Drop-1421"><span class="linenos">1421</span></a> <span class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1422"><a href="#Drop-1422"><span class="linenos">1422</span></a> <span class="s2">"materialized"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1423"><a href="#Drop-1423"><span class="linenos">1423</span></a> <span class="s2">"cascade"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1424"><a href="#Drop-1424"><span class="linenos">1424</span></a> <span class="s2">"constraints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1425"><a href="#Drop-1425"><span class="linenos">1425</span></a> <span class="s2">"purge"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1426"><a href="#Drop-1426"><span class="linenos">1426</span></a> <span class="p">}</span> </span></pre></div> @@ -20483,8 +20494,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-1431"><a href="#Filter-1431"><span class="linenos">1431</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-1432"><a href="#Filter-1432"><span class="linenos">1432</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1429"><a href="#Filter-1429"><span class="linenos">1429</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-1430"><a href="#Filter-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">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -20581,8 +20592,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-1435"><a href="#Check-1435"><span class="linenos">1435</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-1436"><a href="#Check-1436"><span class="linenos">1436</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Check-1433"><a href="#Check-1433"><span class="linenos">1433</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-1434"><a href="#Check-1434"><span class="linenos">1434</span></a> <span class="k">pass</span> </span></pre></div> @@ -20668,9 +20679,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-1439"><a href="#Directory-1439"><span class="linenos">1439</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-1440"><a href="#Directory-1440"><span class="linenos">1440</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-1441"><a href="#Directory-1441"><span class="linenos">1441</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1437"><a href="#Directory-1437"><span class="linenos">1437</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-1438"><a href="#Directory-1438"><span class="linenos">1438</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-1439"><a href="#Directory-1439"><span class="linenos">1439</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -20767,13 +20778,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-1444"><a href="#ForeignKey-1444"><span class="linenos">1444</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-1445"><a href="#ForeignKey-1445"><span class="linenos">1445</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="ForeignKey-1446"><a href="#ForeignKey-1446"><span class="linenos">1446</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="ForeignKey-1447"><a href="#ForeignKey-1447"><span class="linenos">1447</span></a> <span class="s2">"reference"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ForeignKey-1448"><a href="#ForeignKey-1448"><span class="linenos">1448</span></a> <span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ForeignKey-1449"><a href="#ForeignKey-1449"><span class="linenos">1449</span></a> <span class="s2">"update"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ForeignKey-1450"><a href="#ForeignKey-1450"><span class="linenos">1450</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ForeignKey-1442"><a href="#ForeignKey-1442"><span class="linenos">1442</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-1443"><a href="#ForeignKey-1443"><span class="linenos">1443</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="ForeignKey-1444"><a href="#ForeignKey-1444"><span class="linenos">1444</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="ForeignKey-1445"><a href="#ForeignKey-1445"><span class="linenos">1445</span></a> <span class="s2">"reference"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ForeignKey-1446"><a href="#ForeignKey-1446"><span class="linenos">1446</span></a> <span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ForeignKey-1447"><a href="#ForeignKey-1447"><span class="linenos">1447</span></a> <span class="s2">"update"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ForeignKey-1448"><a href="#ForeignKey-1448"><span class="linenos">1448</span></a> <span class="p">}</span> </span></pre></div> @@ -20870,8 +20881,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-1453"><a href="#PrimaryKey-1453"><span class="linenos">1453</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-1454"><a href="#PrimaryKey-1454"><span class="linenos">1454</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-1451"><a href="#PrimaryKey-1451"><span class="linenos">1451</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-1452"><a href="#PrimaryKey-1452"><span class="linenos">1452</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> @@ -20968,8 +20979,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-1459"><a href="#Into-1459"><span class="linenos">1459</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-1460"><a href="#Into-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">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-1457"><a href="#Into-1457"><span class="linenos">1457</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-1458"><a href="#Into-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">"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> @@ -21066,14 +21077,14 @@ 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-1463"><a href="#From-1463"><span class="linenos">1463</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-1464"><a href="#From-1464"><span class="linenos">1464</span></a> <span class="nd">@property</span> -</span><span id="From-1465"><a href="#From-1465"><span class="linenos">1465</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="From-1466"><a href="#From-1466"><span class="linenos">1466</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="From-1467"><a href="#From-1467"><span class="linenos">1467</span></a> -</span><span id="From-1468"><a href="#From-1468"><span class="linenos">1468</span></a> <span class="nd">@property</span> -</span><span id="From-1469"><a href="#From-1469"><span class="linenos">1469</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="From-1470"><a href="#From-1470"><span class="linenos">1470</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="From-1461"><a href="#From-1461"><span class="linenos">1461</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-1462"><a href="#From-1462"><span class="linenos">1462</span></a> <span class="nd">@property</span> +</span><span id="From-1463"><a href="#From-1463"><span class="linenos">1463</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="From-1464"><a href="#From-1464"><span class="linenos">1464</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="From-1465"><a href="#From-1465"><span class="linenos">1465</span></a> +</span><span id="From-1466"><a href="#From-1466"><span class="linenos">1466</span></a> <span class="nd">@property</span> +</span><span id="From-1467"><a href="#From-1467"><span class="linenos">1467</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="From-1468"><a href="#From-1468"><span class="linenos">1468</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></pre></div> @@ -21179,8 +21190,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-1473"><a href="#Having-1473"><span class="linenos">1473</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-1474"><a href="#Having-1474"><span class="linenos">1474</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Having-1471"><a href="#Having-1471"><span class="linenos">1471</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-1472"><a href="#Having-1472"><span class="linenos">1472</span></a> <span class="k">pass</span> </span></pre></div> @@ -21266,8 +21277,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-1477"><a href="#Hint-1477"><span class="linenos">1477</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-1478"><a href="#Hint-1478"><span class="linenos">1478</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-1475"><a href="#Hint-1475"><span class="linenos">1475</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-1476"><a href="#Hint-1476"><span class="linenos">1476</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> @@ -21364,8 +21375,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-1481"><a href="#JoinHint-1481"><span class="linenos">1481</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-1482"><a href="#JoinHint-1482"><span class="linenos">1482</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1479"><a href="#JoinHint-1479"><span class="linenos">1479</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-1480"><a href="#JoinHint-1480"><span class="linenos">1480</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -21462,22 +21473,20 @@ 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-1485"><a href="#Identifier-1485"><span class="linenos">1485</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-1486"><a href="#Identifier-1486"><span class="linenos">1486</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1487"><a href="#Identifier-1487"><span class="linenos">1487</span></a> -</span><span id="Identifier-1488"><a href="#Identifier-1488"><span class="linenos">1488</span></a> <span class="nd">@property</span> -</span><span id="Identifier-1489"><a href="#Identifier-1489"><span class="linenos">1489</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 class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="Identifier-1490"><a href="#Identifier-1490"><span class="linenos">1490</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-1491"><a href="#Identifier-1491"><span class="linenos">1491</span></a> -</span><span id="Identifier-1492"><a href="#Identifier-1492"><span class="linenos">1492</span></a> <span class="nd">@property</span> -</span><span id="Identifier-1493"><a href="#Identifier-1493"><span class="linenos">1493</span></a> <span class="k">def</span> <span class="nf">hashable_args</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">Any</span><span class="p">:</span> -</span><span id="Identifier-1494"><a href="#Identifier-1494"><span class="linenos">1494</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">quoted</span> <span class="ow">and</span> <span class="nb">any</span><span class="p">(</span><span class="n">char</span><span class="o">.</span><span class="n">isupper</span><span class="p">()</span> <span class="k">for</span> <span class="n">char</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">):</span> -</span><span id="Identifier-1495"><a href="#Identifier-1495"><span class="linenos">1495</span></a> <span class="k">return</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">quoted</span><span class="p">)</span> -</span><span id="Identifier-1496"><a href="#Identifier-1496"><span class="linenos">1496</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">lower</span><span class="p">()</span> -</span><span id="Identifier-1497"><a href="#Identifier-1497"><span class="linenos">1497</span></a> -</span><span id="Identifier-1498"><a href="#Identifier-1498"><span class="linenos">1498</span></a> <span class="nd">@property</span> -</span><span id="Identifier-1499"><a href="#Identifier-1499"><span class="linenos">1499</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="Identifier-1500"><a href="#Identifier-1500"><span class="linenos">1500</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-1483"><a href="#Identifier-1483"><span class="linenos">1483</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-1484"><a href="#Identifier-1484"><span class="linenos">1484</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1485"><a href="#Identifier-1485"><span class="linenos">1485</span></a> +</span><span id="Identifier-1486"><a href="#Identifier-1486"><span class="linenos">1486</span></a> <span class="nd">@property</span> +</span><span id="Identifier-1487"><a href="#Identifier-1487"><span class="linenos">1487</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 class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="Identifier-1488"><a href="#Identifier-1488"><span class="linenos">1488</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-1489"><a href="#Identifier-1489"><span class="linenos">1489</span></a> +</span><span id="Identifier-1490"><a href="#Identifier-1490"><span class="linenos">1490</span></a> <span class="nd">@property</span> +</span><span id="Identifier-1491"><a href="#Identifier-1491"><span class="linenos">1491</span></a> <span class="k">def</span> <span class="nf">hashable_args</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">Any</span><span class="p">:</span> +</span><span id="Identifier-1492"><a href="#Identifier-1492"><span class="linenos">1492</span></a> <span class="k">return</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">quoted</span><span class="p">)</span> +</span><span id="Identifier-1493"><a href="#Identifier-1493"><span class="linenos">1493</span></a> +</span><span id="Identifier-1494"><a href="#Identifier-1494"><span class="linenos">1494</span></a> <span class="nd">@property</span> +</span><span id="Identifier-1495"><a href="#Identifier-1495"><span class="linenos">1495</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="Identifier-1496"><a href="#Identifier-1496"><span class="linenos">1496</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> </span></pre></div> @@ -21624,18 +21633,18 @@ 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-1503"><a href="#Index-1503"><span class="linenos">1503</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-1504"><a href="#Index-1504"><span class="linenos">1504</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Index-1505"><a href="#Index-1505"><span class="linenos">1505</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1506"><a href="#Index-1506"><span class="linenos">1506</span></a> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1507"><a href="#Index-1507"><span class="linenos">1507</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1508"><a href="#Index-1508"><span class="linenos">1508</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1509"><a href="#Index-1509"><span class="linenos">1509</span></a> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1510"><a href="#Index-1510"><span class="linenos">1510</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1511"><a href="#Index-1511"><span class="linenos">1511</span></a> <span class="s2">"primary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1512"><a href="#Index-1512"><span class="linenos">1512</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-1513"><a href="#Index-1513"><span class="linenos">1513</span></a> <span class="s2">"partition_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># teradata</span> -</span><span id="Index-1514"><a href="#Index-1514"><span class="linenos">1514</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Index-1499"><a href="#Index-1499"><span class="linenos">1499</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-1500"><a href="#Index-1500"><span class="linenos">1500</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Index-1501"><a href="#Index-1501"><span class="linenos">1501</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1502"><a href="#Index-1502"><span class="linenos">1502</span></a> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1503"><a href="#Index-1503"><span class="linenos">1503</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1504"><a href="#Index-1504"><span class="linenos">1504</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1505"><a href="#Index-1505"><span class="linenos">1505</span></a> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1506"><a href="#Index-1506"><span class="linenos">1506</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1507"><a href="#Index-1507"><span class="linenos">1507</span></a> <span class="s2">"primary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1508"><a href="#Index-1508"><span class="linenos">1508</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-1509"><a href="#Index-1509"><span class="linenos">1509</span></a> <span class="s2">"partition_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># teradata</span> +</span><span id="Index-1510"><a href="#Index-1510"><span class="linenos">1510</span></a> <span class="p">}</span> </span></pre></div> @@ -21733,55 +21742,56 @@ 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-1517"><a href="#Insert-1517"><span class="linenos">1517</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-1518"><a href="#Insert-1518"><span class="linenos">1518</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Insert-1519"><a href="#Insert-1519"><span class="linenos">1519</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1520"><a href="#Insert-1520"><span class="linenos">1520</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Insert-1521"><a href="#Insert-1521"><span class="linenos">1521</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1522"><a href="#Insert-1522"><span class="linenos">1522</span></a> <span class="s2">"conflict"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1523"><a href="#Insert-1523"><span class="linenos">1523</span></a> <span class="s2">"returning"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1524"><a href="#Insert-1524"><span class="linenos">1524</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1525"><a href="#Insert-1525"><span class="linenos">1525</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1526"><a href="#Insert-1526"><span class="linenos">1526</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1527"><a href="#Insert-1527"><span class="linenos">1527</span></a> <span class="s2">"alternative"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1528"><a href="#Insert-1528"><span class="linenos">1528</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1529"><a href="#Insert-1529"><span class="linenos">1529</span></a> <span class="p">}</span> -</span><span id="Insert-1530"><a href="#Insert-1530"><span class="linenos">1530</span></a> -</span><span id="Insert-1531"><a href="#Insert-1531"><span class="linenos">1531</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> -</span><span id="Insert-1532"><a href="#Insert-1532"><span class="linenos">1532</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Insert-1533"><a href="#Insert-1533"><span class="linenos">1533</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Insert-1534"><a href="#Insert-1534"><span class="linenos">1534</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Insert-1535"><a href="#Insert-1535"><span class="linenos">1535</span></a> <span class="n">recursive</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="Insert-1536"><a href="#Insert-1536"><span class="linenos">1536</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="Insert-1537"><a href="#Insert-1537"><span class="linenos">1537</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="Insert-1538"><a href="#Insert-1538"><span class="linenos">1538</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="Insert-1539"><a href="#Insert-1539"><span class="linenos">1539</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Insert-1540"><a href="#Insert-1540"><span class="linenos">1540</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Insert</span><span class="p">:</span> -</span><span id="Insert-1541"><a href="#Insert-1541"><span class="linenos">1541</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Insert-1542"><a href="#Insert-1542"><span class="linenos">1542</span></a><span class="sd"> Append to or set the common table expressions.</span> -</span><span id="Insert-1543"><a href="#Insert-1543"><span class="linenos">1543</span></a> -</span><span id="Insert-1544"><a href="#Insert-1544"><span class="linenos">1544</span></a><span class="sd"> Example:</span> -</span><span id="Insert-1545"><a href="#Insert-1545"><span class="linenos">1545</span></a><span class="sd"> >>> insert("SELECT x FROM cte", "t").with_("cte", as_="SELECT * FROM tbl").sql()</span> -</span><span id="Insert-1546"><a href="#Insert-1546"><span class="linenos">1546</span></a><span class="sd"> 'WITH cte AS (SELECT * FROM tbl) INSERT INTO t SELECT x FROM cte'</span> -</span><span id="Insert-1547"><a href="#Insert-1547"><span class="linenos">1547</span></a> -</span><span id="Insert-1548"><a href="#Insert-1548"><span class="linenos">1548</span></a><span class="sd"> Args:</span> -</span><span id="Insert-1549"><a href="#Insert-1549"><span class="linenos">1549</span></a><span class="sd"> alias: the SQL code string to parse as the table name.</span> -</span><span id="Insert-1550"><a href="#Insert-1550"><span class="linenos">1550</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> -</span><span id="Insert-1551"><a href="#Insert-1551"><span class="linenos">1551</span></a><span class="sd"> as_: the SQL code string to parse as the table expression.</span> -</span><span id="Insert-1552"><a href="#Insert-1552"><span class="linenos">1552</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Insert-1553"><a href="#Insert-1553"><span class="linenos">1553</span></a><span class="sd"> recursive: set the RECURSIVE part of the expression. Defaults to `False`.</span> -</span><span id="Insert-1554"><a href="#Insert-1554"><span class="linenos">1554</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Insert-1555"><a href="#Insert-1555"><span class="linenos">1555</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Insert-1556"><a href="#Insert-1556"><span class="linenos">1556</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Insert-1557"><a href="#Insert-1557"><span class="linenos">1557</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Insert-1558"><a href="#Insert-1558"><span class="linenos">1558</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Insert-1559"><a href="#Insert-1559"><span class="linenos">1559</span></a> -</span><span id="Insert-1560"><a href="#Insert-1560"><span class="linenos">1560</span></a><span class="sd"> Returns:</span> -</span><span id="Insert-1561"><a href="#Insert-1561"><span class="linenos">1561</span></a><span class="sd"> The modified expression.</span> -</span><span id="Insert-1562"><a href="#Insert-1562"><span class="linenos">1562</span></a><span class="sd"> """</span> -</span><span id="Insert-1563"><a href="#Insert-1563"><span class="linenos">1563</span></a> <span class="k">return</span> <span class="n">_apply_cte_builder</span><span class="p">(</span> -</span><span id="Insert-1564"><a href="#Insert-1564"><span class="linenos">1564</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="p">,</span> <span class="n">as_</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="n">recursive</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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> -</span><span id="Insert-1565"><a href="#Insert-1565"><span class="linenos">1565</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Insert-1513"><a href="#Insert-1513"><span class="linenos">1513</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-1514"><a href="#Insert-1514"><span class="linenos">1514</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Insert-1515"><a href="#Insert-1515"><span class="linenos">1515</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1516"><a href="#Insert-1516"><span class="linenos">1516</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Insert-1517"><a href="#Insert-1517"><span class="linenos">1517</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1518"><a href="#Insert-1518"><span class="linenos">1518</span></a> <span class="s2">"conflict"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1519"><a href="#Insert-1519"><span class="linenos">1519</span></a> <span class="s2">"returning"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1520"><a href="#Insert-1520"><span class="linenos">1520</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1521"><a href="#Insert-1521"><span class="linenos">1521</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1522"><a href="#Insert-1522"><span class="linenos">1522</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1523"><a href="#Insert-1523"><span class="linenos">1523</span></a> <span class="s2">"alternative"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1524"><a href="#Insert-1524"><span class="linenos">1524</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1525"><a href="#Insert-1525"><span class="linenos">1525</span></a> <span class="s2">"ignore"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1526"><a href="#Insert-1526"><span class="linenos">1526</span></a> <span class="p">}</span> +</span><span id="Insert-1527"><a href="#Insert-1527"><span class="linenos">1527</span></a> +</span><span id="Insert-1528"><a href="#Insert-1528"><span class="linenos">1528</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> +</span><span id="Insert-1529"><a href="#Insert-1529"><span class="linenos">1529</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Insert-1530"><a href="#Insert-1530"><span class="linenos">1530</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Insert-1531"><a href="#Insert-1531"><span class="linenos">1531</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Insert-1532"><a href="#Insert-1532"><span class="linenos">1532</span></a> <span class="n">recursive</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="Insert-1533"><a href="#Insert-1533"><span class="linenos">1533</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="Insert-1534"><a href="#Insert-1534"><span class="linenos">1534</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="Insert-1535"><a href="#Insert-1535"><span class="linenos">1535</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="Insert-1536"><a href="#Insert-1536"><span class="linenos">1536</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Insert-1537"><a href="#Insert-1537"><span class="linenos">1537</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Insert</span><span class="p">:</span> +</span><span id="Insert-1538"><a href="#Insert-1538"><span class="linenos">1538</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Insert-1539"><a href="#Insert-1539"><span class="linenos">1539</span></a><span class="sd"> Append to or set the common table expressions.</span> +</span><span id="Insert-1540"><a href="#Insert-1540"><span class="linenos">1540</span></a> +</span><span id="Insert-1541"><a href="#Insert-1541"><span class="linenos">1541</span></a><span class="sd"> Example:</span> +</span><span id="Insert-1542"><a href="#Insert-1542"><span class="linenos">1542</span></a><span class="sd"> >>> insert("SELECT x FROM cte", "t").with_("cte", as_="SELECT * FROM tbl").sql()</span> +</span><span id="Insert-1543"><a href="#Insert-1543"><span class="linenos">1543</span></a><span class="sd"> 'WITH cte AS (SELECT * FROM tbl) INSERT INTO t SELECT x FROM cte'</span> +</span><span id="Insert-1544"><a href="#Insert-1544"><span class="linenos">1544</span></a> +</span><span id="Insert-1545"><a href="#Insert-1545"><span class="linenos">1545</span></a><span class="sd"> Args:</span> +</span><span id="Insert-1546"><a href="#Insert-1546"><span class="linenos">1546</span></a><span class="sd"> alias: the SQL code string to parse as the table name.</span> +</span><span id="Insert-1547"><a href="#Insert-1547"><span class="linenos">1547</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> +</span><span id="Insert-1548"><a href="#Insert-1548"><span class="linenos">1548</span></a><span class="sd"> as_: the SQL code string to parse as the table expression.</span> +</span><span id="Insert-1549"><a href="#Insert-1549"><span class="linenos">1549</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Insert-1550"><a href="#Insert-1550"><span class="linenos">1550</span></a><span class="sd"> recursive: set the RECURSIVE part of the expression. Defaults to `False`.</span> +</span><span id="Insert-1551"><a href="#Insert-1551"><span class="linenos">1551</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Insert-1552"><a href="#Insert-1552"><span class="linenos">1552</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Insert-1553"><a href="#Insert-1553"><span class="linenos">1553</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Insert-1554"><a href="#Insert-1554"><span class="linenos">1554</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Insert-1555"><a href="#Insert-1555"><span class="linenos">1555</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Insert-1556"><a href="#Insert-1556"><span class="linenos">1556</span></a> +</span><span id="Insert-1557"><a href="#Insert-1557"><span class="linenos">1557</span></a><span class="sd"> Returns:</span> +</span><span id="Insert-1558"><a href="#Insert-1558"><span class="linenos">1558</span></a><span class="sd"> The modified expression.</span> +</span><span id="Insert-1559"><a href="#Insert-1559"><span class="linenos">1559</span></a><span class="sd"> """</span> +</span><span id="Insert-1560"><a href="#Insert-1560"><span class="linenos">1560</span></a> <span class="k">return</span> <span class="n">_apply_cte_builder</span><span class="p">(</span> +</span><span id="Insert-1561"><a href="#Insert-1561"><span class="linenos">1561</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="p">,</span> <span class="n">as_</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="n">recursive</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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> +</span><span id="Insert-1562"><a href="#Insert-1562"><span class="linenos">1562</span></a> <span class="p">)</span> </span></pre></div> @@ -21791,7 +21801,7 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w <div class="attr variable"> <span class="name">arg_types</span> = <input id="Insert.arg_types-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> - <label class="view-value-button pdoc-button" for="Insert.arg_types-view-value"></label><span class="default_value">{'with': False, 'this': True, 'expression': False, 'conflict': False, 'returning': False, 'overwrite': False, 'exists': False, 'partition': False, 'alternative': False, 'where': False}</span> + <label class="view-value-button pdoc-button" for="Insert.arg_types-view-value"></label><span class="default_value">{'with': False, 'this': True, 'expression': False, 'conflict': False, 'returning': False, 'overwrite': False, 'exists': False, 'partition': False, 'alternative': False, 'where': False, 'ignore': False}</span> </div> @@ -21811,41 +21821,41 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Insert.with_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Insert.with_-1531"><a href="#Insert.with_-1531"><span class="linenos">1531</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> -</span><span id="Insert.with_-1532"><a href="#Insert.with_-1532"><span class="linenos">1532</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Insert.with_-1533"><a href="#Insert.with_-1533"><span class="linenos">1533</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Insert.with_-1534"><a href="#Insert.with_-1534"><span class="linenos">1534</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Insert.with_-1535"><a href="#Insert.with_-1535"><span class="linenos">1535</span></a> <span class="n">recursive</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="Insert.with_-1536"><a href="#Insert.with_-1536"><span class="linenos">1536</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="Insert.with_-1537"><a href="#Insert.with_-1537"><span class="linenos">1537</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="Insert.with_-1538"><a href="#Insert.with_-1538"><span class="linenos">1538</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="Insert.with_-1539"><a href="#Insert.with_-1539"><span class="linenos">1539</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Insert.with_-1540"><a href="#Insert.with_-1540"><span class="linenos">1540</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Insert</span><span class="p">:</span> -</span><span id="Insert.with_-1541"><a href="#Insert.with_-1541"><span class="linenos">1541</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Insert.with_-1542"><a href="#Insert.with_-1542"><span class="linenos">1542</span></a><span class="sd"> Append to or set the common table expressions.</span> -</span><span id="Insert.with_-1543"><a href="#Insert.with_-1543"><span class="linenos">1543</span></a> -</span><span id="Insert.with_-1544"><a href="#Insert.with_-1544"><span class="linenos">1544</span></a><span class="sd"> Example:</span> -</span><span id="Insert.with_-1545"><a href="#Insert.with_-1545"><span class="linenos">1545</span></a><span class="sd"> >>> insert("SELECT x FROM cte", "t").with_("cte", as_="SELECT * FROM tbl").sql()</span> -</span><span id="Insert.with_-1546"><a href="#Insert.with_-1546"><span class="linenos">1546</span></a><span class="sd"> 'WITH cte AS (SELECT * FROM tbl) INSERT INTO t SELECT x FROM cte'</span> -</span><span id="Insert.with_-1547"><a href="#Insert.with_-1547"><span class="linenos">1547</span></a> -</span><span id="Insert.with_-1548"><a href="#Insert.with_-1548"><span class="linenos">1548</span></a><span class="sd"> Args:</span> -</span><span id="Insert.with_-1549"><a href="#Insert.with_-1549"><span class="linenos">1549</span></a><span class="sd"> alias: the SQL code string to parse as the table name.</span> -</span><span id="Insert.with_-1550"><a href="#Insert.with_-1550"><span class="linenos">1550</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> -</span><span id="Insert.with_-1551"><a href="#Insert.with_-1551"><span class="linenos">1551</span></a><span class="sd"> as_: the SQL code string to parse as the table expression.</span> -</span><span id="Insert.with_-1552"><a href="#Insert.with_-1552"><span class="linenos">1552</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Insert.with_-1553"><a href="#Insert.with_-1553"><span class="linenos">1553</span></a><span class="sd"> recursive: set the RECURSIVE part of the expression. Defaults to `False`.</span> -</span><span id="Insert.with_-1554"><a href="#Insert.with_-1554"><span class="linenos">1554</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Insert.with_-1555"><a href="#Insert.with_-1555"><span class="linenos">1555</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Insert.with_-1556"><a href="#Insert.with_-1556"><span class="linenos">1556</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Insert.with_-1557"><a href="#Insert.with_-1557"><span class="linenos">1557</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Insert.with_-1558"><a href="#Insert.with_-1558"><span class="linenos">1558</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Insert.with_-1559"><a href="#Insert.with_-1559"><span class="linenos">1559</span></a> -</span><span id="Insert.with_-1560"><a href="#Insert.with_-1560"><span class="linenos">1560</span></a><span class="sd"> Returns:</span> -</span><span id="Insert.with_-1561"><a href="#Insert.with_-1561"><span class="linenos">1561</span></a><span class="sd"> The modified expression.</span> -</span><span id="Insert.with_-1562"><a href="#Insert.with_-1562"><span class="linenos">1562</span></a><span class="sd"> """</span> -</span><span id="Insert.with_-1563"><a href="#Insert.with_-1563"><span class="linenos">1563</span></a> <span class="k">return</span> <span class="n">_apply_cte_builder</span><span class="p">(</span> -</span><span id="Insert.with_-1564"><a href="#Insert.with_-1564"><span class="linenos">1564</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="p">,</span> <span class="n">as_</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="n">recursive</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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> -</span><span id="Insert.with_-1565"><a href="#Insert.with_-1565"><span class="linenos">1565</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Insert.with_-1528"><a href="#Insert.with_-1528"><span class="linenos">1528</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> +</span><span id="Insert.with_-1529"><a href="#Insert.with_-1529"><span class="linenos">1529</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Insert.with_-1530"><a href="#Insert.with_-1530"><span class="linenos">1530</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Insert.with_-1531"><a href="#Insert.with_-1531"><span class="linenos">1531</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Insert.with_-1532"><a href="#Insert.with_-1532"><span class="linenos">1532</span></a> <span class="n">recursive</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="Insert.with_-1533"><a href="#Insert.with_-1533"><span class="linenos">1533</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="Insert.with_-1534"><a href="#Insert.with_-1534"><span class="linenos">1534</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="Insert.with_-1535"><a href="#Insert.with_-1535"><span class="linenos">1535</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="Insert.with_-1536"><a href="#Insert.with_-1536"><span class="linenos">1536</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Insert.with_-1537"><a href="#Insert.with_-1537"><span class="linenos">1537</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Insert</span><span class="p">:</span> +</span><span id="Insert.with_-1538"><a href="#Insert.with_-1538"><span class="linenos">1538</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Insert.with_-1539"><a href="#Insert.with_-1539"><span class="linenos">1539</span></a><span class="sd"> Append to or set the common table expressions.</span> +</span><span id="Insert.with_-1540"><a href="#Insert.with_-1540"><span class="linenos">1540</span></a> +</span><span id="Insert.with_-1541"><a href="#Insert.with_-1541"><span class="linenos">1541</span></a><span class="sd"> Example:</span> +</span><span id="Insert.with_-1542"><a href="#Insert.with_-1542"><span class="linenos">1542</span></a><span class="sd"> >>> insert("SELECT x FROM cte", "t").with_("cte", as_="SELECT * FROM tbl").sql()</span> +</span><span id="Insert.with_-1543"><a href="#Insert.with_-1543"><span class="linenos">1543</span></a><span class="sd"> 'WITH cte AS (SELECT * FROM tbl) INSERT INTO t SELECT x FROM cte'</span> +</span><span id="Insert.with_-1544"><a href="#Insert.with_-1544"><span class="linenos">1544</span></a> +</span><span id="Insert.with_-1545"><a href="#Insert.with_-1545"><span class="linenos">1545</span></a><span class="sd"> Args:</span> +</span><span id="Insert.with_-1546"><a href="#Insert.with_-1546"><span class="linenos">1546</span></a><span class="sd"> alias: the SQL code string to parse as the table name.</span> +</span><span id="Insert.with_-1547"><a href="#Insert.with_-1547"><span class="linenos">1547</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> +</span><span id="Insert.with_-1548"><a href="#Insert.with_-1548"><span class="linenos">1548</span></a><span class="sd"> as_: the SQL code string to parse as the table expression.</span> +</span><span id="Insert.with_-1549"><a href="#Insert.with_-1549"><span class="linenos">1549</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Insert.with_-1550"><a href="#Insert.with_-1550"><span class="linenos">1550</span></a><span class="sd"> recursive: set the RECURSIVE part of the expression. Defaults to `False`.</span> +</span><span id="Insert.with_-1551"><a href="#Insert.with_-1551"><span class="linenos">1551</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Insert.with_-1552"><a href="#Insert.with_-1552"><span class="linenos">1552</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Insert.with_-1553"><a href="#Insert.with_-1553"><span class="linenos">1553</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Insert.with_-1554"><a href="#Insert.with_-1554"><span class="linenos">1554</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Insert.with_-1555"><a href="#Insert.with_-1555"><span class="linenos">1555</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Insert.with_-1556"><a href="#Insert.with_-1556"><span class="linenos">1556</span></a> +</span><span id="Insert.with_-1557"><a href="#Insert.with_-1557"><span class="linenos">1557</span></a><span class="sd"> Returns:</span> +</span><span id="Insert.with_-1558"><a href="#Insert.with_-1558"><span class="linenos">1558</span></a><span class="sd"> The modified expression.</span> +</span><span id="Insert.with_-1559"><a href="#Insert.with_-1559"><span class="linenos">1559</span></a><span class="sd"> """</span> +</span><span id="Insert.with_-1560"><a href="#Insert.with_-1560"><span class="linenos">1560</span></a> <span class="k">return</span> <span class="n">_apply_cte_builder</span><span class="p">(</span> +</span><span id="Insert.with_-1561"><a href="#Insert.with_-1561"><span class="linenos">1561</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="p">,</span> <span class="n">as_</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="n">recursive</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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> +</span><span id="Insert.with_-1562"><a href="#Insert.with_-1562"><span class="linenos">1562</span></a> <span class="p">)</span> </span></pre></div> @@ -21964,14 +21974,14 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#OnConflict"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="OnConflict-1568"><a href="#OnConflict-1568"><span class="linenos">1568</span></a><span class="k">class</span> <span class="nc">OnConflict</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="OnConflict-1569"><a href="#OnConflict-1569"><span class="linenos">1569</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="OnConflict-1570"><a href="#OnConflict-1570"><span class="linenos">1570</span></a> <span class="s2">"duplicate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="OnConflict-1571"><a href="#OnConflict-1571"><span class="linenos">1571</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="OnConflict-1572"><a href="#OnConflict-1572"><span class="linenos">1572</span></a> <span class="s2">"nothing"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="OnConflict-1573"><a href="#OnConflict-1573"><span class="linenos">1573</span></a> <span class="s2">"key"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="OnConflict-1574"><a href="#OnConflict-1574"><span class="linenos">1574</span></a> <span class="s2">"constraint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="OnConflict-1575"><a href="#OnConflict-1575"><span class="linenos">1575</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="OnConflict-1565"><a href="#OnConflict-1565"><span class="linenos">1565</span></a><span class="k">class</span> <span class="nc">OnConflict</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="OnConflict-1566"><a href="#OnConflict-1566"><span class="linenos">1566</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="OnConflict-1567"><a href="#OnConflict-1567"><span class="linenos">1567</span></a> <span class="s2">"duplicate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="OnConflict-1568"><a href="#OnConflict-1568"><span class="linenos">1568</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="OnConflict-1569"><a href="#OnConflict-1569"><span class="linenos">1569</span></a> <span class="s2">"nothing"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="OnConflict-1570"><a href="#OnConflict-1570"><span class="linenos">1570</span></a> <span class="s2">"key"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="OnConflict-1571"><a href="#OnConflict-1571"><span class="linenos">1571</span></a> <span class="s2">"constraint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="OnConflict-1572"><a href="#OnConflict-1572"><span class="linenos">1572</span></a> <span class="p">}</span> </span></pre></div> @@ -22068,8 +22078,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Returning"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Returning-1578"><a href="#Returning-1578"><span class="linenos">1578</span></a><span class="k">class</span> <span class="nc">Returning</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Returning-1579"><a href="#Returning-1579"><span class="linenos">1579</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="Returning-1575"><a href="#Returning-1575"><span class="linenos">1575</span></a><span class="k">class</span> <span class="nc">Returning</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Returning-1576"><a href="#Returning-1576"><span class="linenos">1576</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> @@ -22166,8 +22176,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Introducer"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Introducer-1583"><a href="#Introducer-1583"><span class="linenos">1583</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-1584"><a href="#Introducer-1584"><span class="linenos">1584</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1580"><a href="#Introducer-1580"><span class="linenos">1580</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-1581"><a href="#Introducer-1581"><span class="linenos">1581</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -22264,8 +22274,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#National"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="National-1588"><a href="#National-1588"><span class="linenos">1588</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-1589"><a href="#National-1589"><span class="linenos">1589</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="National-1585"><a href="#National-1585"><span class="linenos">1585</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-1586"><a href="#National-1586"><span class="linenos">1586</span></a> <span class="k">pass</span> </span></pre></div> @@ -22351,16 +22361,16 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#LoadData"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LoadData-1592"><a href="#LoadData-1592"><span class="linenos">1592</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-1593"><a href="#LoadData-1593"><span class="linenos">1593</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="LoadData-1594"><a href="#LoadData-1594"><span class="linenos">1594</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="LoadData-1595"><a href="#LoadData-1595"><span class="linenos">1595</span></a> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LoadData-1596"><a href="#LoadData-1596"><span class="linenos">1596</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LoadData-1597"><a href="#LoadData-1597"><span class="linenos">1597</span></a> <span class="s2">"inpath"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="LoadData-1598"><a href="#LoadData-1598"><span class="linenos">1598</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LoadData-1599"><a href="#LoadData-1599"><span class="linenos">1599</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-1600"><a href="#LoadData-1600"><span class="linenos">1600</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LoadData-1601"><a href="#LoadData-1601"><span class="linenos">1601</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LoadData-1589"><a href="#LoadData-1589"><span class="linenos">1589</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-1590"><a href="#LoadData-1590"><span class="linenos">1590</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="LoadData-1591"><a href="#LoadData-1591"><span class="linenos">1591</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="LoadData-1592"><a href="#LoadData-1592"><span class="linenos">1592</span></a> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LoadData-1593"><a href="#LoadData-1593"><span class="linenos">1593</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LoadData-1594"><a href="#LoadData-1594"><span class="linenos">1594</span></a> <span class="s2">"inpath"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="LoadData-1595"><a href="#LoadData-1595"><span class="linenos">1595</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LoadData-1596"><a href="#LoadData-1596"><span class="linenos">1596</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-1597"><a href="#LoadData-1597"><span class="linenos">1597</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LoadData-1598"><a href="#LoadData-1598"><span class="linenos">1598</span></a> <span class="p">}</span> </span></pre></div> @@ -22458,8 +22468,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Partition"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Partition-1604"><a href="#Partition-1604"><span class="linenos">1604</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-1605"><a href="#Partition-1605"><span class="linenos">1605</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-1601"><a href="#Partition-1601"><span class="linenos">1601</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-1602"><a href="#Partition-1602"><span class="linenos">1602</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> @@ -22556,13 +22566,13 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Fetch"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Fetch-1608"><a href="#Fetch-1608"><span class="linenos">1608</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-1609"><a href="#Fetch-1609"><span class="linenos">1609</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Fetch-1610"><a href="#Fetch-1610"><span class="linenos">1610</span></a> <span class="s2">"direction"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Fetch-1611"><a href="#Fetch-1611"><span class="linenos">1611</span></a> <span class="s2">"count"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Fetch-1612"><a href="#Fetch-1612"><span class="linenos">1612</span></a> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Fetch-1613"><a href="#Fetch-1613"><span class="linenos">1613</span></a> <span class="s2">"with_ties"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Fetch-1614"><a href="#Fetch-1614"><span class="linenos">1614</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Fetch-1605"><a href="#Fetch-1605"><span class="linenos">1605</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-1606"><a href="#Fetch-1606"><span class="linenos">1606</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Fetch-1607"><a href="#Fetch-1607"><span class="linenos">1607</span></a> <span class="s2">"direction"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Fetch-1608"><a href="#Fetch-1608"><span class="linenos">1608</span></a> <span class="s2">"count"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Fetch-1609"><a href="#Fetch-1609"><span class="linenos">1609</span></a> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Fetch-1610"><a href="#Fetch-1610"><span class="linenos">1610</span></a> <span class="s2">"with_ties"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Fetch-1611"><a href="#Fetch-1611"><span class="linenos">1611</span></a> <span class="p">}</span> </span></pre></div> @@ -22659,14 +22669,15 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Group"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Group-1617"><a href="#Group-1617"><span class="linenos">1617</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-1618"><a href="#Group-1618"><span class="linenos">1618</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Group-1619"><a href="#Group-1619"><span class="linenos">1619</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Group-1620"><a href="#Group-1620"><span class="linenos">1620</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-1621"><a href="#Group-1621"><span class="linenos">1621</span></a> <span class="s2">"cube"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Group-1622"><a href="#Group-1622"><span class="linenos">1622</span></a> <span class="s2">"rollup"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Group-1623"><a href="#Group-1623"><span class="linenos">1623</span></a> <span class="s2">"totals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Group-1624"><a href="#Group-1624"><span class="linenos">1624</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Group-1614"><a href="#Group-1614"><span class="linenos">1614</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-1615"><a href="#Group-1615"><span class="linenos">1615</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Group-1616"><a href="#Group-1616"><span class="linenos">1616</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Group-1617"><a href="#Group-1617"><span class="linenos">1617</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-1618"><a href="#Group-1618"><span class="linenos">1618</span></a> <span class="s2">"cube"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Group-1619"><a href="#Group-1619"><span class="linenos">1619</span></a> <span class="s2">"rollup"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Group-1620"><a href="#Group-1620"><span class="linenos">1620</span></a> <span class="s2">"totals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Group-1621"><a href="#Group-1621"><span class="linenos">1621</span></a> <span class="s2">"all"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Group-1622"><a href="#Group-1622"><span class="linenos">1622</span></a> <span class="p">}</span> </span></pre></div> @@ -22675,7 +22686,8 @@ Otherwise, this resets the expressions.</li> <div id="Group.arg_types" class="classattr"> <div class="attr variable"> <span class="name">arg_types</span> = -<span class="default_value">{'expressions': False, 'grouping_sets': False, 'cube': False, 'rollup': False, 'totals': False}</span> +<input id="Group.arg_types-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <label class="view-value-button pdoc-button" for="Group.arg_types-view-value"></label><span class="default_value">{'expressions': False, 'grouping_sets': False, 'cube': False, 'rollup': False, 'totals': False, 'all': False}</span> </div> @@ -22763,8 +22775,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Lambda"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Lambda-1627"><a href="#Lambda-1627"><span class="linenos">1627</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-1628"><a href="#Lambda-1628"><span class="linenos">1628</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1625"><a href="#Lambda-1625"><span class="linenos">1625</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-1626"><a href="#Lambda-1626"><span class="linenos">1626</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -22861,8 +22873,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Limit"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Limit-1631"><a href="#Limit-1631"><span class="linenos">1631</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-1632"><a href="#Limit-1632"><span class="linenos">1632</span></a> <span class="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 class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Limit-1629"><a href="#Limit-1629"><span class="linenos">1629</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-1630"><a href="#Limit-1630"><span class="linenos">1630</span></a> <span class="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 class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -22959,24 +22971,24 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Literal"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Literal-1635"><a href="#Literal-1635"><span class="linenos">1635</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-1636"><a href="#Literal-1636"><span class="linenos">1636</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1637"><a href="#Literal-1637"><span class="linenos">1637</span></a> -</span><span id="Literal-1638"><a href="#Literal-1638"><span class="linenos">1638</span></a> <span class="nd">@property</span> -</span><span id="Literal-1639"><a href="#Literal-1639"><span class="linenos">1639</span></a> <span class="k">def</span> <span class="nf">hashable_args</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">Any</span><span class="p">:</span> -</span><span id="Literal-1640"><a href="#Literal-1640"><span class="linenos">1640</span></a> <span class="k">return</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="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"is_string"</span><span class="p">))</span> -</span><span id="Literal-1641"><a href="#Literal-1641"><span class="linenos">1641</span></a> -</span><span id="Literal-1642"><a href="#Literal-1642"><span class="linenos">1642</span></a> <span class="nd">@classmethod</span> -</span><span id="Literal-1643"><a href="#Literal-1643"><span class="linenos">1643</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-1644"><a href="#Literal-1644"><span class="linenos">1644</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-1645"><a href="#Literal-1645"><span class="linenos">1645</span></a> -</span><span id="Literal-1646"><a href="#Literal-1646"><span class="linenos">1646</span></a> <span class="nd">@classmethod</span> -</span><span id="Literal-1647"><a href="#Literal-1647"><span class="linenos">1647</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-1648"><a href="#Literal-1648"><span class="linenos">1648</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-1649"><a href="#Literal-1649"><span class="linenos">1649</span></a> -</span><span id="Literal-1650"><a href="#Literal-1650"><span class="linenos">1650</span></a> <span class="nd">@property</span> -</span><span id="Literal-1651"><a href="#Literal-1651"><span class="linenos">1651</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="Literal-1652"><a href="#Literal-1652"><span class="linenos">1652</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="Literal-1633"><a href="#Literal-1633"><span class="linenos">1633</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-1634"><a href="#Literal-1634"><span class="linenos">1634</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1635"><a href="#Literal-1635"><span class="linenos">1635</span></a> +</span><span id="Literal-1636"><a href="#Literal-1636"><span class="linenos">1636</span></a> <span class="nd">@property</span> +</span><span id="Literal-1637"><a href="#Literal-1637"><span class="linenos">1637</span></a> <span class="k">def</span> <span class="nf">hashable_args</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">Any</span><span class="p">:</span> +</span><span id="Literal-1638"><a href="#Literal-1638"><span class="linenos">1638</span></a> <span class="k">return</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="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"is_string"</span><span class="p">))</span> +</span><span id="Literal-1639"><a href="#Literal-1639"><span class="linenos">1639</span></a> +</span><span id="Literal-1640"><a href="#Literal-1640"><span class="linenos">1640</span></a> <span class="nd">@classmethod</span> +</span><span id="Literal-1641"><a href="#Literal-1641"><span class="linenos">1641</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-1642"><a href="#Literal-1642"><span class="linenos">1642</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-1643"><a href="#Literal-1643"><span class="linenos">1643</span></a> +</span><span id="Literal-1644"><a href="#Literal-1644"><span class="linenos">1644</span></a> <span class="nd">@classmethod</span> +</span><span id="Literal-1645"><a href="#Literal-1645"><span class="linenos">1645</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-1646"><a href="#Literal-1646"><span class="linenos">1646</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-1647"><a href="#Literal-1647"><span class="linenos">1647</span></a> +</span><span id="Literal-1648"><a href="#Literal-1648"><span class="linenos">1648</span></a> <span class="nd">@property</span> +</span><span id="Literal-1649"><a href="#Literal-1649"><span class="linenos">1649</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="Literal-1650"><a href="#Literal-1650"><span class="linenos">1650</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> </span></pre></div> @@ -23017,9 +23029,9 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Literal.number"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Literal.number-1642"><a href="#Literal.number-1642"><span class="linenos">1642</span></a> <span class="nd">@classmethod</span> -</span><span id="Literal.number-1643"><a href="#Literal.number-1643"><span class="linenos">1643</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-1644"><a href="#Literal.number-1644"><span class="linenos">1644</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-1640"><a href="#Literal.number-1640"><span class="linenos">1640</span></a> <span class="nd">@classmethod</span> +</span><span id="Literal.number-1641"><a href="#Literal.number-1641"><span class="linenos">1641</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-1642"><a href="#Literal.number-1642"><span class="linenos">1642</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> @@ -23038,9 +23050,9 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Literal.string"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Literal.string-1646"><a href="#Literal.string-1646"><span class="linenos">1646</span></a> <span class="nd">@classmethod</span> -</span><span id="Literal.string-1647"><a href="#Literal.string-1647"><span class="linenos">1647</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-1648"><a href="#Literal.string-1648"><span class="linenos">1648</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-1644"><a href="#Literal.string-1644"><span class="linenos">1644</span></a> <span class="nd">@classmethod</span> +</span><span id="Literal.string-1645"><a href="#Literal.string-1645"><span class="linenos">1645</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-1646"><a href="#Literal.string-1646"><span class="linenos">1646</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> @@ -23169,124 +23181,124 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Join"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Join-1655"><a href="#Join-1655"><span class="linenos">1655</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-1656"><a href="#Join-1656"><span class="linenos">1656</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Join-1657"><a href="#Join-1657"><span class="linenos">1657</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Join-1658"><a href="#Join-1658"><span class="linenos">1658</span></a> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Join-1659"><a href="#Join-1659"><span class="linenos">1659</span></a> <span class="s2">"side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Join-1660"><a href="#Join-1660"><span class="linenos">1660</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Join-1661"><a href="#Join-1661"><span class="linenos">1661</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Join-1662"><a href="#Join-1662"><span class="linenos">1662</span></a> <span class="s2">"method"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Join-1663"><a href="#Join-1663"><span class="linenos">1663</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Join-1664"><a href="#Join-1664"><span class="linenos">1664</span></a> <span class="s2">"hint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Join-1665"><a href="#Join-1665"><span class="linenos">1665</span></a> <span class="p">}</span> -</span><span id="Join-1666"><a href="#Join-1666"><span class="linenos">1666</span></a> -</span><span id="Join-1667"><a href="#Join-1667"><span class="linenos">1667</span></a> <span class="nd">@property</span> -</span><span id="Join-1668"><a href="#Join-1668"><span class="linenos">1668</span></a> <span class="k">def</span> <span class="nf">method</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="Join-1669"><a href="#Join-1669"><span class="linenos">1669</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">"method"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="Join-1670"><a href="#Join-1670"><span class="linenos">1670</span></a> -</span><span id="Join-1671"><a href="#Join-1671"><span class="linenos">1671</span></a> <span class="nd">@property</span> -</span><span id="Join-1672"><a href="#Join-1672"><span class="linenos">1672</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Join-1673"><a href="#Join-1673"><span class="linenos">1673</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-1674"><a href="#Join-1674"><span class="linenos">1674</span></a> -</span><span id="Join-1675"><a href="#Join-1675"><span class="linenos">1675</span></a> <span class="nd">@property</span> -</span><span id="Join-1676"><a href="#Join-1676"><span class="linenos">1676</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Join-1677"><a href="#Join-1677"><span class="linenos">1677</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-1678"><a href="#Join-1678"><span class="linenos">1678</span></a> -</span><span id="Join-1679"><a href="#Join-1679"><span class="linenos">1679</span></a> <span class="nd">@property</span> -</span><span id="Join-1680"><a href="#Join-1680"><span class="linenos">1680</span></a> <span class="k">def</span> <span class="nf">hint</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="Join-1681"><a href="#Join-1681"><span class="linenos">1681</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">"hint"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="Join-1682"><a href="#Join-1682"><span class="linenos">1682</span></a> -</span><span id="Join-1683"><a href="#Join-1683"><span class="linenos">1683</span></a> <span class="nd">@property</span> -</span><span id="Join-1684"><a href="#Join-1684"><span class="linenos">1684</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Join-1685"><a href="#Join-1685"><span class="linenos">1685</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-1686"><a href="#Join-1686"><span class="linenos">1686</span></a> -</span><span id="Join-1687"><a href="#Join-1687"><span class="linenos">1687</span></a> <span class="k">def</span> <span class="nf">on</span><span class="p">(</span> -</span><span id="Join-1688"><a href="#Join-1688"><span class="linenos">1688</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Join-1689"><a href="#Join-1689"><span class="linenos">1689</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Join-1690"><a href="#Join-1690"><span class="linenos">1690</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="Join-1691"><a href="#Join-1691"><span class="linenos">1691</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="Join-1692"><a href="#Join-1692"><span class="linenos">1692</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="Join-1693"><a href="#Join-1693"><span class="linenos">1693</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Join-1694"><a href="#Join-1694"><span class="linenos">1694</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Join</span><span class="p">:</span> -</span><span id="Join-1695"><a href="#Join-1695"><span class="linenos">1695</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Join-1696"><a href="#Join-1696"><span class="linenos">1696</span></a><span class="sd"> Append to or set the ON expressions.</span> -</span><span id="Join-1697"><a href="#Join-1697"><span class="linenos">1697</span></a> -</span><span id="Join-1698"><a href="#Join-1698"><span class="linenos">1698</span></a><span class="sd"> Example:</span> -</span><span id="Join-1699"><a href="#Join-1699"><span class="linenos">1699</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Join-1700"><a href="#Join-1700"><span class="linenos">1700</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()</span> -</span><span id="Join-1701"><a href="#Join-1701"><span class="linenos">1701</span></a><span class="sd"> 'JOIN x ON y = 1'</span> -</span><span id="Join-1702"><a href="#Join-1702"><span class="linenos">1702</span></a> -</span><span id="Join-1703"><a href="#Join-1703"><span class="linenos">1703</span></a><span class="sd"> Args:</span> -</span><span id="Join-1704"><a href="#Join-1704"><span class="linenos">1704</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Join-1705"><a href="#Join-1705"><span class="linenos">1705</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Join-1706"><a href="#Join-1706"><span class="linenos">1706</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Join-1707"><a href="#Join-1707"><span class="linenos">1707</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Join-1708"><a href="#Join-1708"><span class="linenos">1708</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Join-1709"><a href="#Join-1709"><span class="linenos">1709</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Join-1710"><a href="#Join-1710"><span class="linenos">1710</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Join-1711"><a href="#Join-1711"><span class="linenos">1711</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Join-1712"><a href="#Join-1712"><span class="linenos">1712</span></a> -</span><span id="Join-1713"><a href="#Join-1713"><span class="linenos">1713</span></a><span class="sd"> Returns:</span> -</span><span id="Join-1714"><a href="#Join-1714"><span class="linenos">1714</span></a><span class="sd"> The modified Join expression.</span> -</span><span id="Join-1715"><a href="#Join-1715"><span class="linenos">1715</span></a><span class="sd"> """</span> -</span><span id="Join-1716"><a href="#Join-1716"><span class="linenos">1716</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-1717"><a href="#Join-1717"><span class="linenos">1717</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Join-1718"><a href="#Join-1718"><span class="linenos">1718</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Join-1719"><a href="#Join-1719"><span class="linenos">1719</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"on"</span><span class="p">,</span> -</span><span id="Join-1720"><a href="#Join-1720"><span class="linenos">1720</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Join-1721"><a href="#Join-1721"><span class="linenos">1721</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Join-1722"><a href="#Join-1722"><span class="linenos">1722</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Join-1723"><a href="#Join-1723"><span class="linenos">1723</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Join-1724"><a href="#Join-1724"><span class="linenos">1724</span></a> <span class="p">)</span> -</span><span id="Join-1725"><a href="#Join-1725"><span class="linenos">1725</span></a> -</span><span id="Join-1726"><a href="#Join-1726"><span class="linenos">1726</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-1727"><a href="#Join-1727"><span class="linenos">1727</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="Join-1653"><a href="#Join-1653"><span class="linenos">1653</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-1654"><a href="#Join-1654"><span class="linenos">1654</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Join-1655"><a href="#Join-1655"><span class="linenos">1655</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Join-1656"><a href="#Join-1656"><span class="linenos">1656</span></a> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Join-1657"><a href="#Join-1657"><span class="linenos">1657</span></a> <span class="s2">"side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Join-1658"><a href="#Join-1658"><span class="linenos">1658</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Join-1659"><a href="#Join-1659"><span class="linenos">1659</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Join-1660"><a href="#Join-1660"><span class="linenos">1660</span></a> <span class="s2">"method"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Join-1661"><a href="#Join-1661"><span class="linenos">1661</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Join-1662"><a href="#Join-1662"><span class="linenos">1662</span></a> <span class="s2">"hint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Join-1663"><a href="#Join-1663"><span class="linenos">1663</span></a> <span class="p">}</span> +</span><span id="Join-1664"><a href="#Join-1664"><span class="linenos">1664</span></a> +</span><span id="Join-1665"><a href="#Join-1665"><span class="linenos">1665</span></a> <span class="nd">@property</span> +</span><span id="Join-1666"><a href="#Join-1666"><span class="linenos">1666</span></a> <span class="k">def</span> <span class="nf">method</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="Join-1667"><a href="#Join-1667"><span class="linenos">1667</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">"method"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="Join-1668"><a href="#Join-1668"><span class="linenos">1668</span></a> +</span><span id="Join-1669"><a href="#Join-1669"><span class="linenos">1669</span></a> <span class="nd">@property</span> +</span><span id="Join-1670"><a href="#Join-1670"><span class="linenos">1670</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Join-1671"><a href="#Join-1671"><span class="linenos">1671</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-1672"><a href="#Join-1672"><span class="linenos">1672</span></a> +</span><span id="Join-1673"><a href="#Join-1673"><span class="linenos">1673</span></a> <span class="nd">@property</span> +</span><span id="Join-1674"><a href="#Join-1674"><span class="linenos">1674</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Join-1675"><a href="#Join-1675"><span class="linenos">1675</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-1676"><a href="#Join-1676"><span class="linenos">1676</span></a> +</span><span id="Join-1677"><a href="#Join-1677"><span class="linenos">1677</span></a> <span class="nd">@property</span> +</span><span id="Join-1678"><a href="#Join-1678"><span class="linenos">1678</span></a> <span class="k">def</span> <span class="nf">hint</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="Join-1679"><a href="#Join-1679"><span class="linenos">1679</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">"hint"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="Join-1680"><a href="#Join-1680"><span class="linenos">1680</span></a> +</span><span id="Join-1681"><a href="#Join-1681"><span class="linenos">1681</span></a> <span class="nd">@property</span> +</span><span id="Join-1682"><a href="#Join-1682"><span class="linenos">1682</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 class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Join-1683"><a href="#Join-1683"><span class="linenos">1683</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-1684"><a href="#Join-1684"><span class="linenos">1684</span></a> +</span><span id="Join-1685"><a href="#Join-1685"><span class="linenos">1685</span></a> <span class="k">def</span> <span class="nf">on</span><span class="p">(</span> +</span><span id="Join-1686"><a href="#Join-1686"><span class="linenos">1686</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Join-1687"><a href="#Join-1687"><span class="linenos">1687</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Join-1688"><a href="#Join-1688"><span class="linenos">1688</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="Join-1689"><a href="#Join-1689"><span class="linenos">1689</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="Join-1690"><a href="#Join-1690"><span class="linenos">1690</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="Join-1691"><a href="#Join-1691"><span class="linenos">1691</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Join-1692"><a href="#Join-1692"><span class="linenos">1692</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Join</span><span class="p">:</span> +</span><span id="Join-1693"><a href="#Join-1693"><span class="linenos">1693</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Join-1694"><a href="#Join-1694"><span class="linenos">1694</span></a><span class="sd"> Append to or set the ON expressions.</span> +</span><span id="Join-1695"><a href="#Join-1695"><span class="linenos">1695</span></a> +</span><span id="Join-1696"><a href="#Join-1696"><span class="linenos">1696</span></a><span class="sd"> Example:</span> +</span><span id="Join-1697"><a href="#Join-1697"><span class="linenos">1697</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Join-1698"><a href="#Join-1698"><span class="linenos">1698</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()</span> +</span><span id="Join-1699"><a href="#Join-1699"><span class="linenos">1699</span></a><span class="sd"> 'JOIN x ON y = 1'</span> +</span><span id="Join-1700"><a href="#Join-1700"><span class="linenos">1700</span></a> +</span><span id="Join-1701"><a href="#Join-1701"><span class="linenos">1701</span></a><span class="sd"> Args:</span> +</span><span id="Join-1702"><a href="#Join-1702"><span class="linenos">1702</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Join-1703"><a href="#Join-1703"><span class="linenos">1703</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Join-1704"><a href="#Join-1704"><span class="linenos">1704</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Join-1705"><a href="#Join-1705"><span class="linenos">1705</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Join-1706"><a href="#Join-1706"><span class="linenos">1706</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Join-1707"><a href="#Join-1707"><span class="linenos">1707</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Join-1708"><a href="#Join-1708"><span class="linenos">1708</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Join-1709"><a href="#Join-1709"><span class="linenos">1709</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Join-1710"><a href="#Join-1710"><span class="linenos">1710</span></a> +</span><span id="Join-1711"><a href="#Join-1711"><span class="linenos">1711</span></a><span class="sd"> Returns:</span> +</span><span id="Join-1712"><a href="#Join-1712"><span class="linenos">1712</span></a><span class="sd"> The modified Join expression.</span> +</span><span id="Join-1713"><a href="#Join-1713"><span class="linenos">1713</span></a><span class="sd"> """</span> +</span><span id="Join-1714"><a href="#Join-1714"><span class="linenos">1714</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-1715"><a href="#Join-1715"><span class="linenos">1715</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Join-1716"><a href="#Join-1716"><span class="linenos">1716</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Join-1717"><a href="#Join-1717"><span class="linenos">1717</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"on"</span><span class="p">,</span> +</span><span id="Join-1718"><a href="#Join-1718"><span class="linenos">1718</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Join-1719"><a href="#Join-1719"><span class="linenos">1719</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Join-1720"><a href="#Join-1720"><span class="linenos">1720</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Join-1721"><a href="#Join-1721"><span class="linenos">1721</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Join-1722"><a href="#Join-1722"><span class="linenos">1722</span></a> <span class="p">)</span> +</span><span id="Join-1723"><a href="#Join-1723"><span class="linenos">1723</span></a> +</span><span id="Join-1724"><a href="#Join-1724"><span class="linenos">1724</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-1725"><a href="#Join-1725"><span class="linenos">1725</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-1726"><a href="#Join-1726"><span class="linenos">1726</span></a> +</span><span id="Join-1727"><a href="#Join-1727"><span class="linenos">1727</span></a> <span class="k">return</span> <span class="n">join</span> </span><span id="Join-1728"><a href="#Join-1728"><span class="linenos">1728</span></a> -</span><span id="Join-1729"><a href="#Join-1729"><span class="linenos">1729</span></a> <span class="k">return</span> <span class="n">join</span> -</span><span id="Join-1730"><a href="#Join-1730"><span class="linenos">1730</span></a> -</span><span id="Join-1731"><a href="#Join-1731"><span class="linenos">1731</span></a> <span class="k">def</span> <span class="nf">using</span><span class="p">(</span> -</span><span id="Join-1732"><a href="#Join-1732"><span class="linenos">1732</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Join-1733"><a href="#Join-1733"><span class="linenos">1733</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Join-1734"><a href="#Join-1734"><span class="linenos">1734</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="Join-1735"><a href="#Join-1735"><span class="linenos">1735</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="Join-1736"><a href="#Join-1736"><span class="linenos">1736</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="Join-1737"><a href="#Join-1737"><span class="linenos">1737</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Join-1738"><a href="#Join-1738"><span class="linenos">1738</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Join</span><span class="p">:</span> -</span><span id="Join-1739"><a href="#Join-1739"><span class="linenos">1739</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Join-1740"><a href="#Join-1740"><span class="linenos">1740</span></a><span class="sd"> Append to or set the USING expressions.</span> -</span><span id="Join-1741"><a href="#Join-1741"><span class="linenos">1741</span></a> -</span><span id="Join-1742"><a href="#Join-1742"><span class="linenos">1742</span></a><span class="sd"> Example:</span> -</span><span id="Join-1743"><a href="#Join-1743"><span class="linenos">1743</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Join-1744"><a href="#Join-1744"><span class="linenos">1744</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()</span> -</span><span id="Join-1745"><a href="#Join-1745"><span class="linenos">1745</span></a><span class="sd"> 'JOIN x USING (foo, bla)'</span> -</span><span id="Join-1746"><a href="#Join-1746"><span class="linenos">1746</span></a> -</span><span id="Join-1747"><a href="#Join-1747"><span class="linenos">1747</span></a><span class="sd"> Args:</span> -</span><span id="Join-1748"><a href="#Join-1748"><span class="linenos">1748</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Join-1749"><a href="#Join-1749"><span class="linenos">1749</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Join-1750"><a href="#Join-1750"><span class="linenos">1750</span></a><span class="sd"> append: if `True`, concatenate the new expressions to the existing "using" list.</span> -</span><span id="Join-1751"><a href="#Join-1751"><span class="linenos">1751</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Join-1752"><a href="#Join-1752"><span class="linenos">1752</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Join-1753"><a href="#Join-1753"><span class="linenos">1753</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Join-1754"><a href="#Join-1754"><span class="linenos">1754</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Join-1755"><a href="#Join-1755"><span class="linenos">1755</span></a> -</span><span id="Join-1756"><a href="#Join-1756"><span class="linenos">1756</span></a><span class="sd"> Returns:</span> -</span><span id="Join-1757"><a href="#Join-1757"><span class="linenos">1757</span></a><span class="sd"> The modified Join expression.</span> -</span><span id="Join-1758"><a href="#Join-1758"><span class="linenos">1758</span></a><span class="sd"> """</span> -</span><span id="Join-1759"><a href="#Join-1759"><span class="linenos">1759</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-1760"><a href="#Join-1760"><span class="linenos">1760</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Join-1761"><a href="#Join-1761"><span class="linenos">1761</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Join-1762"><a href="#Join-1762"><span class="linenos">1762</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> -</span><span id="Join-1763"><a href="#Join-1763"><span class="linenos">1763</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Join-1764"><a href="#Join-1764"><span class="linenos">1764</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Join-1765"><a href="#Join-1765"><span class="linenos">1765</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Join-1766"><a href="#Join-1766"><span class="linenos">1766</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Join-1767"><a href="#Join-1767"><span class="linenos">1767</span></a> <span class="p">)</span> -</span><span id="Join-1768"><a href="#Join-1768"><span class="linenos">1768</span></a> -</span><span id="Join-1769"><a href="#Join-1769"><span class="linenos">1769</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-1770"><a href="#Join-1770"><span class="linenos">1770</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-1771"><a href="#Join-1771"><span class="linenos">1771</span></a> -</span><span id="Join-1772"><a href="#Join-1772"><span class="linenos">1772</span></a> <span class="k">return</span> <span class="n">join</span> +</span><span id="Join-1729"><a href="#Join-1729"><span class="linenos">1729</span></a> <span class="k">def</span> <span class="nf">using</span><span class="p">(</span> +</span><span id="Join-1730"><a href="#Join-1730"><span class="linenos">1730</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Join-1731"><a href="#Join-1731"><span class="linenos">1731</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Join-1732"><a href="#Join-1732"><span class="linenos">1732</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="Join-1733"><a href="#Join-1733"><span class="linenos">1733</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="Join-1734"><a href="#Join-1734"><span class="linenos">1734</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="Join-1735"><a href="#Join-1735"><span class="linenos">1735</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Join-1736"><a href="#Join-1736"><span class="linenos">1736</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Join</span><span class="p">:</span> +</span><span id="Join-1737"><a href="#Join-1737"><span class="linenos">1737</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Join-1738"><a href="#Join-1738"><span class="linenos">1738</span></a><span class="sd"> Append to or set the USING expressions.</span> +</span><span id="Join-1739"><a href="#Join-1739"><span class="linenos">1739</span></a> +</span><span id="Join-1740"><a href="#Join-1740"><span class="linenos">1740</span></a><span class="sd"> Example:</span> +</span><span id="Join-1741"><a href="#Join-1741"><span class="linenos">1741</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Join-1742"><a href="#Join-1742"><span class="linenos">1742</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()</span> +</span><span id="Join-1743"><a href="#Join-1743"><span class="linenos">1743</span></a><span class="sd"> 'JOIN x USING (foo, bla)'</span> +</span><span id="Join-1744"><a href="#Join-1744"><span class="linenos">1744</span></a> +</span><span id="Join-1745"><a href="#Join-1745"><span class="linenos">1745</span></a><span class="sd"> Args:</span> +</span><span id="Join-1746"><a href="#Join-1746"><span class="linenos">1746</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Join-1747"><a href="#Join-1747"><span class="linenos">1747</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Join-1748"><a href="#Join-1748"><span class="linenos">1748</span></a><span class="sd"> append: if `True`, concatenate the new expressions to the existing "using" list.</span> +</span><span id="Join-1749"><a href="#Join-1749"><span class="linenos">1749</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Join-1750"><a href="#Join-1750"><span class="linenos">1750</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Join-1751"><a href="#Join-1751"><span class="linenos">1751</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Join-1752"><a href="#Join-1752"><span class="linenos">1752</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Join-1753"><a href="#Join-1753"><span class="linenos">1753</span></a> +</span><span id="Join-1754"><a href="#Join-1754"><span class="linenos">1754</span></a><span class="sd"> Returns:</span> +</span><span id="Join-1755"><a href="#Join-1755"><span class="linenos">1755</span></a><span class="sd"> The modified Join expression.</span> +</span><span id="Join-1756"><a href="#Join-1756"><span class="linenos">1756</span></a><span class="sd"> """</span> +</span><span id="Join-1757"><a href="#Join-1757"><span class="linenos">1757</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-1758"><a href="#Join-1758"><span class="linenos">1758</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Join-1759"><a href="#Join-1759"><span class="linenos">1759</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Join-1760"><a href="#Join-1760"><span class="linenos">1760</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> +</span><span id="Join-1761"><a href="#Join-1761"><span class="linenos">1761</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Join-1762"><a href="#Join-1762"><span class="linenos">1762</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Join-1763"><a href="#Join-1763"><span class="linenos">1763</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Join-1764"><a href="#Join-1764"><span class="linenos">1764</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Join-1765"><a href="#Join-1765"><span class="linenos">1765</span></a> <span class="p">)</span> +</span><span id="Join-1766"><a href="#Join-1766"><span class="linenos">1766</span></a> +</span><span id="Join-1767"><a href="#Join-1767"><span class="linenos">1767</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-1768"><a href="#Join-1768"><span class="linenos">1768</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-1769"><a href="#Join-1769"><span class="linenos">1769</span></a> +</span><span id="Join-1770"><a href="#Join-1770"><span class="linenos">1770</span></a> <span class="k">return</span> <span class="n">join</span> </span></pre></div> @@ -23371,49 +23383,49 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Join.on"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Join.on-1687"><a href="#Join.on-1687"><span class="linenos">1687</span></a> <span class="k">def</span> <span class="nf">on</span><span class="p">(</span> -</span><span id="Join.on-1688"><a href="#Join.on-1688"><span class="linenos">1688</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Join.on-1689"><a href="#Join.on-1689"><span class="linenos">1689</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Join.on-1690"><a href="#Join.on-1690"><span class="linenos">1690</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="Join.on-1691"><a href="#Join.on-1691"><span class="linenos">1691</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="Join.on-1692"><a href="#Join.on-1692"><span class="linenos">1692</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="Join.on-1693"><a href="#Join.on-1693"><span class="linenos">1693</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Join.on-1694"><a href="#Join.on-1694"><span class="linenos">1694</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Join</span><span class="p">:</span> -</span><span id="Join.on-1695"><a href="#Join.on-1695"><span class="linenos">1695</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Join.on-1696"><a href="#Join.on-1696"><span class="linenos">1696</span></a><span class="sd"> Append to or set the ON expressions.</span> -</span><span id="Join.on-1697"><a href="#Join.on-1697"><span class="linenos">1697</span></a> -</span><span id="Join.on-1698"><a href="#Join.on-1698"><span class="linenos">1698</span></a><span class="sd"> Example:</span> -</span><span id="Join.on-1699"><a href="#Join.on-1699"><span class="linenos">1699</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Join.on-1700"><a href="#Join.on-1700"><span class="linenos">1700</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()</span> -</span><span id="Join.on-1701"><a href="#Join.on-1701"><span class="linenos">1701</span></a><span class="sd"> 'JOIN x ON y = 1'</span> -</span><span id="Join.on-1702"><a href="#Join.on-1702"><span class="linenos">1702</span></a> -</span><span id="Join.on-1703"><a href="#Join.on-1703"><span class="linenos">1703</span></a><span class="sd"> Args:</span> -</span><span id="Join.on-1704"><a href="#Join.on-1704"><span class="linenos">1704</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Join.on-1705"><a href="#Join.on-1705"><span class="linenos">1705</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Join.on-1706"><a href="#Join.on-1706"><span class="linenos">1706</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Join.on-1707"><a href="#Join.on-1707"><span class="linenos">1707</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Join.on-1708"><a href="#Join.on-1708"><span class="linenos">1708</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Join.on-1709"><a href="#Join.on-1709"><span class="linenos">1709</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Join.on-1710"><a href="#Join.on-1710"><span class="linenos">1710</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Join.on-1711"><a href="#Join.on-1711"><span class="linenos">1711</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Join.on-1712"><a href="#Join.on-1712"><span class="linenos">1712</span></a> -</span><span id="Join.on-1713"><a href="#Join.on-1713"><span class="linenos">1713</span></a><span class="sd"> Returns:</span> -</span><span id="Join.on-1714"><a href="#Join.on-1714"><span class="linenos">1714</span></a><span class="sd"> The modified Join expression.</span> -</span><span id="Join.on-1715"><a href="#Join.on-1715"><span class="linenos">1715</span></a><span class="sd"> """</span> -</span><span id="Join.on-1716"><a href="#Join.on-1716"><span class="linenos">1716</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-1717"><a href="#Join.on-1717"><span class="linenos">1717</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Join.on-1718"><a href="#Join.on-1718"><span class="linenos">1718</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-1719"><a href="#Join.on-1719"><span class="linenos">1719</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-1720"><a href="#Join.on-1720"><span class="linenos">1720</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-1721"><a href="#Join.on-1721"><span class="linenos">1721</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-1722"><a href="#Join.on-1722"><span class="linenos">1722</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-1723"><a href="#Join.on-1723"><span class="linenos">1723</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Join.on-1724"><a href="#Join.on-1724"><span class="linenos">1724</span></a> <span class="p">)</span> -</span><span id="Join.on-1725"><a href="#Join.on-1725"><span class="linenos">1725</span></a> -</span><span id="Join.on-1726"><a href="#Join.on-1726"><span class="linenos">1726</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-1727"><a href="#Join.on-1727"><span class="linenos">1727</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-1728"><a href="#Join.on-1728"><span class="linenos">1728</span></a> -</span><span id="Join.on-1729"><a href="#Join.on-1729"><span class="linenos">1729</span></a> <span class="k">return</span> <span class="n">join</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Join.on-1685"><a href="#Join.on-1685"><span class="linenos">1685</span></a> <span class="k">def</span> <span class="nf">on</span><span class="p">(</span> +</span><span id="Join.on-1686"><a href="#Join.on-1686"><span class="linenos">1686</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Join.on-1687"><a href="#Join.on-1687"><span class="linenos">1687</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Join.on-1688"><a href="#Join.on-1688"><span class="linenos">1688</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="Join.on-1689"><a href="#Join.on-1689"><span class="linenos">1689</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="Join.on-1690"><a href="#Join.on-1690"><span class="linenos">1690</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="Join.on-1691"><a href="#Join.on-1691"><span class="linenos">1691</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Join.on-1692"><a href="#Join.on-1692"><span class="linenos">1692</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Join</span><span class="p">:</span> +</span><span id="Join.on-1693"><a href="#Join.on-1693"><span class="linenos">1693</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Join.on-1694"><a href="#Join.on-1694"><span class="linenos">1694</span></a><span class="sd"> Append to or set the ON expressions.</span> +</span><span id="Join.on-1695"><a href="#Join.on-1695"><span class="linenos">1695</span></a> +</span><span id="Join.on-1696"><a href="#Join.on-1696"><span class="linenos">1696</span></a><span class="sd"> Example:</span> +</span><span id="Join.on-1697"><a href="#Join.on-1697"><span class="linenos">1697</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Join.on-1698"><a href="#Join.on-1698"><span class="linenos">1698</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()</span> +</span><span id="Join.on-1699"><a href="#Join.on-1699"><span class="linenos">1699</span></a><span class="sd"> 'JOIN x ON y = 1'</span> +</span><span id="Join.on-1700"><a href="#Join.on-1700"><span class="linenos">1700</span></a> +</span><span id="Join.on-1701"><a href="#Join.on-1701"><span class="linenos">1701</span></a><span class="sd"> Args:</span> +</span><span id="Join.on-1702"><a href="#Join.on-1702"><span class="linenos">1702</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Join.on-1703"><a href="#Join.on-1703"><span class="linenos">1703</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Join.on-1704"><a href="#Join.on-1704"><span class="linenos">1704</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Join.on-1705"><a href="#Join.on-1705"><span class="linenos">1705</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Join.on-1706"><a href="#Join.on-1706"><span class="linenos">1706</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Join.on-1707"><a href="#Join.on-1707"><span class="linenos">1707</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Join.on-1708"><a href="#Join.on-1708"><span class="linenos">1708</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Join.on-1709"><a href="#Join.on-1709"><span class="linenos">1709</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Join.on-1710"><a href="#Join.on-1710"><span class="linenos">1710</span></a> +</span><span id="Join.on-1711"><a href="#Join.on-1711"><span class="linenos">1711</span></a><span class="sd"> Returns:</span> +</span><span id="Join.on-1712"><a href="#Join.on-1712"><span class="linenos">1712</span></a><span class="sd"> The modified Join expression.</span> +</span><span id="Join.on-1713"><a href="#Join.on-1713"><span class="linenos">1713</span></a><span class="sd"> """</span> +</span><span id="Join.on-1714"><a href="#Join.on-1714"><span class="linenos">1714</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-1715"><a href="#Join.on-1715"><span class="linenos">1715</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Join.on-1716"><a href="#Join.on-1716"><span class="linenos">1716</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-1717"><a href="#Join.on-1717"><span class="linenos">1717</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-1718"><a href="#Join.on-1718"><span class="linenos">1718</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-1719"><a href="#Join.on-1719"><span class="linenos">1719</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-1720"><a href="#Join.on-1720"><span class="linenos">1720</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-1721"><a href="#Join.on-1721"><span class="linenos">1721</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Join.on-1722"><a href="#Join.on-1722"><span class="linenos">1722</span></a> <span class="p">)</span> +</span><span id="Join.on-1723"><a href="#Join.on-1723"><span class="linenos">1723</span></a> +</span><span id="Join.on-1724"><a href="#Join.on-1724"><span class="linenos">1724</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-1725"><a href="#Join.on-1725"><span class="linenos">1725</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-1726"><a href="#Join.on-1726"><span class="linenos">1726</span></a> +</span><span id="Join.on-1727"><a href="#Join.on-1727"><span class="linenos">1727</span></a> <span class="k">return</span> <span class="n">join</span> </span></pre></div> @@ -23463,48 +23475,48 @@ 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-1731"><a href="#Join.using-1731"><span class="linenos">1731</span></a> <span class="k">def</span> <span class="nf">using</span><span class="p">(</span> -</span><span id="Join.using-1732"><a href="#Join.using-1732"><span class="linenos">1732</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Join.using-1733"><a href="#Join.using-1733"><span class="linenos">1733</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Join.using-1734"><a href="#Join.using-1734"><span class="linenos">1734</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="Join.using-1735"><a href="#Join.using-1735"><span class="linenos">1735</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="Join.using-1736"><a href="#Join.using-1736"><span class="linenos">1736</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="Join.using-1737"><a href="#Join.using-1737"><span class="linenos">1737</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Join.using-1738"><a href="#Join.using-1738"><span class="linenos">1738</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Join</span><span class="p">:</span> -</span><span id="Join.using-1739"><a href="#Join.using-1739"><span class="linenos">1739</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Join.using-1740"><a href="#Join.using-1740"><span class="linenos">1740</span></a><span class="sd"> Append to or set the USING expressions.</span> -</span><span id="Join.using-1741"><a href="#Join.using-1741"><span class="linenos">1741</span></a> -</span><span id="Join.using-1742"><a href="#Join.using-1742"><span class="linenos">1742</span></a><span class="sd"> Example:</span> -</span><span id="Join.using-1743"><a href="#Join.using-1743"><span class="linenos">1743</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Join.using-1744"><a href="#Join.using-1744"><span class="linenos">1744</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()</span> -</span><span id="Join.using-1745"><a href="#Join.using-1745"><span class="linenos">1745</span></a><span class="sd"> 'JOIN x USING (foo, bla)'</span> -</span><span id="Join.using-1746"><a href="#Join.using-1746"><span class="linenos">1746</span></a> -</span><span id="Join.using-1747"><a href="#Join.using-1747"><span class="linenos">1747</span></a><span class="sd"> Args:</span> -</span><span id="Join.using-1748"><a href="#Join.using-1748"><span class="linenos">1748</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Join.using-1749"><a href="#Join.using-1749"><span class="linenos">1749</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Join.using-1750"><a href="#Join.using-1750"><span class="linenos">1750</span></a><span class="sd"> append: if `True`, concatenate the new expressions to the existing "using" list.</span> -</span><span id="Join.using-1751"><a href="#Join.using-1751"><span class="linenos">1751</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Join.using-1752"><a href="#Join.using-1752"><span class="linenos">1752</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Join.using-1753"><a href="#Join.using-1753"><span class="linenos">1753</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Join.using-1754"><a href="#Join.using-1754"><span class="linenos">1754</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Join.using-1755"><a href="#Join.using-1755"><span class="linenos">1755</span></a> -</span><span id="Join.using-1756"><a href="#Join.using-1756"><span class="linenos">1756</span></a><span class="sd"> Returns:</span> -</span><span id="Join.using-1757"><a href="#Join.using-1757"><span class="linenos">1757</span></a><span class="sd"> The modified Join expression.</span> -</span><span id="Join.using-1758"><a href="#Join.using-1758"><span class="linenos">1758</span></a><span class="sd"> """</span> -</span><span id="Join.using-1759"><a href="#Join.using-1759"><span class="linenos">1759</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-1760"><a href="#Join.using-1760"><span class="linenos">1760</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Join.using-1761"><a href="#Join.using-1761"><span class="linenos">1761</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-1762"><a href="#Join.using-1762"><span class="linenos">1762</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-1763"><a href="#Join.using-1763"><span class="linenos">1763</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-1764"><a href="#Join.using-1764"><span class="linenos">1764</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-1765"><a href="#Join.using-1765"><span class="linenos">1765</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-1766"><a href="#Join.using-1766"><span class="linenos">1766</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Join.using-1767"><a href="#Join.using-1767"><span class="linenos">1767</span></a> <span class="p">)</span> -</span><span id="Join.using-1768"><a href="#Join.using-1768"><span class="linenos">1768</span></a> -</span><span id="Join.using-1769"><a href="#Join.using-1769"><span class="linenos">1769</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-1770"><a href="#Join.using-1770"><span class="linenos">1770</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-1771"><a href="#Join.using-1771"><span class="linenos">1771</span></a> -</span><span id="Join.using-1772"><a href="#Join.using-1772"><span class="linenos">1772</span></a> <span class="k">return</span> <span class="n">join</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Join.using-1729"><a href="#Join.using-1729"><span class="linenos">1729</span></a> <span class="k">def</span> <span class="nf">using</span><span class="p">(</span> +</span><span id="Join.using-1730"><a href="#Join.using-1730"><span class="linenos">1730</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Join.using-1731"><a href="#Join.using-1731"><span class="linenos">1731</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Join.using-1732"><a href="#Join.using-1732"><span class="linenos">1732</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="Join.using-1733"><a href="#Join.using-1733"><span class="linenos">1733</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="Join.using-1734"><a href="#Join.using-1734"><span class="linenos">1734</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="Join.using-1735"><a href="#Join.using-1735"><span class="linenos">1735</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Join.using-1736"><a href="#Join.using-1736"><span class="linenos">1736</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Join</span><span class="p">:</span> +</span><span id="Join.using-1737"><a href="#Join.using-1737"><span class="linenos">1737</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Join.using-1738"><a href="#Join.using-1738"><span class="linenos">1738</span></a><span class="sd"> Append to or set the USING expressions.</span> +</span><span id="Join.using-1739"><a href="#Join.using-1739"><span class="linenos">1739</span></a> +</span><span id="Join.using-1740"><a href="#Join.using-1740"><span class="linenos">1740</span></a><span class="sd"> Example:</span> +</span><span id="Join.using-1741"><a href="#Join.using-1741"><span class="linenos">1741</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Join.using-1742"><a href="#Join.using-1742"><span class="linenos">1742</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()</span> +</span><span id="Join.using-1743"><a href="#Join.using-1743"><span class="linenos">1743</span></a><span class="sd"> 'JOIN x USING (foo, bla)'</span> +</span><span id="Join.using-1744"><a href="#Join.using-1744"><span class="linenos">1744</span></a> +</span><span id="Join.using-1745"><a href="#Join.using-1745"><span class="linenos">1745</span></a><span class="sd"> Args:</span> +</span><span id="Join.using-1746"><a href="#Join.using-1746"><span class="linenos">1746</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Join.using-1747"><a href="#Join.using-1747"><span class="linenos">1747</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Join.using-1748"><a href="#Join.using-1748"><span class="linenos">1748</span></a><span class="sd"> append: if `True`, concatenate the new expressions to the existing "using" list.</span> +</span><span id="Join.using-1749"><a href="#Join.using-1749"><span class="linenos">1749</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Join.using-1750"><a href="#Join.using-1750"><span class="linenos">1750</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Join.using-1751"><a href="#Join.using-1751"><span class="linenos">1751</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Join.using-1752"><a href="#Join.using-1752"><span class="linenos">1752</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Join.using-1753"><a href="#Join.using-1753"><span class="linenos">1753</span></a> +</span><span id="Join.using-1754"><a href="#Join.using-1754"><span class="linenos">1754</span></a><span class="sd"> Returns:</span> +</span><span id="Join.using-1755"><a href="#Join.using-1755"><span class="linenos">1755</span></a><span class="sd"> The modified Join expression.</span> +</span><span id="Join.using-1756"><a href="#Join.using-1756"><span class="linenos">1756</span></a><span class="sd"> """</span> +</span><span id="Join.using-1757"><a href="#Join.using-1757"><span class="linenos">1757</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-1758"><a href="#Join.using-1758"><span class="linenos">1758</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Join.using-1759"><a href="#Join.using-1759"><span class="linenos">1759</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-1760"><a href="#Join.using-1760"><span class="linenos">1760</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-1761"><a href="#Join.using-1761"><span class="linenos">1761</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-1762"><a href="#Join.using-1762"><span class="linenos">1762</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-1763"><a href="#Join.using-1763"><span class="linenos">1763</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-1764"><a href="#Join.using-1764"><span class="linenos">1764</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Join.using-1765"><a href="#Join.using-1765"><span class="linenos">1765</span></a> <span class="p">)</span> +</span><span id="Join.using-1766"><a href="#Join.using-1766"><span class="linenos">1766</span></a> +</span><span id="Join.using-1767"><a href="#Join.using-1767"><span class="linenos">1767</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-1768"><a href="#Join.using-1768"><span class="linenos">1768</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-1769"><a href="#Join.using-1769"><span class="linenos">1769</span></a> +</span><span id="Join.using-1770"><a href="#Join.using-1770"><span class="linenos">1770</span></a> <span class="k">return</span> <span class="n">join</span> </span></pre></div> @@ -23620,8 +23632,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-1775"><a href="#Lateral-1775"><span class="linenos">1775</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-1776"><a href="#Lateral-1776"><span class="linenos">1776</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1773"><a href="#Lateral-1773"><span class="linenos">1773</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-1774"><a href="#Lateral-1774"><span class="linenos">1774</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -23733,17 +23745,17 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#MatchRecognize"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="MatchRecognize-1779"><a href="#MatchRecognize-1779"><span class="linenos">1779</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-1780"><a href="#MatchRecognize-1780"><span class="linenos">1780</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="MatchRecognize-1781"><a href="#MatchRecognize-1781"><span class="linenos">1781</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-1782"><a href="#MatchRecognize-1782"><span class="linenos">1782</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1783"><a href="#MatchRecognize-1783"><span class="linenos">1783</span></a> <span class="s2">"measures"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1784"><a href="#MatchRecognize-1784"><span class="linenos">1784</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1785"><a href="#MatchRecognize-1785"><span class="linenos">1785</span></a> <span class="s2">"after"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1786"><a href="#MatchRecognize-1786"><span class="linenos">1786</span></a> <span class="s2">"pattern"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1787"><a href="#MatchRecognize-1787"><span class="linenos">1787</span></a> <span class="s2">"define"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1788"><a href="#MatchRecognize-1788"><span class="linenos">1788</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1789"><a href="#MatchRecognize-1789"><span class="linenos">1789</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="MatchRecognize-1777"><a href="#MatchRecognize-1777"><span class="linenos">1777</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-1778"><a href="#MatchRecognize-1778"><span class="linenos">1778</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="MatchRecognize-1779"><a href="#MatchRecognize-1779"><span class="linenos">1779</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-1780"><a href="#MatchRecognize-1780"><span class="linenos">1780</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1781"><a href="#MatchRecognize-1781"><span class="linenos">1781</span></a> <span class="s2">"measures"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1782"><a href="#MatchRecognize-1782"><span class="linenos">1782</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1783"><a href="#MatchRecognize-1783"><span class="linenos">1783</span></a> <span class="s2">"after"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1784"><a href="#MatchRecognize-1784"><span class="linenos">1784</span></a> <span class="s2">"pattern"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1785"><a href="#MatchRecognize-1785"><span class="linenos">1785</span></a> <span class="s2">"define"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1786"><a href="#MatchRecognize-1786"><span class="linenos">1786</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1787"><a href="#MatchRecognize-1787"><span class="linenos">1787</span></a> <span class="p">}</span> </span></pre></div> @@ -23841,8 +23853,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-1794"><a href="#Final-1794"><span class="linenos">1794</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-1795"><a href="#Final-1795"><span class="linenos">1795</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Final-1792"><a href="#Final-1792"><span class="linenos">1792</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-1793"><a href="#Final-1793"><span class="linenos">1793</span></a> <span class="k">pass</span> </span></pre></div> @@ -23928,8 +23940,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-1798"><a href="#Offset-1798"><span class="linenos">1798</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-1799"><a href="#Offset-1799"><span class="linenos">1799</span></a> <span class="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-1796"><a href="#Offset-1796"><span class="linenos">1796</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-1797"><a href="#Offset-1797"><span class="linenos">1797</span></a> <span class="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> @@ -24026,8 +24038,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-1802"><a href="#Order-1802"><span class="linenos">1802</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-1803"><a href="#Order-1803"><span class="linenos">1803</span></a> <span class="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-1800"><a href="#Order-1800"><span class="linenos">1800</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-1801"><a href="#Order-1801"><span class="linenos">1801</span></a> <span class="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> @@ -24124,8 +24136,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-1808"><a href="#Cluster-1808"><span class="linenos">1808</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-1809"><a href="#Cluster-1809"><span class="linenos">1809</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Cluster-1806"><a href="#Cluster-1806"><span class="linenos">1806</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-1807"><a href="#Cluster-1807"><span class="linenos">1807</span></a> <span class="k">pass</span> </span></pre></div> @@ -24214,8 +24226,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-1812"><a href="#Distribute-1812"><span class="linenos">1812</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-1813"><a href="#Distribute-1813"><span class="linenos">1813</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Distribute-1810"><a href="#Distribute-1810"><span class="linenos">1810</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-1811"><a href="#Distribute-1811"><span class="linenos">1811</span></a> <span class="k">pass</span> </span></pre></div> @@ -24304,8 +24316,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-1816"><a href="#Sort-1816"><span class="linenos">1816</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-1817"><a href="#Sort-1817"><span class="linenos">1817</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Sort-1814"><a href="#Sort-1814"><span class="linenos">1814</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-1815"><a href="#Sort-1815"><span class="linenos">1815</span></a> <span class="k">pass</span> </span></pre></div> @@ -24394,8 +24406,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-1820"><a href="#Ordered-1820"><span class="linenos">1820</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-1821"><a href="#Ordered-1821"><span class="linenos">1821</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1818"><a href="#Ordered-1818"><span class="linenos">1818</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-1819"><a href="#Ordered-1819"><span class="linenos">1819</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -24492,8 +24504,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-1824"><a href="#Property-1824"><span class="linenos">1824</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-1825"><a href="#Property-1825"><span class="linenos">1825</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1822"><a href="#Property-1822"><span class="linenos">1822</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-1823"><a href="#Property-1823"><span class="linenos">1823</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -24590,8 +24602,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-1828"><a href="#AlgorithmProperty-1828"><span class="linenos">1828</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-1829"><a href="#AlgorithmProperty-1829"><span class="linenos">1829</span></a> <span class="n">arg_types</span> <span class="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-1826"><a href="#AlgorithmProperty-1826"><span class="linenos">1826</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-1827"><a href="#AlgorithmProperty-1827"><span class="linenos">1827</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -24688,8 +24700,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#AutoIncrementProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AutoIncrementProperty-1832"><a href="#AutoIncrementProperty-1832"><span class="linenos">1832</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-1833"><a href="#AutoIncrementProperty-1833"><span class="linenos">1833</span></a> <span class="n">arg_types</span> <span class="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="AutoIncrementProperty-1830"><a href="#AutoIncrementProperty-1830"><span class="linenos">1830</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-1831"><a href="#AutoIncrementProperty-1831"><span class="linenos">1831</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -24786,8 +24798,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#BlockCompressionProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BlockCompressionProperty-1836"><a href="#BlockCompressionProperty-1836"><span class="linenos">1836</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-1837"><a href="#BlockCompressionProperty-1837"><span class="linenos">1837</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="BlockCompressionProperty-1834"><a href="#BlockCompressionProperty-1834"><span class="linenos">1834</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-1835"><a href="#BlockCompressionProperty-1835"><span class="linenos">1835</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> @@ -24884,8 +24896,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#CharacterSetProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CharacterSetProperty-1840"><a href="#CharacterSetProperty-1840"><span class="linenos">1840</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-1841"><a href="#CharacterSetProperty-1841"><span class="linenos">1841</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> + <div class="pdoc-code codehilite"><pre><span></span><span id="CharacterSetProperty-1838"><a href="#CharacterSetProperty-1838"><span class="linenos">1838</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-1839"><a href="#CharacterSetProperty-1839"><span class="linenos">1839</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -24982,8 +24994,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#ChecksumProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ChecksumProperty-1844"><a href="#ChecksumProperty-1844"><span class="linenos">1844</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-1845"><a href="#ChecksumProperty-1845"><span class="linenos">1845</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="ChecksumProperty-1842"><a href="#ChecksumProperty-1842"><span class="linenos">1842</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-1843"><a href="#ChecksumProperty-1843"><span class="linenos">1843</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> @@ -25080,8 +25092,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#CollateProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CollateProperty-1848"><a href="#CollateProperty-1848"><span class="linenos">1848</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-1849"><a href="#CollateProperty-1849"><span class="linenos">1849</span></a> <span class="n">arg_types</span> <span class="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="CollateProperty-1846"><a href="#CollateProperty-1846"><span class="linenos">1846</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-1847"><a href="#CollateProperty-1847"><span class="linenos">1847</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -25178,8 +25190,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#CopyGrantsProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CopyGrantsProperty-1852"><a href="#CopyGrantsProperty-1852"><span class="linenos">1852</span></a><span class="k">class</span> <span class="nc">CopyGrantsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="CopyGrantsProperty-1853"><a href="#CopyGrantsProperty-1853"><span class="linenos">1853</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CopyGrantsProperty-1850"><a href="#CopyGrantsProperty-1850"><span class="linenos">1850</span></a><span class="k">class</span> <span class="nc">CopyGrantsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="CopyGrantsProperty-1851"><a href="#CopyGrantsProperty-1851"><span class="linenos">1851</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{}</span> </span></pre></div> @@ -25276,14 +25288,14 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#DataBlocksizeProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DataBlocksizeProperty-1856"><a href="#DataBlocksizeProperty-1856"><span class="linenos">1856</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-1857"><a href="#DataBlocksizeProperty-1857"><span class="linenos">1857</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="DataBlocksizeProperty-1858"><a href="#DataBlocksizeProperty-1858"><span class="linenos">1858</span></a> <span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataBlocksizeProperty-1859"><a href="#DataBlocksizeProperty-1859"><span class="linenos">1859</span></a> <span class="s2">"units"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataBlocksizeProperty-1860"><a href="#DataBlocksizeProperty-1860"><span class="linenos">1860</span></a> <span class="s2">"minimum"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataBlocksizeProperty-1861"><a href="#DataBlocksizeProperty-1861"><span class="linenos">1861</span></a> <span class="s2">"maximum"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataBlocksizeProperty-1862"><a href="#DataBlocksizeProperty-1862"><span class="linenos">1862</span></a> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataBlocksizeProperty-1863"><a href="#DataBlocksizeProperty-1863"><span class="linenos">1863</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DataBlocksizeProperty-1854"><a href="#DataBlocksizeProperty-1854"><span class="linenos">1854</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-1855"><a href="#DataBlocksizeProperty-1855"><span class="linenos">1855</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="DataBlocksizeProperty-1856"><a href="#DataBlocksizeProperty-1856"><span class="linenos">1856</span></a> <span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataBlocksizeProperty-1857"><a href="#DataBlocksizeProperty-1857"><span class="linenos">1857</span></a> <span class="s2">"units"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataBlocksizeProperty-1858"><a href="#DataBlocksizeProperty-1858"><span class="linenos">1858</span></a> <span class="s2">"minimum"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataBlocksizeProperty-1859"><a href="#DataBlocksizeProperty-1859"><span class="linenos">1859</span></a> <span class="s2">"maximum"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataBlocksizeProperty-1860"><a href="#DataBlocksizeProperty-1860"><span class="linenos">1860</span></a> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataBlocksizeProperty-1861"><a href="#DataBlocksizeProperty-1861"><span class="linenos">1861</span></a> <span class="p">}</span> </span></pre></div> @@ -25380,8 +25392,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-1866"><a href="#DefinerProperty-1866"><span class="linenos">1866</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-1867"><a href="#DefinerProperty-1867"><span class="linenos">1867</span></a> <span class="n">arg_types</span> <span class="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-1864"><a href="#DefinerProperty-1864"><span class="linenos">1864</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-1865"><a href="#DefinerProperty-1865"><span class="linenos">1865</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -25478,8 +25490,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#DistKeyProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DistKeyProperty-1870"><a href="#DistKeyProperty-1870"><span class="linenos">1870</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-1871"><a href="#DistKeyProperty-1871"><span class="linenos">1871</span></a> <span class="n">arg_types</span> <span class="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="DistKeyProperty-1868"><a href="#DistKeyProperty-1868"><span class="linenos">1868</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-1869"><a href="#DistKeyProperty-1869"><span class="linenos">1869</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -25576,8 +25588,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#DistStyleProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DistStyleProperty-1874"><a href="#DistStyleProperty-1874"><span class="linenos">1874</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-1875"><a href="#DistStyleProperty-1875"><span class="linenos">1875</span></a> <span class="n">arg_types</span> <span class="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="DistStyleProperty-1872"><a href="#DistStyleProperty-1872"><span class="linenos">1872</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-1873"><a href="#DistStyleProperty-1873"><span class="linenos">1873</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -25674,8 +25686,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#EngineProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="EngineProperty-1878"><a href="#EngineProperty-1878"><span class="linenos">1878</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-1879"><a href="#EngineProperty-1879"><span class="linenos">1879</span></a> <span class="n">arg_types</span> <span class="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="EngineProperty-1876"><a href="#EngineProperty-1876"><span class="linenos">1876</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-1877"><a href="#EngineProperty-1877"><span class="linenos">1877</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -25772,8 +25784,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#ToTableProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ToTableProperty-1882"><a href="#ToTableProperty-1882"><span class="linenos">1882</span></a><span class="k">class</span> <span class="nc">ToTableProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="ToTableProperty-1883"><a href="#ToTableProperty-1883"><span class="linenos">1883</span></a> <span class="n">arg_types</span> <span class="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="ToTableProperty-1880"><a href="#ToTableProperty-1880"><span class="linenos">1880</span></a><span class="k">class</span> <span class="nc">ToTableProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="ToTableProperty-1881"><a href="#ToTableProperty-1881"><span class="linenos">1881</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -25870,8 +25882,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#ExecuteAsProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ExecuteAsProperty-1886"><a href="#ExecuteAsProperty-1886"><span class="linenos">1886</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-1887"><a href="#ExecuteAsProperty-1887"><span class="linenos">1887</span></a> <span class="n">arg_types</span> <span class="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="ExecuteAsProperty-1884"><a href="#ExecuteAsProperty-1884"><span class="linenos">1884</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-1885"><a href="#ExecuteAsProperty-1885"><span class="linenos">1885</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -25968,8 +25980,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#ExternalProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ExternalProperty-1890"><a href="#ExternalProperty-1890"><span class="linenos">1890</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-1891"><a href="#ExternalProperty-1891"><span class="linenos">1891</span></a> <span class="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="ExternalProperty-1888"><a href="#ExternalProperty-1888"><span class="linenos">1888</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-1889"><a href="#ExternalProperty-1889"><span class="linenos">1889</span></a> <span class="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> @@ -26066,8 +26078,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#FallbackProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="FallbackProperty-1894"><a href="#FallbackProperty-1894"><span class="linenos">1894</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-1895"><a href="#FallbackProperty-1895"><span class="linenos">1895</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="FallbackProperty-1892"><a href="#FallbackProperty-1892"><span class="linenos">1892</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-1893"><a href="#FallbackProperty-1893"><span class="linenos">1893</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> @@ -26164,8 +26176,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-1898"><a href="#FileFormatProperty-1898"><span class="linenos">1898</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-1899"><a href="#FileFormatProperty-1899"><span class="linenos">1899</span></a> <span class="n">arg_types</span> <span class="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-1896"><a href="#FileFormatProperty-1896"><span class="linenos">1896</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-1897"><a href="#FileFormatProperty-1897"><span class="linenos">1897</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -26262,8 +26274,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#FreespaceProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="FreespaceProperty-1902"><a href="#FreespaceProperty-1902"><span class="linenos">1902</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-1903"><a href="#FreespaceProperty-1903"><span class="linenos">1903</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> + <div class="pdoc-code codehilite"><pre><span></span><span id="FreespaceProperty-1900"><a href="#FreespaceProperty-1900"><span class="linenos">1900</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-1901"><a href="#FreespaceProperty-1901"><span class="linenos">1901</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -26360,8 +26372,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#InputOutputFormat"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="InputOutputFormat-1906"><a href="#InputOutputFormat-1906"><span class="linenos">1906</span></a><span class="k">class</span> <span class="nc">InputOutputFormat</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="InputOutputFormat-1907"><a href="#InputOutputFormat-1907"><span class="linenos">1907</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"input_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"output_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="InputOutputFormat-1904"><a href="#InputOutputFormat-1904"><span class="linenos">1904</span></a><span class="k">class</span> <span class="nc">InputOutputFormat</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="InputOutputFormat-1905"><a href="#InputOutputFormat-1905"><span class="linenos">1905</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"input_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"output_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -26458,14 +26470,14 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#IsolatedLoadingProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="IsolatedLoadingProperty-1910"><a href="#IsolatedLoadingProperty-1910"><span class="linenos">1910</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-1911"><a href="#IsolatedLoadingProperty-1911"><span class="linenos">1911</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="IsolatedLoadingProperty-1912"><a href="#IsolatedLoadingProperty-1912"><span class="linenos">1912</span></a> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="IsolatedLoadingProperty-1913"><a href="#IsolatedLoadingProperty-1913"><span class="linenos">1913</span></a> <span class="s2">"concurrent"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="IsolatedLoadingProperty-1914"><a href="#IsolatedLoadingProperty-1914"><span class="linenos">1914</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-1915"><a href="#IsolatedLoadingProperty-1915"><span class="linenos">1915</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-1916"><a href="#IsolatedLoadingProperty-1916"><span class="linenos">1916</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-1917"><a href="#IsolatedLoadingProperty-1917"><span class="linenos">1917</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="IsolatedLoadingProperty-1908"><a href="#IsolatedLoadingProperty-1908"><span class="linenos">1908</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-1909"><a href="#IsolatedLoadingProperty-1909"><span class="linenos">1909</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="IsolatedLoadingProperty-1910"><a href="#IsolatedLoadingProperty-1910"><span class="linenos">1910</span></a> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="IsolatedLoadingProperty-1911"><a href="#IsolatedLoadingProperty-1911"><span class="linenos">1911</span></a> <span class="s2">"concurrent"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="IsolatedLoadingProperty-1912"><a href="#IsolatedLoadingProperty-1912"><span class="linenos">1912</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-1913"><a href="#IsolatedLoadingProperty-1913"><span class="linenos">1913</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-1914"><a href="#IsolatedLoadingProperty-1914"><span class="linenos">1914</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-1915"><a href="#IsolatedLoadingProperty-1915"><span class="linenos">1915</span></a> <span class="p">}</span> </span></pre></div> @@ -26562,14 +26574,14 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#JournalProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="JournalProperty-1920"><a href="#JournalProperty-1920"><span class="linenos">1920</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-1921"><a href="#JournalProperty-1921"><span class="linenos">1921</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="JournalProperty-1922"><a href="#JournalProperty-1922"><span class="linenos">1922</span></a> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="JournalProperty-1923"><a href="#JournalProperty-1923"><span class="linenos">1923</span></a> <span class="s2">"dual"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="JournalProperty-1924"><a href="#JournalProperty-1924"><span class="linenos">1924</span></a> <span class="s2">"before"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="JournalProperty-1925"><a href="#JournalProperty-1925"><span class="linenos">1925</span></a> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="JournalProperty-1926"><a href="#JournalProperty-1926"><span class="linenos">1926</span></a> <span class="s2">"after"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="JournalProperty-1927"><a href="#JournalProperty-1927"><span class="linenos">1927</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="JournalProperty-1918"><a href="#JournalProperty-1918"><span class="linenos">1918</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-1919"><a href="#JournalProperty-1919"><span class="linenos">1919</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="JournalProperty-1920"><a href="#JournalProperty-1920"><span class="linenos">1920</span></a> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="JournalProperty-1921"><a href="#JournalProperty-1921"><span class="linenos">1921</span></a> <span class="s2">"dual"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="JournalProperty-1922"><a href="#JournalProperty-1922"><span class="linenos">1922</span></a> <span class="s2">"before"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="JournalProperty-1923"><a href="#JournalProperty-1923"><span class="linenos">1923</span></a> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="JournalProperty-1924"><a href="#JournalProperty-1924"><span class="linenos">1924</span></a> <span class="s2">"after"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="JournalProperty-1925"><a href="#JournalProperty-1925"><span class="linenos">1925</span></a> <span class="p">}</span> </span></pre></div> @@ -26666,8 +26678,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#LanguageProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LanguageProperty-1930"><a href="#LanguageProperty-1930"><span class="linenos">1930</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-1931"><a href="#LanguageProperty-1931"><span class="linenos">1931</span></a> <span class="n">arg_types</span> <span class="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="LanguageProperty-1928"><a href="#LanguageProperty-1928"><span class="linenos">1928</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-1929"><a href="#LanguageProperty-1929"><span class="linenos">1929</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -26764,8 +26776,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#ClusteredByProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ClusteredByProperty-1935"><a href="#ClusteredByProperty-1935"><span class="linenos">1935</span></a><span class="k">class</span> <span class="nc">ClusteredByProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="ClusteredByProperty-1936"><a href="#ClusteredByProperty-1936"><span class="linenos">1936</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">"sorted_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"buckets"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ClusteredByProperty-1933"><a href="#ClusteredByProperty-1933"><span class="linenos">1933</span></a><span class="k">class</span> <span class="nc">ClusteredByProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="ClusteredByProperty-1934"><a href="#ClusteredByProperty-1934"><span class="linenos">1934</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">"sorted_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"buckets"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -26862,8 +26874,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#DictProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DictProperty-1939"><a href="#DictProperty-1939"><span class="linenos">1939</span></a><span class="k">class</span> <span class="nc">DictProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="DictProperty-1940"><a href="#DictProperty-1940"><span class="linenos">1940</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">True</span><span class="p">,</span> <span class="s2">"settings"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DictProperty-1937"><a href="#DictProperty-1937"><span class="linenos">1937</span></a><span class="k">class</span> <span class="nc">DictProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="DictProperty-1938"><a href="#DictProperty-1938"><span class="linenos">1938</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">True</span><span class="p">,</span> <span class="s2">"settings"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -26960,8 +26972,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#DictSubProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DictSubProperty-1943"><a href="#DictSubProperty-1943"><span class="linenos">1943</span></a><span class="k">class</span> <span class="nc">DictSubProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="DictSubProperty-1944"><a href="#DictSubProperty-1944"><span class="linenos">1944</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DictSubProperty-1941"><a href="#DictSubProperty-1941"><span class="linenos">1941</span></a><span class="k">class</span> <span class="nc">DictSubProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="DictSubProperty-1942"><a href="#DictSubProperty-1942"><span class="linenos">1942</span></a> <span class="k">pass</span> </span></pre></div> @@ -27050,8 +27062,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#DictRange"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DictRange-1947"><a href="#DictRange-1947"><span class="linenos">1947</span></a><span class="k">class</span> <span class="nc">DictRange</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="DictRange-1948"><a href="#DictRange-1948"><span class="linenos">1948</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"min"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"max"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DictRange-1945"><a href="#DictRange-1945"><span class="linenos">1945</span></a><span class="k">class</span> <span class="nc">DictRange</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="DictRange-1946"><a href="#DictRange-1946"><span class="linenos">1946</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"min"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"max"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -27148,8 +27160,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#OnCluster"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="OnCluster-1953"><a href="#OnCluster-1953"><span class="linenos">1953</span></a><span class="k">class</span> <span class="nc">OnCluster</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="OnCluster-1954"><a href="#OnCluster-1954"><span class="linenos">1954</span></a> <span class="n">arg_types</span> <span class="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="OnCluster-1951"><a href="#OnCluster-1951"><span class="linenos">1951</span></a><span class="k">class</span> <span class="nc">OnCluster</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="OnCluster-1952"><a href="#OnCluster-1952"><span class="linenos">1952</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -27246,8 +27258,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-1957"><a href="#LikeProperty-1957"><span class="linenos">1957</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-1958"><a href="#LikeProperty-1958"><span class="linenos">1958</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-1955"><a href="#LikeProperty-1955"><span class="linenos">1955</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-1956"><a href="#LikeProperty-1956"><span class="linenos">1956</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -27344,8 +27356,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-1961"><a href="#LocationProperty-1961"><span class="linenos">1961</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-1962"><a href="#LocationProperty-1962"><span class="linenos">1962</span></a> <span class="n">arg_types</span> <span class="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-1959"><a href="#LocationProperty-1959"><span class="linenos">1959</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-1960"><a href="#LocationProperty-1960"><span class="linenos">1960</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -27442,14 +27454,14 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#LockingProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LockingProperty-1965"><a href="#LockingProperty-1965"><span class="linenos">1965</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-1966"><a href="#LockingProperty-1966"><span class="linenos">1966</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="LockingProperty-1967"><a href="#LockingProperty-1967"><span class="linenos">1967</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LockingProperty-1968"><a href="#LockingProperty-1968"><span class="linenos">1968</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="LockingProperty-1969"><a href="#LockingProperty-1969"><span class="linenos">1969</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-1970"><a href="#LockingProperty-1970"><span class="linenos">1970</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-1971"><a href="#LockingProperty-1971"><span class="linenos">1971</span></a> <span class="s2">"override"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LockingProperty-1972"><a href="#LockingProperty-1972"><span class="linenos">1972</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LockingProperty-1963"><a href="#LockingProperty-1963"><span class="linenos">1963</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-1964"><a href="#LockingProperty-1964"><span class="linenos">1964</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="LockingProperty-1965"><a href="#LockingProperty-1965"><span class="linenos">1965</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LockingProperty-1966"><a href="#LockingProperty-1966"><span class="linenos">1966</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="LockingProperty-1967"><a href="#LockingProperty-1967"><span class="linenos">1967</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-1968"><a href="#LockingProperty-1968"><span class="linenos">1968</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-1969"><a href="#LockingProperty-1969"><span class="linenos">1969</span></a> <span class="s2">"override"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LockingProperty-1970"><a href="#LockingProperty-1970"><span class="linenos">1970</span></a> <span class="p">}</span> </span></pre></div> @@ -27546,8 +27558,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#LogProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LogProperty-1975"><a href="#LogProperty-1975"><span class="linenos">1975</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-1976"><a href="#LogProperty-1976"><span class="linenos">1976</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="LogProperty-1973"><a href="#LogProperty-1973"><span class="linenos">1973</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-1974"><a href="#LogProperty-1974"><span class="linenos">1974</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> @@ -27644,8 +27656,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#MaterializedProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="MaterializedProperty-1979"><a href="#MaterializedProperty-1979"><span class="linenos">1979</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-1980"><a href="#MaterializedProperty-1980"><span class="linenos">1980</span></a> <span class="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="MaterializedProperty-1977"><a href="#MaterializedProperty-1977"><span class="linenos">1977</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-1978"><a href="#MaterializedProperty-1978"><span class="linenos">1978</span></a> <span class="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> @@ -27742,8 +27754,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#MergeBlockRatioProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="MergeBlockRatioProperty-1983"><a href="#MergeBlockRatioProperty-1983"><span class="linenos">1983</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-1984"><a href="#MergeBlockRatioProperty-1984"><span class="linenos">1984</span></a> <span class="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> + <div class="pdoc-code codehilite"><pre><span></span><span id="MergeBlockRatioProperty-1981"><a href="#MergeBlockRatioProperty-1981"><span class="linenos">1981</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-1982"><a href="#MergeBlockRatioProperty-1982"><span class="linenos">1982</span></a> <span class="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> @@ -27840,8 +27852,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#NoPrimaryIndexProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="NoPrimaryIndexProperty-1987"><a href="#NoPrimaryIndexProperty-1987"><span class="linenos">1987</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-1988"><a href="#NoPrimaryIndexProperty-1988"><span class="linenos">1988</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="NoPrimaryIndexProperty-1985"><a href="#NoPrimaryIndexProperty-1985"><span class="linenos">1985</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-1986"><a href="#NoPrimaryIndexProperty-1986"><span class="linenos">1986</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{}</span> </span></pre></div> @@ -27938,8 +27950,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#OnCommitProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="OnCommitProperty-1991"><a href="#OnCommitProperty-1991"><span class="linenos">1991</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-1992"><a href="#OnCommitProperty-1992"><span class="linenos">1992</span></a> <span class="n">arg_type</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="OnCommitProperty-1989"><a href="#OnCommitProperty-1989"><span class="linenos">1989</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-1990"><a href="#OnCommitProperty-1990"><span class="linenos">1990</span></a> <span class="n">arg_type</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -28040,8 +28052,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#PartitionedByProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="PartitionedByProperty-1995"><a href="#PartitionedByProperty-1995"><span class="linenos">1995</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-1996"><a href="#PartitionedByProperty-1996"><span class="linenos">1996</span></a> <span class="n">arg_types</span> <span class="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="PartitionedByProperty-1993"><a href="#PartitionedByProperty-1993"><span class="linenos">1993</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-1994"><a href="#PartitionedByProperty-1994"><span class="linenos">1994</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -28138,8 +28150,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#ReturnsProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ReturnsProperty-1999"><a href="#ReturnsProperty-1999"><span class="linenos">1999</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-2000"><a href="#ReturnsProperty-2000"><span class="linenos">2000</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> + <div class="pdoc-code codehilite"><pre><span></span><span id="ReturnsProperty-1997"><a href="#ReturnsProperty-1997"><span class="linenos">1997</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-1998"><a href="#ReturnsProperty-1998"><span class="linenos">1998</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -28236,8 +28248,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#RowFormatProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RowFormatProperty-2003"><a href="#RowFormatProperty-2003"><span class="linenos">2003</span></a><span class="k">class</span> <span class="nc">RowFormatProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="RowFormatProperty-2004"><a href="#RowFormatProperty-2004"><span class="linenos">2004</span></a> <span class="n">arg_types</span> <span class="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="RowFormatProperty-2001"><a href="#RowFormatProperty-2001"><span class="linenos">2001</span></a><span class="k">class</span> <span class="nc">RowFormatProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="RowFormatProperty-2002"><a href="#RowFormatProperty-2002"><span class="linenos">2002</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -28334,17 +28346,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-2007"><a href="#RowFormatDelimitedProperty-2007"><span class="linenos">2007</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-2008"><a href="#RowFormatDelimitedProperty-2008"><span class="linenos">2008</span></a> <span class="c1"># https://cwiki.apache.org/confluence/display/hive/languagemanual+dml</span> -</span><span id="RowFormatDelimitedProperty-2009"><a href="#RowFormatDelimitedProperty-2009"><span class="linenos">2009</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="RowFormatDelimitedProperty-2010"><a href="#RowFormatDelimitedProperty-2010"><span class="linenos">2010</span></a> <span class="s2">"fields"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RowFormatDelimitedProperty-2011"><a href="#RowFormatDelimitedProperty-2011"><span class="linenos">2011</span></a> <span class="s2">"escaped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RowFormatDelimitedProperty-2012"><a href="#RowFormatDelimitedProperty-2012"><span class="linenos">2012</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-2013"><a href="#RowFormatDelimitedProperty-2013"><span class="linenos">2013</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-2014"><a href="#RowFormatDelimitedProperty-2014"><span class="linenos">2014</span></a> <span class="s2">"lines"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RowFormatDelimitedProperty-2015"><a href="#RowFormatDelimitedProperty-2015"><span class="linenos">2015</span></a> <span class="s2">"null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RowFormatDelimitedProperty-2016"><a href="#RowFormatDelimitedProperty-2016"><span class="linenos">2016</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RowFormatDelimitedProperty-2017"><a href="#RowFormatDelimitedProperty-2017"><span class="linenos">2017</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RowFormatDelimitedProperty-2005"><a href="#RowFormatDelimitedProperty-2005"><span class="linenos">2005</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-2006"><a href="#RowFormatDelimitedProperty-2006"><span class="linenos">2006</span></a> <span class="c1"># https://cwiki.apache.org/confluence/display/hive/languagemanual+dml</span> +</span><span id="RowFormatDelimitedProperty-2007"><a href="#RowFormatDelimitedProperty-2007"><span class="linenos">2007</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="RowFormatDelimitedProperty-2008"><a href="#RowFormatDelimitedProperty-2008"><span class="linenos">2008</span></a> <span class="s2">"fields"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RowFormatDelimitedProperty-2009"><a href="#RowFormatDelimitedProperty-2009"><span class="linenos">2009</span></a> <span class="s2">"escaped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RowFormatDelimitedProperty-2010"><a href="#RowFormatDelimitedProperty-2010"><span class="linenos">2010</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-2011"><a href="#RowFormatDelimitedProperty-2011"><span class="linenos">2011</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-2012"><a href="#RowFormatDelimitedProperty-2012"><span class="linenos">2012</span></a> <span class="s2">"lines"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RowFormatDelimitedProperty-2013"><a href="#RowFormatDelimitedProperty-2013"><span class="linenos">2013</span></a> <span class="s2">"null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RowFormatDelimitedProperty-2014"><a href="#RowFormatDelimitedProperty-2014"><span class="linenos">2014</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RowFormatDelimitedProperty-2015"><a href="#RowFormatDelimitedProperty-2015"><span class="linenos">2015</span></a> <span class="p">}</span> </span></pre></div> @@ -28442,8 +28454,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-2020"><a href="#RowFormatSerdeProperty-2020"><span class="linenos">2020</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-2021"><a href="#RowFormatSerdeProperty-2021"><span class="linenos">2021</span></a> <span class="n">arg_types</span> <span class="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-2018"><a href="#RowFormatSerdeProperty-2018"><span class="linenos">2018</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-2019"><a href="#RowFormatSerdeProperty-2019"><span class="linenos">2019</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -28540,8 +28552,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#SchemaCommentProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SchemaCommentProperty-2024"><a href="#SchemaCommentProperty-2024"><span class="linenos">2024</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-2025"><a href="#SchemaCommentProperty-2025"><span class="linenos">2025</span></a> <span class="n">arg_types</span> <span class="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="SchemaCommentProperty-2022"><a href="#SchemaCommentProperty-2022"><span class="linenos">2022</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-2023"><a href="#SchemaCommentProperty-2023"><span class="linenos">2023</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -28638,8 +28650,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-2028"><a href="#SerdeProperties-2028"><span class="linenos">2028</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-2029"><a href="#SerdeProperties-2029"><span class="linenos">2029</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-2026"><a href="#SerdeProperties-2026"><span class="linenos">2026</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-2027"><a href="#SerdeProperties-2027"><span class="linenos">2027</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> @@ -28736,8 +28748,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#SetProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SetProperty-2032"><a href="#SetProperty-2032"><span class="linenos">2032</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-2033"><a href="#SetProperty-2033"><span class="linenos">2033</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="SetProperty-2030"><a href="#SetProperty-2030"><span class="linenos">2030</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-2031"><a href="#SetProperty-2031"><span class="linenos">2031</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> @@ -28834,8 +28846,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#SettingsProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SettingsProperty-2036"><a href="#SettingsProperty-2036"><span class="linenos">2036</span></a><span class="k">class</span> <span class="nc">SettingsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="SettingsProperty-2037"><a href="#SettingsProperty-2037"><span class="linenos">2037</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="SettingsProperty-2034"><a href="#SettingsProperty-2034"><span class="linenos">2034</span></a><span class="k">class</span> <span class="nc">SettingsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="SettingsProperty-2035"><a href="#SettingsProperty-2035"><span class="linenos">2035</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> @@ -28932,8 +28944,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#SortKeyProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SortKeyProperty-2040"><a href="#SortKeyProperty-2040"><span class="linenos">2040</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-2041"><a href="#SortKeyProperty-2041"><span class="linenos">2041</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> + <div class="pdoc-code codehilite"><pre><span></span><span id="SortKeyProperty-2038"><a href="#SortKeyProperty-2038"><span class="linenos">2038</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-2039"><a href="#SortKeyProperty-2039"><span class="linenos">2039</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -29030,8 +29042,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#SqlSecurityProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SqlSecurityProperty-2044"><a href="#SqlSecurityProperty-2044"><span class="linenos">2044</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-2045"><a href="#SqlSecurityProperty-2045"><span class="linenos">2045</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="SqlSecurityProperty-2042"><a href="#SqlSecurityProperty-2042"><span class="linenos">2042</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-2043"><a href="#SqlSecurityProperty-2043"><span class="linenos">2043</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> @@ -29128,8 +29140,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#StabilityProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StabilityProperty-2048"><a href="#StabilityProperty-2048"><span class="linenos">2048</span></a><span class="k">class</span> <span class="nc">StabilityProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="StabilityProperty-2049"><a href="#StabilityProperty-2049"><span class="linenos">2049</span></a> <span class="n">arg_types</span> <span class="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="StabilityProperty-2046"><a href="#StabilityProperty-2046"><span class="linenos">2046</span></a><span class="k">class</span> <span class="nc">StabilityProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="StabilityProperty-2047"><a href="#StabilityProperty-2047"><span class="linenos">2047</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -29226,8 +29238,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#TemporaryProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TemporaryProperty-2052"><a href="#TemporaryProperty-2052"><span class="linenos">2052</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-2053"><a href="#TemporaryProperty-2053"><span class="linenos">2053</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TemporaryProperty-2050"><a href="#TemporaryProperty-2050"><span class="linenos">2050</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-2051"><a href="#TemporaryProperty-2051"><span class="linenos">2051</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{}</span> </span></pre></div> @@ -29324,8 +29336,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#TransientProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TransientProperty-2056"><a href="#TransientProperty-2056"><span class="linenos">2056</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-2057"><a href="#TransientProperty-2057"><span class="linenos">2057</span></a> <span class="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="TransientProperty-2054"><a href="#TransientProperty-2054"><span class="linenos">2054</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-2055"><a href="#TransientProperty-2055"><span class="linenos">2055</span></a> <span class="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> @@ -29422,8 +29434,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#VolatileProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="VolatileProperty-2060"><a href="#VolatileProperty-2060"><span class="linenos">2060</span></a><span class="k">class</span> <span class="nc">VolatileProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="VolatileProperty-2061"><a href="#VolatileProperty-2061"><span class="linenos">2061</span></a> <span class="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="VolatileProperty-2058"><a href="#VolatileProperty-2058"><span class="linenos">2058</span></a><span class="k">class</span> <span class="nc">VolatileProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="VolatileProperty-2059"><a href="#VolatileProperty-2059"><span class="linenos">2059</span></a> <span class="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> @@ -29520,8 +29532,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#WithDataProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="WithDataProperty-2064"><a href="#WithDataProperty-2064"><span class="linenos">2064</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-2065"><a href="#WithDataProperty-2065"><span class="linenos">2065</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="WithDataProperty-2062"><a href="#WithDataProperty-2062"><span class="linenos">2062</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-2063"><a href="#WithDataProperty-2063"><span class="linenos">2063</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> @@ -29618,8 +29630,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#WithJournalTableProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="WithJournalTableProperty-2068"><a href="#WithJournalTableProperty-2068"><span class="linenos">2068</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-2069"><a href="#WithJournalTableProperty-2069"><span class="linenos">2069</span></a> <span class="n">arg_types</span> <span class="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="WithJournalTableProperty-2066"><a href="#WithJournalTableProperty-2066"><span class="linenos">2066</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-2067"><a href="#WithJournalTableProperty-2067"><span class="linenos">2067</span></a> <span class="n">arg_types</span> <span class="o">=</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> @@ -29716,66 +29728,66 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Properties"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Properties-2072"><a href="#Properties-2072"><span class="linenos">2072</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-2073"><a href="#Properties-2073"><span class="linenos">2073</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-2074"><a href="#Properties-2074"><span class="linenos">2074</span></a> -</span><span id="Properties-2075"><a href="#Properties-2075"><span class="linenos">2075</span></a> <span class="n">NAME_TO_PROPERTY</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Properties-2076"><a href="#Properties-2076"><span class="linenos">2076</span></a> <span class="s2">"ALGORITHM"</span><span class="p">:</span> <span class="n">AlgorithmProperty</span><span class="p">,</span> -</span><span id="Properties-2077"><a href="#Properties-2077"><span class="linenos">2077</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-2078"><a href="#Properties-2078"><span class="linenos">2078</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-2079"><a href="#Properties-2079"><span class="linenos">2079</span></a> <span class="s2">"CLUSTERED_BY"</span><span class="p">:</span> <span class="n">ClusteredByProperty</span><span class="p">,</span> -</span><span id="Properties-2080"><a href="#Properties-2080"><span class="linenos">2080</span></a> <span class="s2">"COLLATE"</span><span class="p">:</span> <span class="n">CollateProperty</span><span class="p">,</span> -</span><span id="Properties-2081"><a href="#Properties-2081"><span class="linenos">2081</span></a> <span class="s2">"COMMENT"</span><span class="p">:</span> <span class="n">SchemaCommentProperty</span><span class="p">,</span> -</span><span id="Properties-2082"><a href="#Properties-2082"><span class="linenos">2082</span></a> <span class="s2">"DEFINER"</span><span class="p">:</span> <span class="n">DefinerProperty</span><span class="p">,</span> -</span><span id="Properties-2083"><a href="#Properties-2083"><span class="linenos">2083</span></a> <span class="s2">"DISTKEY"</span><span class="p">:</span> <span class="n">DistKeyProperty</span><span class="p">,</span> -</span><span id="Properties-2084"><a href="#Properties-2084"><span class="linenos">2084</span></a> <span class="s2">"DISTSTYLE"</span><span class="p">:</span> <span class="n">DistStyleProperty</span><span class="p">,</span> -</span><span id="Properties-2085"><a href="#Properties-2085"><span class="linenos">2085</span></a> <span class="s2">"ENGINE"</span><span class="p">:</span> <span class="n">EngineProperty</span><span class="p">,</span> -</span><span id="Properties-2086"><a href="#Properties-2086"><span class="linenos">2086</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-2087"><a href="#Properties-2087"><span class="linenos">2087</span></a> <span class="s2">"FORMAT"</span><span class="p">:</span> <span class="n">FileFormatProperty</span><span class="p">,</span> -</span><span id="Properties-2088"><a href="#Properties-2088"><span class="linenos">2088</span></a> <span class="s2">"LANGUAGE"</span><span class="p">:</span> <span class="n">LanguageProperty</span><span class="p">,</span> -</span><span id="Properties-2089"><a href="#Properties-2089"><span class="linenos">2089</span></a> <span class="s2">"LOCATION"</span><span class="p">:</span> <span class="n">LocationProperty</span><span class="p">,</span> -</span><span id="Properties-2090"><a href="#Properties-2090"><span class="linenos">2090</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-2091"><a href="#Properties-2091"><span class="linenos">2091</span></a> <span class="s2">"RETURNS"</span><span class="p">:</span> <span class="n">ReturnsProperty</span><span class="p">,</span> -</span><span id="Properties-2092"><a href="#Properties-2092"><span class="linenos">2092</span></a> <span class="s2">"ROW_FORMAT"</span><span class="p">:</span> <span class="n">RowFormatProperty</span><span class="p">,</span> -</span><span id="Properties-2093"><a href="#Properties-2093"><span class="linenos">2093</span></a> <span class="s2">"SORTKEY"</span><span class="p">:</span> <span class="n">SortKeyProperty</span><span class="p">,</span> -</span><span id="Properties-2094"><a href="#Properties-2094"><span class="linenos">2094</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Properties-2070"><a href="#Properties-2070"><span class="linenos">2070</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-2071"><a href="#Properties-2071"><span class="linenos">2071</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-2072"><a href="#Properties-2072"><span class="linenos">2072</span></a> +</span><span id="Properties-2073"><a href="#Properties-2073"><span class="linenos">2073</span></a> <span class="n">NAME_TO_PROPERTY</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Properties-2074"><a href="#Properties-2074"><span class="linenos">2074</span></a> <span class="s2">"ALGORITHM"</span><span class="p">:</span> <span class="n">AlgorithmProperty</span><span class="p">,</span> +</span><span id="Properties-2075"><a href="#Properties-2075"><span class="linenos">2075</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-2076"><a href="#Properties-2076"><span class="linenos">2076</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-2077"><a href="#Properties-2077"><span class="linenos">2077</span></a> <span class="s2">"CLUSTERED_BY"</span><span class="p">:</span> <span class="n">ClusteredByProperty</span><span class="p">,</span> +</span><span id="Properties-2078"><a href="#Properties-2078"><span class="linenos">2078</span></a> <span class="s2">"COLLATE"</span><span class="p">:</span> <span class="n">CollateProperty</span><span class="p">,</span> +</span><span id="Properties-2079"><a href="#Properties-2079"><span class="linenos">2079</span></a> <span class="s2">"COMMENT"</span><span class="p">:</span> <span class="n">SchemaCommentProperty</span><span class="p">,</span> +</span><span id="Properties-2080"><a href="#Properties-2080"><span class="linenos">2080</span></a> <span class="s2">"DEFINER"</span><span class="p">:</span> <span class="n">DefinerProperty</span><span class="p">,</span> +</span><span id="Properties-2081"><a href="#Properties-2081"><span class="linenos">2081</span></a> <span class="s2">"DISTKEY"</span><span class="p">:</span> <span class="n">DistKeyProperty</span><span class="p">,</span> +</span><span id="Properties-2082"><a href="#Properties-2082"><span class="linenos">2082</span></a> <span class="s2">"DISTSTYLE"</span><span class="p">:</span> <span class="n">DistStyleProperty</span><span class="p">,</span> +</span><span id="Properties-2083"><a href="#Properties-2083"><span class="linenos">2083</span></a> <span class="s2">"ENGINE"</span><span class="p">:</span> <span class="n">EngineProperty</span><span class="p">,</span> +</span><span id="Properties-2084"><a href="#Properties-2084"><span class="linenos">2084</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-2085"><a href="#Properties-2085"><span class="linenos">2085</span></a> <span class="s2">"FORMAT"</span><span class="p">:</span> <span class="n">FileFormatProperty</span><span class="p">,</span> +</span><span id="Properties-2086"><a href="#Properties-2086"><span class="linenos">2086</span></a> <span class="s2">"LANGUAGE"</span><span class="p">:</span> <span class="n">LanguageProperty</span><span class="p">,</span> +</span><span id="Properties-2087"><a href="#Properties-2087"><span class="linenos">2087</span></a> <span class="s2">"LOCATION"</span><span class="p">:</span> <span class="n">LocationProperty</span><span class="p">,</span> +</span><span id="Properties-2088"><a href="#Properties-2088"><span class="linenos">2088</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-2089"><a href="#Properties-2089"><span class="linenos">2089</span></a> <span class="s2">"RETURNS"</span><span class="p">:</span> <span class="n">ReturnsProperty</span><span class="p">,</span> +</span><span id="Properties-2090"><a href="#Properties-2090"><span class="linenos">2090</span></a> <span class="s2">"ROW_FORMAT"</span><span class="p">:</span> <span class="n">RowFormatProperty</span><span class="p">,</span> +</span><span id="Properties-2091"><a href="#Properties-2091"><span class="linenos">2091</span></a> <span class="s2">"SORTKEY"</span><span class="p">:</span> <span class="n">SortKeyProperty</span><span class="p">,</span> +</span><span id="Properties-2092"><a href="#Properties-2092"><span class="linenos">2092</span></a> <span class="p">}</span> +</span><span id="Properties-2093"><a href="#Properties-2093"><span class="linenos">2093</span></a> +</span><span id="Properties-2094"><a href="#Properties-2094"><span class="linenos">2094</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-2095"><a href="#Properties-2095"><span class="linenos">2095</span></a> -</span><span id="Properties-2096"><a href="#Properties-2096"><span class="linenos">2096</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-2097"><a href="#Properties-2097"><span class="linenos">2097</span></a> -</span><span id="Properties-2098"><a href="#Properties-2098"><span class="linenos">2098</span></a> <span class="c1"># CREATE property locations</span> -</span><span id="Properties-2099"><a href="#Properties-2099"><span class="linenos">2099</span></a> <span class="c1"># Form: schema specified</span> -</span><span id="Properties-2100"><a href="#Properties-2100"><span class="linenos">2100</span></a> <span class="c1"># create [POST_CREATE]</span> -</span><span id="Properties-2101"><a href="#Properties-2101"><span class="linenos">2101</span></a> <span class="c1"># table a [POST_NAME]</span> -</span><span id="Properties-2102"><a href="#Properties-2102"><span class="linenos">2102</span></a> <span class="c1"># (b int) [POST_SCHEMA]</span> -</span><span id="Properties-2103"><a href="#Properties-2103"><span class="linenos">2103</span></a> <span class="c1"># with ([POST_WITH])</span> -</span><span id="Properties-2104"><a href="#Properties-2104"><span class="linenos">2104</span></a> <span class="c1"># index (b) [POST_INDEX]</span> -</span><span id="Properties-2105"><a href="#Properties-2105"><span class="linenos">2105</span></a> <span class="c1">#</span> -</span><span id="Properties-2106"><a href="#Properties-2106"><span class="linenos">2106</span></a> <span class="c1"># Form: alias selection</span> -</span><span id="Properties-2107"><a href="#Properties-2107"><span class="linenos">2107</span></a> <span class="c1"># create [POST_CREATE]</span> -</span><span id="Properties-2108"><a href="#Properties-2108"><span class="linenos">2108</span></a> <span class="c1"># table a [POST_NAME]</span> -</span><span id="Properties-2109"><a href="#Properties-2109"><span class="linenos">2109</span></a> <span class="c1"># as [POST_ALIAS] (select * from b) [POST_EXPRESSION]</span> -</span><span id="Properties-2110"><a href="#Properties-2110"><span class="linenos">2110</span></a> <span class="c1"># index (c) [POST_INDEX]</span> -</span><span id="Properties-2111"><a href="#Properties-2111"><span class="linenos">2111</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-2112"><a href="#Properties-2112"><span class="linenos">2112</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-2113"><a href="#Properties-2113"><span class="linenos">2113</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-2114"><a href="#Properties-2114"><span class="linenos">2114</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-2115"><a href="#Properties-2115"><span class="linenos">2115</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-2116"><a href="#Properties-2116"><span class="linenos">2116</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-2117"><a href="#Properties-2117"><span class="linenos">2117</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-2118"><a href="#Properties-2118"><span class="linenos">2118</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-2119"><a href="#Properties-2119"><span class="linenos">2119</span></a> <span class="n">UNSUPPORTED</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties-2120"><a href="#Properties-2120"><span class="linenos">2120</span></a> -</span><span id="Properties-2121"><a href="#Properties-2121"><span class="linenos">2121</span></a> <span class="nd">@classmethod</span> -</span><span id="Properties-2122"><a href="#Properties-2122"><span class="linenos">2122</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="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">Properties</span><span class="p">:</span> -</span><span id="Properties-2123"><a href="#Properties-2123"><span class="linenos">2123</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="Properties-2124"><a href="#Properties-2124"><span class="linenos">2124</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-2125"><a href="#Properties-2125"><span class="linenos">2125</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-2126"><a href="#Properties-2126"><span class="linenos">2126</span></a> <span class="k">if</span> <span class="n">property_cls</span><span class="p">:</span> -</span><span id="Properties-2127"><a href="#Properties-2127"><span class="linenos">2127</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-2128"><a href="#Properties-2128"><span class="linenos">2128</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Properties-2129"><a href="#Properties-2129"><span class="linenos">2129</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-2130"><a href="#Properties-2130"><span class="linenos">2130</span></a> -</span><span id="Properties-2131"><a href="#Properties-2131"><span class="linenos">2131</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="Properties-2096"><a href="#Properties-2096"><span class="linenos">2096</span></a> <span class="c1"># CREATE property locations</span> +</span><span id="Properties-2097"><a href="#Properties-2097"><span class="linenos">2097</span></a> <span class="c1"># Form: schema specified</span> +</span><span id="Properties-2098"><a href="#Properties-2098"><span class="linenos">2098</span></a> <span class="c1"># create [POST_CREATE]</span> +</span><span id="Properties-2099"><a href="#Properties-2099"><span class="linenos">2099</span></a> <span class="c1"># table a [POST_NAME]</span> +</span><span id="Properties-2100"><a href="#Properties-2100"><span class="linenos">2100</span></a> <span class="c1"># (b int) [POST_SCHEMA]</span> +</span><span id="Properties-2101"><a href="#Properties-2101"><span class="linenos">2101</span></a> <span class="c1"># with ([POST_WITH])</span> +</span><span id="Properties-2102"><a href="#Properties-2102"><span class="linenos">2102</span></a> <span class="c1"># index (b) [POST_INDEX]</span> +</span><span id="Properties-2103"><a href="#Properties-2103"><span class="linenos">2103</span></a> <span class="c1">#</span> +</span><span id="Properties-2104"><a href="#Properties-2104"><span class="linenos">2104</span></a> <span class="c1"># Form: alias selection</span> +</span><span id="Properties-2105"><a href="#Properties-2105"><span class="linenos">2105</span></a> <span class="c1"># create [POST_CREATE]</span> +</span><span id="Properties-2106"><a href="#Properties-2106"><span class="linenos">2106</span></a> <span class="c1"># table a [POST_NAME]</span> +</span><span id="Properties-2107"><a href="#Properties-2107"><span class="linenos">2107</span></a> <span class="c1"># as [POST_ALIAS] (select * from b) [POST_EXPRESSION]</span> +</span><span id="Properties-2108"><a href="#Properties-2108"><span class="linenos">2108</span></a> <span class="c1"># index (c) [POST_INDEX]</span> +</span><span id="Properties-2109"><a href="#Properties-2109"><span class="linenos">2109</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-2110"><a href="#Properties-2110"><span class="linenos">2110</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-2111"><a href="#Properties-2111"><span class="linenos">2111</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-2112"><a href="#Properties-2112"><span class="linenos">2112</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-2113"><a href="#Properties-2113"><span class="linenos">2113</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-2114"><a href="#Properties-2114"><span class="linenos">2114</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-2115"><a href="#Properties-2115"><span class="linenos">2115</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-2116"><a href="#Properties-2116"><span class="linenos">2116</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-2117"><a href="#Properties-2117"><span class="linenos">2117</span></a> <span class="n">UNSUPPORTED</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties-2118"><a href="#Properties-2118"><span class="linenos">2118</span></a> +</span><span id="Properties-2119"><a href="#Properties-2119"><span class="linenos">2119</span></a> <span class="nd">@classmethod</span> +</span><span id="Properties-2120"><a href="#Properties-2120"><span class="linenos">2120</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="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">Properties</span><span class="p">:</span> +</span><span id="Properties-2121"><a href="#Properties-2121"><span class="linenos">2121</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="Properties-2122"><a href="#Properties-2122"><span class="linenos">2122</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-2123"><a href="#Properties-2123"><span class="linenos">2123</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-2124"><a href="#Properties-2124"><span class="linenos">2124</span></a> <span class="k">if</span> <span class="n">property_cls</span><span class="p">:</span> +</span><span id="Properties-2125"><a href="#Properties-2125"><span class="linenos">2125</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-2126"><a href="#Properties-2126"><span class="linenos">2126</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Properties-2127"><a href="#Properties-2127"><span class="linenos">2127</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-2128"><a href="#Properties-2128"><span class="linenos">2128</span></a> +</span><span id="Properties-2129"><a href="#Properties-2129"><span class="linenos">2129</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> @@ -29831,17 +29843,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-2121"><a href="#Properties.from_dict-2121"><span class="linenos">2121</span></a> <span class="nd">@classmethod</span> -</span><span id="Properties.from_dict-2122"><a href="#Properties.from_dict-2122"><span class="linenos">2122</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="n">t</span><span class="o">.</span><span class="n">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-2123"><a href="#Properties.from_dict-2123"><span class="linenos">2123</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="Properties.from_dict-2124"><a href="#Properties.from_dict-2124"><span class="linenos">2124</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-2125"><a href="#Properties.from_dict-2125"><span class="linenos">2125</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-2126"><a href="#Properties.from_dict-2126"><span class="linenos">2126</span></a> <span class="k">if</span> <span class="n">property_cls</span><span class="p">:</span> -</span><span id="Properties.from_dict-2127"><a href="#Properties.from_dict-2127"><span class="linenos">2127</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-2128"><a href="#Properties.from_dict-2128"><span class="linenos">2128</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Properties.from_dict-2129"><a href="#Properties.from_dict-2129"><span class="linenos">2129</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-2130"><a href="#Properties.from_dict-2130"><span class="linenos">2130</span></a> -</span><span id="Properties.from_dict-2131"><a href="#Properties.from_dict-2131"><span class="linenos">2131</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-2119"><a href="#Properties.from_dict-2119"><span class="linenos">2119</span></a> <span class="nd">@classmethod</span> +</span><span id="Properties.from_dict-2120"><a href="#Properties.from_dict-2120"><span class="linenos">2120</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="n">t</span><span class="o">.</span><span class="n">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-2121"><a href="#Properties.from_dict-2121"><span class="linenos">2121</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="Properties.from_dict-2122"><a href="#Properties.from_dict-2122"><span class="linenos">2122</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-2123"><a href="#Properties.from_dict-2123"><span class="linenos">2123</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-2124"><a href="#Properties.from_dict-2124"><span class="linenos">2124</span></a> <span class="k">if</span> <span class="n">property_cls</span><span class="p">:</span> +</span><span id="Properties.from_dict-2125"><a href="#Properties.from_dict-2125"><span class="linenos">2125</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-2126"><a href="#Properties.from_dict-2126"><span class="linenos">2126</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Properties.from_dict-2127"><a href="#Properties.from_dict-2127"><span class="linenos">2127</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-2128"><a href="#Properties.from_dict-2128"><span class="linenos">2128</span></a> +</span><span id="Properties.from_dict-2129"><a href="#Properties.from_dict-2129"><span class="linenos">2129</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> @@ -29927,15 +29939,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-2111"><a href="#Properties.Location-2111"><span class="linenos">2111</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-2112"><a href="#Properties.Location-2112"><span class="linenos">2112</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-2113"><a href="#Properties.Location-2113"><span class="linenos">2113</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-2114"><a href="#Properties.Location-2114"><span class="linenos">2114</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-2115"><a href="#Properties.Location-2115"><span class="linenos">2115</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-2116"><a href="#Properties.Location-2116"><span class="linenos">2116</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-2117"><a href="#Properties.Location-2117"><span class="linenos">2117</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-2118"><a href="#Properties.Location-2118"><span class="linenos">2118</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-2119"><a href="#Properties.Location-2119"><span class="linenos">2119</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-2109"><a href="#Properties.Location-2109"><span class="linenos">2109</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-2110"><a href="#Properties.Location-2110"><span class="linenos">2110</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-2111"><a href="#Properties.Location-2111"><span class="linenos">2111</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-2112"><a href="#Properties.Location-2112"><span class="linenos">2112</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-2113"><a href="#Properties.Location-2113"><span class="linenos">2113</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-2114"><a href="#Properties.Location-2114"><span class="linenos">2114</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-2115"><a href="#Properties.Location-2115"><span class="linenos">2115</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-2116"><a href="#Properties.Location-2116"><span class="linenos">2116</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-2117"><a href="#Properties.Location-2117"><span class="linenos">2117</span></a> <span class="n">UNSUPPORTED</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> </span></pre></div> @@ -30061,8 +30073,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-2134"><a href="#Qualify-2134"><span class="linenos">2134</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-2135"><a href="#Qualify-2135"><span class="linenos">2135</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Qualify-2132"><a href="#Qualify-2132"><span class="linenos">2132</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-2133"><a href="#Qualify-2133"><span class="linenos">2133</span></a> <span class="k">pass</span> </span></pre></div> @@ -30148,8 +30160,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-2139"><a href="#Return-2139"><span class="linenos">2139</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-2140"><a href="#Return-2140"><span class="linenos">2140</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Return-2137"><a href="#Return-2137"><span class="linenos">2137</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-2138"><a href="#Return-2138"><span class="linenos">2138</span></a> <span class="k">pass</span> </span></pre></div> @@ -30235,8 +30247,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-2143"><a href="#Reference-2143"><span class="linenos">2143</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-2144"><a href="#Reference-2144"><span class="linenos">2144</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-2141"><a href="#Reference-2141"><span class="linenos">2141</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-2142"><a href="#Reference-2142"><span class="linenos">2142</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -30333,17 +30345,17 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Tuple"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Tuple-2147"><a href="#Tuple-2147"><span class="linenos">2147</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-2148"><a href="#Tuple-2148"><span class="linenos">2148</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="Tuple-2149"><a href="#Tuple-2149"><span class="linenos">2149</span></a> -</span><span id="Tuple-2150"><a href="#Tuple-2150"><span class="linenos">2150</span></a> <span class="k">def</span> <span class="nf">isin</span><span class="p">(</span> -</span><span id="Tuple-2151"><a href="#Tuple-2151"><span class="linenos">2151</span></a> <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">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="n">query</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">opts</span> -</span><span id="Tuple-2152"><a href="#Tuple-2152"><span class="linenos">2152</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">In</span><span class="p">:</span> -</span><span id="Tuple-2153"><a href="#Tuple-2153"><span class="linenos">2153</span></a> <span class="k">return</span> <span class="n">In</span><span class="p">(</span> -</span><span id="Tuple-2154"><a href="#Tuple-2154"><span class="linenos">2154</span></a> <span class="n">this</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="Tuple-2155"><a href="#Tuple-2155"><span class="linenos">2155</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">e</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">],</span> -</span><span id="Tuple-2156"><a href="#Tuple-2156"><span class="linenos">2156</span></a> <span class="n">query</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">if</span> <span class="n">query</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Tuple-2157"><a href="#Tuple-2157"><span class="linenos">2157</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Tuple-2145"><a href="#Tuple-2145"><span class="linenos">2145</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-2146"><a href="#Tuple-2146"><span class="linenos">2146</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="Tuple-2147"><a href="#Tuple-2147"><span class="linenos">2147</span></a> +</span><span id="Tuple-2148"><a href="#Tuple-2148"><span class="linenos">2148</span></a> <span class="k">def</span> <span class="nf">isin</span><span class="p">(</span> +</span><span id="Tuple-2149"><a href="#Tuple-2149"><span class="linenos">2149</span></a> <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">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="n">query</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">opts</span> +</span><span id="Tuple-2150"><a href="#Tuple-2150"><span class="linenos">2150</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">In</span><span class="p">:</span> +</span><span id="Tuple-2151"><a href="#Tuple-2151"><span class="linenos">2151</span></a> <span class="k">return</span> <span class="n">In</span><span class="p">(</span> +</span><span id="Tuple-2152"><a href="#Tuple-2152"><span class="linenos">2152</span></a> <span class="n">this</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="Tuple-2153"><a href="#Tuple-2153"><span class="linenos">2153</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">e</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">],</span> +</span><span id="Tuple-2154"><a href="#Tuple-2154"><span class="linenos">2154</span></a> <span class="n">query</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">if</span> <span class="n">query</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Tuple-2155"><a href="#Tuple-2155"><span class="linenos">2155</span></a> <span class="p">)</span> </span></pre></div> @@ -30372,14 +30384,14 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Tuple.isin"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Tuple.isin-2150"><a href="#Tuple.isin-2150"><span class="linenos">2150</span></a> <span class="k">def</span> <span class="nf">isin</span><span class="p">(</span> -</span><span id="Tuple.isin-2151"><a href="#Tuple.isin-2151"><span class="linenos">2151</span></a> <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">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="n">query</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">opts</span> -</span><span id="Tuple.isin-2152"><a href="#Tuple.isin-2152"><span class="linenos">2152</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">In</span><span class="p">:</span> -</span><span id="Tuple.isin-2153"><a href="#Tuple.isin-2153"><span class="linenos">2153</span></a> <span class="k">return</span> <span class="n">In</span><span class="p">(</span> -</span><span id="Tuple.isin-2154"><a href="#Tuple.isin-2154"><span class="linenos">2154</span></a> <span class="n">this</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="Tuple.isin-2155"><a href="#Tuple.isin-2155"><span class="linenos">2155</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">e</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">],</span> -</span><span id="Tuple.isin-2156"><a href="#Tuple.isin-2156"><span class="linenos">2156</span></a> <span class="n">query</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">if</span> <span class="n">query</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Tuple.isin-2157"><a href="#Tuple.isin-2157"><span class="linenos">2157</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Tuple.isin-2148"><a href="#Tuple.isin-2148"><span class="linenos">2148</span></a> <span class="k">def</span> <span class="nf">isin</span><span class="p">(</span> +</span><span id="Tuple.isin-2149"><a href="#Tuple.isin-2149"><span class="linenos">2149</span></a> <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">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="n">query</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">opts</span> +</span><span id="Tuple.isin-2150"><a href="#Tuple.isin-2150"><span class="linenos">2150</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">In</span><span class="p">:</span> +</span><span id="Tuple.isin-2151"><a href="#Tuple.isin-2151"><span class="linenos">2151</span></a> <span class="k">return</span> <span class="n">In</span><span class="p">(</span> +</span><span id="Tuple.isin-2152"><a href="#Tuple.isin-2152"><span class="linenos">2152</span></a> <span class="n">this</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="Tuple.isin-2153"><a href="#Tuple.isin-2153"><span class="linenos">2153</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">e</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">],</span> +</span><span id="Tuple.isin-2154"><a href="#Tuple.isin-2154"><span class="linenos">2154</span></a> <span class="n">query</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">if</span> <span class="n">query</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Tuple.isin-2155"><a href="#Tuple.isin-2155"><span class="linenos">2155</span></a> <span class="p">)</span> </span></pre></div> @@ -30465,84 +30477,84 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Subqueryable"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Subqueryable-2160"><a href="#Subqueryable-2160"><span class="linenos">2160</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-2161"><a href="#Subqueryable-2161"><span class="linenos">2161</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="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">Subquery</span><span class="p">:</span> -</span><span id="Subqueryable-2162"><a href="#Subqueryable-2162"><span class="linenos">2162</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Subqueryable-2163"><a href="#Subqueryable-2163"><span class="linenos">2163</span></a><span class="sd"> Convert this expression to an aliased expression that can be used as a Subquery.</span> -</span><span id="Subqueryable-2164"><a href="#Subqueryable-2164"><span class="linenos">2164</span></a> -</span><span id="Subqueryable-2165"><a href="#Subqueryable-2165"><span class="linenos">2165</span></a><span class="sd"> Example:</span> -</span><span id="Subqueryable-2166"><a href="#Subqueryable-2166"><span class="linenos">2166</span></a><span class="sd"> >>> subquery = Select().select("x").from_("tbl").subquery()</span> -</span><span id="Subqueryable-2167"><a href="#Subqueryable-2167"><span class="linenos">2167</span></a><span class="sd"> >>> Select().select("x").from_(subquery).sql()</span> -</span><span id="Subqueryable-2168"><a href="#Subqueryable-2168"><span class="linenos">2168</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl)'</span> -</span><span id="Subqueryable-2169"><a href="#Subqueryable-2169"><span class="linenos">2169</span></a> -</span><span id="Subqueryable-2170"><a href="#Subqueryable-2170"><span class="linenos">2170</span></a><span class="sd"> Args:</span> -</span><span id="Subqueryable-2171"><a href="#Subqueryable-2171"><span class="linenos">2171</span></a><span class="sd"> alias (str | Identifier): an optional alias for the subquery</span> -</span><span id="Subqueryable-2172"><a href="#Subqueryable-2172"><span class="linenos">2172</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Subqueryable-2173"><a href="#Subqueryable-2173"><span class="linenos">2173</span></a> -</span><span id="Subqueryable-2174"><a href="#Subqueryable-2174"><span class="linenos">2174</span></a><span class="sd"> Returns:</span> -</span><span id="Subqueryable-2175"><a href="#Subqueryable-2175"><span class="linenos">2175</span></a><span class="sd"> Alias: the subquery</span> -</span><span id="Subqueryable-2176"><a href="#Subqueryable-2176"><span class="linenos">2176</span></a><span class="sd"> """</span> -</span><span id="Subqueryable-2177"><a href="#Subqueryable-2177"><span class="linenos">2177</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-2178"><a href="#Subqueryable-2178"><span class="linenos">2178</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">alias</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="Subqueryable-2179"><a href="#Subqueryable-2179"><span class="linenos">2179</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="Subqueryable-2158"><a href="#Subqueryable-2158"><span class="linenos">2158</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-2159"><a href="#Subqueryable-2159"><span class="linenos">2159</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="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">Subquery</span><span class="p">:</span> +</span><span id="Subqueryable-2160"><a href="#Subqueryable-2160"><span class="linenos">2160</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Subqueryable-2161"><a href="#Subqueryable-2161"><span class="linenos">2161</span></a><span class="sd"> Convert this expression to an aliased expression that can be used as a Subquery.</span> +</span><span id="Subqueryable-2162"><a href="#Subqueryable-2162"><span class="linenos">2162</span></a> +</span><span id="Subqueryable-2163"><a href="#Subqueryable-2163"><span class="linenos">2163</span></a><span class="sd"> Example:</span> +</span><span id="Subqueryable-2164"><a href="#Subqueryable-2164"><span class="linenos">2164</span></a><span class="sd"> >>> subquery = Select().select("x").from_("tbl").subquery()</span> +</span><span id="Subqueryable-2165"><a href="#Subqueryable-2165"><span class="linenos">2165</span></a><span class="sd"> >>> Select().select("x").from_(subquery).sql()</span> +</span><span id="Subqueryable-2166"><a href="#Subqueryable-2166"><span class="linenos">2166</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl)'</span> +</span><span id="Subqueryable-2167"><a href="#Subqueryable-2167"><span class="linenos">2167</span></a> +</span><span id="Subqueryable-2168"><a href="#Subqueryable-2168"><span class="linenos">2168</span></a><span class="sd"> Args:</span> +</span><span id="Subqueryable-2169"><a href="#Subqueryable-2169"><span class="linenos">2169</span></a><span class="sd"> alias (str | Identifier): an optional alias for the subquery</span> +</span><span id="Subqueryable-2170"><a href="#Subqueryable-2170"><span class="linenos">2170</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Subqueryable-2171"><a href="#Subqueryable-2171"><span class="linenos">2171</span></a> +</span><span id="Subqueryable-2172"><a href="#Subqueryable-2172"><span class="linenos">2172</span></a><span class="sd"> Returns:</span> +</span><span id="Subqueryable-2173"><a href="#Subqueryable-2173"><span class="linenos">2173</span></a><span class="sd"> Alias: the subquery</span> +</span><span id="Subqueryable-2174"><a href="#Subqueryable-2174"><span class="linenos">2174</span></a><span class="sd"> """</span> +</span><span id="Subqueryable-2175"><a href="#Subqueryable-2175"><span class="linenos">2175</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-2176"><a href="#Subqueryable-2176"><span class="linenos">2176</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">alias</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="Subqueryable-2177"><a href="#Subqueryable-2177"><span class="linenos">2177</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><span id="Subqueryable-2178"><a href="#Subqueryable-2178"><span class="linenos">2178</span></a> +</span><span id="Subqueryable-2179"><a href="#Subqueryable-2179"><span class="linenos">2179</span></a> <span class="k">return</span> <span class="n">Subquery</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">instance</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="Subqueryable-2180"><a href="#Subqueryable-2180"><span class="linenos">2180</span></a> -</span><span id="Subqueryable-2181"><a href="#Subqueryable-2181"><span class="linenos">2181</span></a> <span class="k">return</span> <span class="n">Subquery</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">instance</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="Subqueryable-2182"><a href="#Subqueryable-2182"><span class="linenos">2182</span></a> -</span><span id="Subqueryable-2183"><a href="#Subqueryable-2183"><span class="linenos">2183</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> -</span><span id="Subqueryable-2184"><a href="#Subqueryable-2184"><span class="linenos">2184</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> -</span><span id="Subqueryable-2185"><a href="#Subqueryable-2185"><span class="linenos">2185</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Subqueryable-2186"><a href="#Subqueryable-2186"><span class="linenos">2186</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span> -</span><span id="Subqueryable-2187"><a href="#Subqueryable-2187"><span class="linenos">2187</span></a> -</span><span id="Subqueryable-2188"><a href="#Subqueryable-2188"><span class="linenos">2188</span></a> <span class="nd">@property</span> -</span><span id="Subqueryable-2189"><a href="#Subqueryable-2189"><span class="linenos">2189</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-2190"><a href="#Subqueryable-2190"><span class="linenos">2190</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-2191"><a href="#Subqueryable-2191"><span class="linenos">2191</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-2192"><a href="#Subqueryable-2192"><span class="linenos">2192</span></a> <span class="k">return</span> <span class="p">[]</span> -</span><span id="Subqueryable-2193"><a href="#Subqueryable-2193"><span class="linenos">2193</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-2194"><a href="#Subqueryable-2194"><span class="linenos">2194</span></a> -</span><span id="Subqueryable-2195"><a href="#Subqueryable-2195"><span class="linenos">2195</span></a> <span class="nd">@property</span> -</span><span id="Subqueryable-2196"><a href="#Subqueryable-2196"><span class="linenos">2196</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-2197"><a href="#Subqueryable-2197"><span class="linenos">2197</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-2198"><a href="#Subqueryable-2198"><span class="linenos">2198</span></a> -</span><span id="Subqueryable-2199"><a href="#Subqueryable-2199"><span class="linenos">2199</span></a> <span class="nd">@property</span> -</span><span id="Subqueryable-2200"><a href="#Subqueryable-2200"><span class="linenos">2200</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-2201"><a href="#Subqueryable-2201"><span class="linenos">2201</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-2202"><a href="#Subqueryable-2202"><span class="linenos">2202</span></a> -</span><span id="Subqueryable-2203"><a href="#Subqueryable-2203"><span class="linenos">2203</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> -</span><span id="Subqueryable-2204"><a href="#Subqueryable-2204"><span class="linenos">2204</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Subqueryable-2205"><a href="#Subqueryable-2205"><span class="linenos">2205</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Subqueryable-2206"><a href="#Subqueryable-2206"><span class="linenos">2206</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Subqueryable-2207"><a href="#Subqueryable-2207"><span class="linenos">2207</span></a> <span class="n">recursive</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="Subqueryable-2208"><a href="#Subqueryable-2208"><span class="linenos">2208</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="Subqueryable-2209"><a href="#Subqueryable-2209"><span class="linenos">2209</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="Subqueryable-2210"><a href="#Subqueryable-2210"><span class="linenos">2210</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="Subqueryable-2211"><a href="#Subqueryable-2211"><span class="linenos">2211</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Subqueryable-2212"><a href="#Subqueryable-2212"><span class="linenos">2212</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Subqueryable</span><span class="p">:</span> -</span><span id="Subqueryable-2213"><a href="#Subqueryable-2213"><span class="linenos">2213</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Subqueryable-2214"><a href="#Subqueryable-2214"><span class="linenos">2214</span></a><span class="sd"> Append to or set the common table expressions.</span> -</span><span id="Subqueryable-2215"><a href="#Subqueryable-2215"><span class="linenos">2215</span></a> -</span><span id="Subqueryable-2216"><a href="#Subqueryable-2216"><span class="linenos">2216</span></a><span class="sd"> Example:</span> -</span><span id="Subqueryable-2217"><a href="#Subqueryable-2217"><span class="linenos">2217</span></a><span class="sd"> >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()</span> -</span><span id="Subqueryable-2218"><a href="#Subqueryable-2218"><span class="linenos">2218</span></a><span class="sd"> 'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'</span> -</span><span id="Subqueryable-2219"><a href="#Subqueryable-2219"><span class="linenos">2219</span></a> -</span><span id="Subqueryable-2220"><a href="#Subqueryable-2220"><span class="linenos">2220</span></a><span class="sd"> Args:</span> -</span><span id="Subqueryable-2221"><a href="#Subqueryable-2221"><span class="linenos">2221</span></a><span class="sd"> alias: the SQL code string to parse as the table name.</span> -</span><span id="Subqueryable-2222"><a href="#Subqueryable-2222"><span class="linenos">2222</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> -</span><span id="Subqueryable-2223"><a href="#Subqueryable-2223"><span class="linenos">2223</span></a><span class="sd"> as_: the SQL code string to parse as the table expression.</span> -</span><span id="Subqueryable-2224"><a href="#Subqueryable-2224"><span class="linenos">2224</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Subqueryable-2225"><a href="#Subqueryable-2225"><span class="linenos">2225</span></a><span class="sd"> recursive: set the RECURSIVE part of the expression. Defaults to `False`.</span> -</span><span id="Subqueryable-2226"><a href="#Subqueryable-2226"><span class="linenos">2226</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Subqueryable-2227"><a href="#Subqueryable-2227"><span class="linenos">2227</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Subqueryable-2228"><a href="#Subqueryable-2228"><span class="linenos">2228</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Subqueryable-2229"><a href="#Subqueryable-2229"><span class="linenos">2229</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Subqueryable-2230"><a href="#Subqueryable-2230"><span class="linenos">2230</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Subqueryable-2231"><a href="#Subqueryable-2231"><span class="linenos">2231</span></a> -</span><span id="Subqueryable-2232"><a href="#Subqueryable-2232"><span class="linenos">2232</span></a><span class="sd"> Returns:</span> -</span><span id="Subqueryable-2233"><a href="#Subqueryable-2233"><span class="linenos">2233</span></a><span class="sd"> The modified expression.</span> -</span><span id="Subqueryable-2234"><a href="#Subqueryable-2234"><span class="linenos">2234</span></a><span class="sd"> """</span> -</span><span id="Subqueryable-2235"><a href="#Subqueryable-2235"><span class="linenos">2235</span></a> <span class="k">return</span> <span class="n">_apply_cte_builder</span><span class="p">(</span> -</span><span id="Subqueryable-2236"><a href="#Subqueryable-2236"><span class="linenos">2236</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="p">,</span> <span class="n">as_</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="n">recursive</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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> -</span><span id="Subqueryable-2237"><a href="#Subqueryable-2237"><span class="linenos">2237</span></a> <span class="p">)</span> +</span><span id="Subqueryable-2181"><a href="#Subqueryable-2181"><span class="linenos">2181</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> +</span><span id="Subqueryable-2182"><a href="#Subqueryable-2182"><span class="linenos">2182</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> +</span><span id="Subqueryable-2183"><a href="#Subqueryable-2183"><span class="linenos">2183</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Subqueryable-2184"><a href="#Subqueryable-2184"><span class="linenos">2184</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span> +</span><span id="Subqueryable-2185"><a href="#Subqueryable-2185"><span class="linenos">2185</span></a> +</span><span id="Subqueryable-2186"><a href="#Subqueryable-2186"><span class="linenos">2186</span></a> <span class="nd">@property</span> +</span><span id="Subqueryable-2187"><a href="#Subqueryable-2187"><span class="linenos">2187</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-2188"><a href="#Subqueryable-2188"><span class="linenos">2188</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-2189"><a href="#Subqueryable-2189"><span class="linenos">2189</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-2190"><a href="#Subqueryable-2190"><span class="linenos">2190</span></a> <span class="k">return</span> <span class="p">[]</span> +</span><span id="Subqueryable-2191"><a href="#Subqueryable-2191"><span class="linenos">2191</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-2192"><a href="#Subqueryable-2192"><span class="linenos">2192</span></a> +</span><span id="Subqueryable-2193"><a href="#Subqueryable-2193"><span class="linenos">2193</span></a> <span class="nd">@property</span> +</span><span id="Subqueryable-2194"><a href="#Subqueryable-2194"><span class="linenos">2194</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-2195"><a href="#Subqueryable-2195"><span class="linenos">2195</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-2196"><a href="#Subqueryable-2196"><span class="linenos">2196</span></a> +</span><span id="Subqueryable-2197"><a href="#Subqueryable-2197"><span class="linenos">2197</span></a> <span class="nd">@property</span> +</span><span id="Subqueryable-2198"><a href="#Subqueryable-2198"><span class="linenos">2198</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-2199"><a href="#Subqueryable-2199"><span class="linenos">2199</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-2200"><a href="#Subqueryable-2200"><span class="linenos">2200</span></a> +</span><span id="Subqueryable-2201"><a href="#Subqueryable-2201"><span class="linenos">2201</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> +</span><span id="Subqueryable-2202"><a href="#Subqueryable-2202"><span class="linenos">2202</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Subqueryable-2203"><a href="#Subqueryable-2203"><span class="linenos">2203</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Subqueryable-2204"><a href="#Subqueryable-2204"><span class="linenos">2204</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Subqueryable-2205"><a href="#Subqueryable-2205"><span class="linenos">2205</span></a> <span class="n">recursive</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="Subqueryable-2206"><a href="#Subqueryable-2206"><span class="linenos">2206</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="Subqueryable-2207"><a href="#Subqueryable-2207"><span class="linenos">2207</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="Subqueryable-2208"><a href="#Subqueryable-2208"><span class="linenos">2208</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="Subqueryable-2209"><a href="#Subqueryable-2209"><span class="linenos">2209</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Subqueryable-2210"><a href="#Subqueryable-2210"><span class="linenos">2210</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Subqueryable</span><span class="p">:</span> +</span><span id="Subqueryable-2211"><a href="#Subqueryable-2211"><span class="linenos">2211</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Subqueryable-2212"><a href="#Subqueryable-2212"><span class="linenos">2212</span></a><span class="sd"> Append to or set the common table expressions.</span> +</span><span id="Subqueryable-2213"><a href="#Subqueryable-2213"><span class="linenos">2213</span></a> +</span><span id="Subqueryable-2214"><a href="#Subqueryable-2214"><span class="linenos">2214</span></a><span class="sd"> Example:</span> +</span><span id="Subqueryable-2215"><a href="#Subqueryable-2215"><span class="linenos">2215</span></a><span class="sd"> >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()</span> +</span><span id="Subqueryable-2216"><a href="#Subqueryable-2216"><span class="linenos">2216</span></a><span class="sd"> 'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'</span> +</span><span id="Subqueryable-2217"><a href="#Subqueryable-2217"><span class="linenos">2217</span></a> +</span><span id="Subqueryable-2218"><a href="#Subqueryable-2218"><span class="linenos">2218</span></a><span class="sd"> Args:</span> +</span><span id="Subqueryable-2219"><a href="#Subqueryable-2219"><span class="linenos">2219</span></a><span class="sd"> alias: the SQL code string to parse as the table name.</span> +</span><span id="Subqueryable-2220"><a href="#Subqueryable-2220"><span class="linenos">2220</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> +</span><span id="Subqueryable-2221"><a href="#Subqueryable-2221"><span class="linenos">2221</span></a><span class="sd"> as_: the SQL code string to parse as the table expression.</span> +</span><span id="Subqueryable-2222"><a href="#Subqueryable-2222"><span class="linenos">2222</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Subqueryable-2223"><a href="#Subqueryable-2223"><span class="linenos">2223</span></a><span class="sd"> recursive: set the RECURSIVE part of the expression. Defaults to `False`.</span> +</span><span id="Subqueryable-2224"><a href="#Subqueryable-2224"><span class="linenos">2224</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Subqueryable-2225"><a href="#Subqueryable-2225"><span class="linenos">2225</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Subqueryable-2226"><a href="#Subqueryable-2226"><span class="linenos">2226</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Subqueryable-2227"><a href="#Subqueryable-2227"><span class="linenos">2227</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Subqueryable-2228"><a href="#Subqueryable-2228"><span class="linenos">2228</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Subqueryable-2229"><a href="#Subqueryable-2229"><span class="linenos">2229</span></a> +</span><span id="Subqueryable-2230"><a href="#Subqueryable-2230"><span class="linenos">2230</span></a><span class="sd"> Returns:</span> +</span><span id="Subqueryable-2231"><a href="#Subqueryable-2231"><span class="linenos">2231</span></a><span class="sd"> The modified expression.</span> +</span><span id="Subqueryable-2232"><a href="#Subqueryable-2232"><span class="linenos">2232</span></a><span class="sd"> """</span> +</span><span id="Subqueryable-2233"><a href="#Subqueryable-2233"><span class="linenos">2233</span></a> <span class="k">return</span> <span class="n">_apply_cte_builder</span><span class="p">(</span> +</span><span id="Subqueryable-2234"><a href="#Subqueryable-2234"><span class="linenos">2234</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="p">,</span> <span class="n">as_</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="n">recursive</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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> +</span><span id="Subqueryable-2235"><a href="#Subqueryable-2235"><span class="linenos">2235</span></a> <span class="p">)</span> </span></pre></div> @@ -30559,27 +30571,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-2161"><a href="#Subqueryable.subquery-2161"><span class="linenos">2161</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="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">Subquery</span><span class="p">:</span> -</span><span id="Subqueryable.subquery-2162"><a href="#Subqueryable.subquery-2162"><span class="linenos">2162</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Subqueryable.subquery-2163"><a href="#Subqueryable.subquery-2163"><span class="linenos">2163</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-2164"><a href="#Subqueryable.subquery-2164"><span class="linenos">2164</span></a> -</span><span id="Subqueryable.subquery-2165"><a href="#Subqueryable.subquery-2165"><span class="linenos">2165</span></a><span class="sd"> Example:</span> -</span><span id="Subqueryable.subquery-2166"><a href="#Subqueryable.subquery-2166"><span class="linenos">2166</span></a><span class="sd"> >>> subquery = Select().select("x").from_("tbl").subquery()</span> -</span><span id="Subqueryable.subquery-2167"><a href="#Subqueryable.subquery-2167"><span class="linenos">2167</span></a><span class="sd"> >>> Select().select("x").from_(subquery).sql()</span> -</span><span id="Subqueryable.subquery-2168"><a href="#Subqueryable.subquery-2168"><span class="linenos">2168</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl)'</span> -</span><span id="Subqueryable.subquery-2169"><a href="#Subqueryable.subquery-2169"><span class="linenos">2169</span></a> -</span><span id="Subqueryable.subquery-2170"><a href="#Subqueryable.subquery-2170"><span class="linenos">2170</span></a><span class="sd"> Args:</span> -</span><span id="Subqueryable.subquery-2171"><a href="#Subqueryable.subquery-2171"><span class="linenos">2171</span></a><span class="sd"> alias (str | Identifier): an optional alias for the subquery</span> -</span><span id="Subqueryable.subquery-2172"><a href="#Subqueryable.subquery-2172"><span class="linenos">2172</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Subqueryable.subquery-2173"><a href="#Subqueryable.subquery-2173"><span class="linenos">2173</span></a> -</span><span id="Subqueryable.subquery-2174"><a href="#Subqueryable.subquery-2174"><span class="linenos">2174</span></a><span class="sd"> Returns:</span> -</span><span id="Subqueryable.subquery-2175"><a href="#Subqueryable.subquery-2175"><span class="linenos">2175</span></a><span class="sd"> Alias: the subquery</span> -</span><span id="Subqueryable.subquery-2176"><a href="#Subqueryable.subquery-2176"><span class="linenos">2176</span></a><span class="sd"> """</span> -</span><span id="Subqueryable.subquery-2177"><a href="#Subqueryable.subquery-2177"><span class="linenos">2177</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-2178"><a href="#Subqueryable.subquery-2178"><span class="linenos">2178</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">alias</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="Subqueryable.subquery-2179"><a href="#Subqueryable.subquery-2179"><span class="linenos">2179</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><span id="Subqueryable.subquery-2180"><a href="#Subqueryable.subquery-2180"><span class="linenos">2180</span></a> -</span><span id="Subqueryable.subquery-2181"><a href="#Subqueryable.subquery-2181"><span class="linenos">2181</span></a> <span class="k">return</span> <span class="n">Subquery</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">instance</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="Subqueryable.subquery-2159"><a href="#Subqueryable.subquery-2159"><span class="linenos">2159</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="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</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">Subquery</span><span class="p">:</span> +</span><span id="Subqueryable.subquery-2160"><a href="#Subqueryable.subquery-2160"><span class="linenos">2160</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Subqueryable.subquery-2161"><a href="#Subqueryable.subquery-2161"><span class="linenos">2161</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-2162"><a href="#Subqueryable.subquery-2162"><span class="linenos">2162</span></a> +</span><span id="Subqueryable.subquery-2163"><a href="#Subqueryable.subquery-2163"><span class="linenos">2163</span></a><span class="sd"> Example:</span> +</span><span id="Subqueryable.subquery-2164"><a href="#Subqueryable.subquery-2164"><span class="linenos">2164</span></a><span class="sd"> >>> subquery = Select().select("x").from_("tbl").subquery()</span> +</span><span id="Subqueryable.subquery-2165"><a href="#Subqueryable.subquery-2165"><span class="linenos">2165</span></a><span class="sd"> >>> Select().select("x").from_(subquery).sql()</span> +</span><span id="Subqueryable.subquery-2166"><a href="#Subqueryable.subquery-2166"><span class="linenos">2166</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl)'</span> +</span><span id="Subqueryable.subquery-2167"><a href="#Subqueryable.subquery-2167"><span class="linenos">2167</span></a> +</span><span id="Subqueryable.subquery-2168"><a href="#Subqueryable.subquery-2168"><span class="linenos">2168</span></a><span class="sd"> Args:</span> +</span><span id="Subqueryable.subquery-2169"><a href="#Subqueryable.subquery-2169"><span class="linenos">2169</span></a><span class="sd"> alias (str | Identifier): an optional alias for the subquery</span> +</span><span id="Subqueryable.subquery-2170"><a href="#Subqueryable.subquery-2170"><span class="linenos">2170</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Subqueryable.subquery-2171"><a href="#Subqueryable.subquery-2171"><span class="linenos">2171</span></a> +</span><span id="Subqueryable.subquery-2172"><a href="#Subqueryable.subquery-2172"><span class="linenos">2172</span></a><span class="sd"> Returns:</span> +</span><span id="Subqueryable.subquery-2173"><a href="#Subqueryable.subquery-2173"><span class="linenos">2173</span></a><span class="sd"> Alias: the subquery</span> +</span><span id="Subqueryable.subquery-2174"><a href="#Subqueryable.subquery-2174"><span class="linenos">2174</span></a><span class="sd"> """</span> +</span><span id="Subqueryable.subquery-2175"><a href="#Subqueryable.subquery-2175"><span class="linenos">2175</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-2176"><a href="#Subqueryable.subquery-2176"><span class="linenos">2176</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">alias</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="Subqueryable.subquery-2177"><a href="#Subqueryable.subquery-2177"><span class="linenos">2177</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><span id="Subqueryable.subquery-2178"><a href="#Subqueryable.subquery-2178"><span class="linenos">2178</span></a> +</span><span id="Subqueryable.subquery-2179"><a href="#Subqueryable.subquery-2179"><span class="linenos">2179</span></a> <span class="k">return</span> <span class="n">Subquery</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">instance</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> @@ -30623,10 +30635,10 @@ 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-2183"><a href="#Subqueryable.limit-2183"><span class="linenos">2183</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> -</span><span id="Subqueryable.limit-2184"><a href="#Subqueryable.limit-2184"><span class="linenos">2184</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> -</span><span id="Subqueryable.limit-2185"><a href="#Subqueryable.limit-2185"><span class="linenos">2185</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Subqueryable.limit-2186"><a href="#Subqueryable.limit-2186"><span class="linenos">2186</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Subqueryable.limit-2181"><a href="#Subqueryable.limit-2181"><span class="linenos">2181</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> +</span><span id="Subqueryable.limit-2182"><a href="#Subqueryable.limit-2182"><span class="linenos">2182</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> +</span><span id="Subqueryable.limit-2183"><a href="#Subqueryable.limit-2183"><span class="linenos">2183</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Subqueryable.limit-2184"><a href="#Subqueryable.limit-2184"><span class="linenos">2184</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span> </span></pre></div> @@ -30677,41 +30689,41 @@ 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_-2203"><a href="#Subqueryable.with_-2203"><span class="linenos">2203</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> -</span><span id="Subqueryable.with_-2204"><a href="#Subqueryable.with_-2204"><span class="linenos">2204</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Subqueryable.with_-2205"><a href="#Subqueryable.with_-2205"><span class="linenos">2205</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Subqueryable.with_-2206"><a href="#Subqueryable.with_-2206"><span class="linenos">2206</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Subqueryable.with_-2207"><a href="#Subqueryable.with_-2207"><span class="linenos">2207</span></a> <span class="n">recursive</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="Subqueryable.with_-2208"><a href="#Subqueryable.with_-2208"><span class="linenos">2208</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="Subqueryable.with_-2209"><a href="#Subqueryable.with_-2209"><span class="linenos">2209</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="Subqueryable.with_-2210"><a href="#Subqueryable.with_-2210"><span class="linenos">2210</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="Subqueryable.with_-2211"><a href="#Subqueryable.with_-2211"><span class="linenos">2211</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Subqueryable.with_-2212"><a href="#Subqueryable.with_-2212"><span class="linenos">2212</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Subqueryable</span><span class="p">:</span> -</span><span id="Subqueryable.with_-2213"><a href="#Subqueryable.with_-2213"><span class="linenos">2213</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Subqueryable.with_-2214"><a href="#Subqueryable.with_-2214"><span class="linenos">2214</span></a><span class="sd"> Append to or set the common table expressions.</span> -</span><span id="Subqueryable.with_-2215"><a href="#Subqueryable.with_-2215"><span class="linenos">2215</span></a> -</span><span id="Subqueryable.with_-2216"><a href="#Subqueryable.with_-2216"><span class="linenos">2216</span></a><span class="sd"> Example:</span> -</span><span id="Subqueryable.with_-2217"><a href="#Subqueryable.with_-2217"><span class="linenos">2217</span></a><span class="sd"> >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()</span> -</span><span id="Subqueryable.with_-2218"><a href="#Subqueryable.with_-2218"><span class="linenos">2218</span></a><span class="sd"> 'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'</span> -</span><span id="Subqueryable.with_-2219"><a href="#Subqueryable.with_-2219"><span class="linenos">2219</span></a> -</span><span id="Subqueryable.with_-2220"><a href="#Subqueryable.with_-2220"><span class="linenos">2220</span></a><span class="sd"> Args:</span> -</span><span id="Subqueryable.with_-2221"><a href="#Subqueryable.with_-2221"><span class="linenos">2221</span></a><span class="sd"> alias: the SQL code string to parse as the table name.</span> -</span><span id="Subqueryable.with_-2222"><a href="#Subqueryable.with_-2222"><span class="linenos">2222</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> -</span><span id="Subqueryable.with_-2223"><a href="#Subqueryable.with_-2223"><span class="linenos">2223</span></a><span class="sd"> as_: the SQL code string to parse as the table expression.</span> -</span><span id="Subqueryable.with_-2224"><a href="#Subqueryable.with_-2224"><span class="linenos">2224</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Subqueryable.with_-2225"><a href="#Subqueryable.with_-2225"><span class="linenos">2225</span></a><span class="sd"> recursive: set the RECURSIVE part of the expression. Defaults to `False`.</span> -</span><span id="Subqueryable.with_-2226"><a href="#Subqueryable.with_-2226"><span class="linenos">2226</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Subqueryable.with_-2227"><a href="#Subqueryable.with_-2227"><span class="linenos">2227</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Subqueryable.with_-2228"><a href="#Subqueryable.with_-2228"><span class="linenos">2228</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Subqueryable.with_-2229"><a href="#Subqueryable.with_-2229"><span class="linenos">2229</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Subqueryable.with_-2230"><a href="#Subqueryable.with_-2230"><span class="linenos">2230</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Subqueryable.with_-2231"><a href="#Subqueryable.with_-2231"><span class="linenos">2231</span></a> -</span><span id="Subqueryable.with_-2232"><a href="#Subqueryable.with_-2232"><span class="linenos">2232</span></a><span class="sd"> Returns:</span> -</span><span id="Subqueryable.with_-2233"><a href="#Subqueryable.with_-2233"><span class="linenos">2233</span></a><span class="sd"> The modified expression.</span> -</span><span id="Subqueryable.with_-2234"><a href="#Subqueryable.with_-2234"><span class="linenos">2234</span></a><span class="sd"> """</span> -</span><span id="Subqueryable.with_-2235"><a href="#Subqueryable.with_-2235"><span class="linenos">2235</span></a> <span class="k">return</span> <span class="n">_apply_cte_builder</span><span class="p">(</span> -</span><span id="Subqueryable.with_-2236"><a href="#Subqueryable.with_-2236"><span class="linenos">2236</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="p">,</span> <span class="n">as_</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="n">recursive</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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> -</span><span id="Subqueryable.with_-2237"><a href="#Subqueryable.with_-2237"><span class="linenos">2237</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Subqueryable.with_-2201"><a href="#Subqueryable.with_-2201"><span class="linenos">2201</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> +</span><span id="Subqueryable.with_-2202"><a href="#Subqueryable.with_-2202"><span class="linenos">2202</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Subqueryable.with_-2203"><a href="#Subqueryable.with_-2203"><span class="linenos">2203</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Subqueryable.with_-2204"><a href="#Subqueryable.with_-2204"><span class="linenos">2204</span></a> <span class="n">as_</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Subqueryable.with_-2205"><a href="#Subqueryable.with_-2205"><span class="linenos">2205</span></a> <span class="n">recursive</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="Subqueryable.with_-2206"><a href="#Subqueryable.with_-2206"><span class="linenos">2206</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="Subqueryable.with_-2207"><a href="#Subqueryable.with_-2207"><span class="linenos">2207</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="Subqueryable.with_-2208"><a href="#Subqueryable.with_-2208"><span class="linenos">2208</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="Subqueryable.with_-2209"><a href="#Subqueryable.with_-2209"><span class="linenos">2209</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Subqueryable.with_-2210"><a href="#Subqueryable.with_-2210"><span class="linenos">2210</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Subqueryable</span><span class="p">:</span> +</span><span id="Subqueryable.with_-2211"><a href="#Subqueryable.with_-2211"><span class="linenos">2211</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Subqueryable.with_-2212"><a href="#Subqueryable.with_-2212"><span class="linenos">2212</span></a><span class="sd"> Append to or set the common table expressions.</span> +</span><span id="Subqueryable.with_-2213"><a href="#Subqueryable.with_-2213"><span class="linenos">2213</span></a> +</span><span id="Subqueryable.with_-2214"><a href="#Subqueryable.with_-2214"><span class="linenos">2214</span></a><span class="sd"> Example:</span> +</span><span id="Subqueryable.with_-2215"><a href="#Subqueryable.with_-2215"><span class="linenos">2215</span></a><span class="sd"> >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()</span> +</span><span id="Subqueryable.with_-2216"><a href="#Subqueryable.with_-2216"><span class="linenos">2216</span></a><span class="sd"> 'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'</span> +</span><span id="Subqueryable.with_-2217"><a href="#Subqueryable.with_-2217"><span class="linenos">2217</span></a> +</span><span id="Subqueryable.with_-2218"><a href="#Subqueryable.with_-2218"><span class="linenos">2218</span></a><span class="sd"> Args:</span> +</span><span id="Subqueryable.with_-2219"><a href="#Subqueryable.with_-2219"><span class="linenos">2219</span></a><span class="sd"> alias: the SQL code string to parse as the table name.</span> +</span><span id="Subqueryable.with_-2220"><a href="#Subqueryable.with_-2220"><span class="linenos">2220</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> +</span><span id="Subqueryable.with_-2221"><a href="#Subqueryable.with_-2221"><span class="linenos">2221</span></a><span class="sd"> as_: the SQL code string to parse as the table expression.</span> +</span><span id="Subqueryable.with_-2222"><a href="#Subqueryable.with_-2222"><span class="linenos">2222</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Subqueryable.with_-2223"><a href="#Subqueryable.with_-2223"><span class="linenos">2223</span></a><span class="sd"> recursive: set the RECURSIVE part of the expression. Defaults to `False`.</span> +</span><span id="Subqueryable.with_-2224"><a href="#Subqueryable.with_-2224"><span class="linenos">2224</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Subqueryable.with_-2225"><a href="#Subqueryable.with_-2225"><span class="linenos">2225</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Subqueryable.with_-2226"><a href="#Subqueryable.with_-2226"><span class="linenos">2226</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Subqueryable.with_-2227"><a href="#Subqueryable.with_-2227"><span class="linenos">2227</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Subqueryable.with_-2228"><a href="#Subqueryable.with_-2228"><span class="linenos">2228</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Subqueryable.with_-2229"><a href="#Subqueryable.with_-2229"><span class="linenos">2229</span></a> +</span><span id="Subqueryable.with_-2230"><a href="#Subqueryable.with_-2230"><span class="linenos">2230</span></a><span class="sd"> Returns:</span> +</span><span id="Subqueryable.with_-2231"><a href="#Subqueryable.with_-2231"><span class="linenos">2231</span></a><span class="sd"> The modified expression.</span> +</span><span id="Subqueryable.with_-2232"><a href="#Subqueryable.with_-2232"><span class="linenos">2232</span></a><span class="sd"> """</span> +</span><span id="Subqueryable.with_-2233"><a href="#Subqueryable.with_-2233"><span class="linenos">2233</span></a> <span class="k">return</span> <span class="n">_apply_cte_builder</span><span class="p">(</span> +</span><span id="Subqueryable.with_-2234"><a href="#Subqueryable.with_-2234"><span class="linenos">2234</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="p">,</span> <span class="n">as_</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="n">recursive</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="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> +</span><span id="Subqueryable.with_-2235"><a href="#Subqueryable.with_-2235"><span class="linenos">2235</span></a> <span class="p">)</span> </span></pre></div> @@ -30850,8 +30862,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#WithTableHint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="WithTableHint-2264"><a href="#WithTableHint-2264"><span class="linenos">2264</span></a><span class="k">class</span> <span class="nc">WithTableHint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="WithTableHint-2265"><a href="#WithTableHint-2265"><span class="linenos">2265</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="WithTableHint-2262"><a href="#WithTableHint-2262"><span class="linenos">2262</span></a><span class="k">class</span> <span class="nc">WithTableHint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="WithTableHint-2263"><a href="#WithTableHint-2263"><span class="linenos">2263</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> @@ -30948,8 +30960,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#IndexTableHint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="IndexTableHint-2269"><a href="#IndexTableHint-2269"><span class="linenos">2269</span></a><span class="k">class</span> <span class="nc">IndexTableHint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="IndexTableHint-2270"><a href="#IndexTableHint-2270"><span class="linenos">2270</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">"target"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="IndexTableHint-2267"><a href="#IndexTableHint-2267"><span class="linenos">2267</span></a><span class="k">class</span> <span class="nc">IndexTableHint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="IndexTableHint-2268"><a href="#IndexTableHint-2268"><span class="linenos">2268</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">"target"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -31046,41 +31058,41 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Table"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Table-2273"><a href="#Table-2273"><span class="linenos">2273</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-2274"><a href="#Table-2274"><span class="linenos">2274</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Table-2275"><a href="#Table-2275"><span class="linenos">2275</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Table-2276"><a href="#Table-2276"><span class="linenos">2276</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-2277"><a href="#Table-2277"><span class="linenos">2277</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-2278"><a href="#Table-2278"><span class="linenos">2278</span></a> <span class="s2">"catalog"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-2279"><a href="#Table-2279"><span class="linenos">2279</span></a> <span class="s2">"laterals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-2280"><a href="#Table-2280"><span class="linenos">2280</span></a> <span class="s2">"joins"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-2281"><a href="#Table-2281"><span class="linenos">2281</span></a> <span class="s2">"pivots"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-2282"><a href="#Table-2282"><span class="linenos">2282</span></a> <span class="s2">"hints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-2283"><a href="#Table-2283"><span class="linenos">2283</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-2284"><a href="#Table-2284"><span class="linenos">2284</span></a> <span class="p">}</span> -</span><span id="Table-2285"><a href="#Table-2285"><span class="linenos">2285</span></a> -</span><span id="Table-2286"><a href="#Table-2286"><span class="linenos">2286</span></a> <span class="nd">@property</span> -</span><span id="Table-2287"><a href="#Table-2287"><span class="linenos">2287</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="Table-2288"><a href="#Table-2288"><span class="linenos">2288</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">this</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> -</span><span id="Table-2289"><a href="#Table-2289"><span class="linenos">2289</span></a> <span class="k">return</span> <span class="s2">""</span> -</span><span id="Table-2290"><a href="#Table-2290"><span class="linenos">2290</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="Table-2291"><a href="#Table-2291"><span class="linenos">2291</span></a> -</span><span id="Table-2292"><a href="#Table-2292"><span class="linenos">2292</span></a> <span class="nd">@property</span> -</span><span id="Table-2293"><a href="#Table-2293"><span class="linenos">2293</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-2294"><a href="#Table-2294"><span class="linenos">2294</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-2295"><a href="#Table-2295"><span class="linenos">2295</span></a> -</span><span id="Table-2296"><a href="#Table-2296"><span class="linenos">2296</span></a> <span class="nd">@property</span> -</span><span id="Table-2297"><a href="#Table-2297"><span class="linenos">2297</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-2298"><a href="#Table-2298"><span class="linenos">2298</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="Table-2299"><a href="#Table-2299"><span class="linenos">2299</span></a> -</span><span id="Table-2300"><a href="#Table-2300"><span class="linenos">2300</span></a> <span class="nd">@property</span> -</span><span id="Table-2301"><a href="#Table-2301"><span class="linenos">2301</span></a> <span class="k">def</span> <span class="nf">parts</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">Identifier</span><span class="p">]:</span> -</span><span id="Table-2302"><a href="#Table-2302"><span class="linenos">2302</span></a><span class="w"> </span><span class="sd">"""Return the parts of a table in order catalog, db, table."""</span> -</span><span id="Table-2303"><a href="#Table-2303"><span class="linenos">2303</span></a> <span class="k">return</span> <span class="p">[</span> -</span><span id="Table-2304"><a href="#Table-2304"><span class="linenos">2304</span></a> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Identifier</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="n">part</span><span class="p">])</span> -</span><span id="Table-2305"><a href="#Table-2305"><span class="linenos">2305</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"catalog"</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> -</span><span id="Table-2306"><a href="#Table-2306"><span class="linenos">2306</span></a> <span class="k">if</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">part</span><span class="p">)</span> -</span><span id="Table-2307"><a href="#Table-2307"><span class="linenos">2307</span></a> <span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Table-2271"><a href="#Table-2271"><span class="linenos">2271</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-2272"><a href="#Table-2272"><span class="linenos">2272</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Table-2273"><a href="#Table-2273"><span class="linenos">2273</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Table-2274"><a href="#Table-2274"><span class="linenos">2274</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-2275"><a href="#Table-2275"><span class="linenos">2275</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-2276"><a href="#Table-2276"><span class="linenos">2276</span></a> <span class="s2">"catalog"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-2277"><a href="#Table-2277"><span class="linenos">2277</span></a> <span class="s2">"laterals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-2278"><a href="#Table-2278"><span class="linenos">2278</span></a> <span class="s2">"joins"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-2279"><a href="#Table-2279"><span class="linenos">2279</span></a> <span class="s2">"pivots"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-2280"><a href="#Table-2280"><span class="linenos">2280</span></a> <span class="s2">"hints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-2281"><a href="#Table-2281"><span class="linenos">2281</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-2282"><a href="#Table-2282"><span class="linenos">2282</span></a> <span class="p">}</span> +</span><span id="Table-2283"><a href="#Table-2283"><span class="linenos">2283</span></a> +</span><span id="Table-2284"><a href="#Table-2284"><span class="linenos">2284</span></a> <span class="nd">@property</span> +</span><span id="Table-2285"><a href="#Table-2285"><span class="linenos">2285</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="Table-2286"><a href="#Table-2286"><span class="linenos">2286</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">this</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> +</span><span id="Table-2287"><a href="#Table-2287"><span class="linenos">2287</span></a> <span class="k">return</span> <span class="s2">""</span> +</span><span id="Table-2288"><a href="#Table-2288"><span class="linenos">2288</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="Table-2289"><a href="#Table-2289"><span class="linenos">2289</span></a> +</span><span id="Table-2290"><a href="#Table-2290"><span class="linenos">2290</span></a> <span class="nd">@property</span> +</span><span id="Table-2291"><a href="#Table-2291"><span class="linenos">2291</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-2292"><a href="#Table-2292"><span class="linenos">2292</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-2293"><a href="#Table-2293"><span class="linenos">2293</span></a> +</span><span id="Table-2294"><a href="#Table-2294"><span class="linenos">2294</span></a> <span class="nd">@property</span> +</span><span id="Table-2295"><a href="#Table-2295"><span class="linenos">2295</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-2296"><a href="#Table-2296"><span class="linenos">2296</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="Table-2297"><a href="#Table-2297"><span class="linenos">2297</span></a> +</span><span id="Table-2298"><a href="#Table-2298"><span class="linenos">2298</span></a> <span class="nd">@property</span> +</span><span id="Table-2299"><a href="#Table-2299"><span class="linenos">2299</span></a> <span class="k">def</span> <span class="nf">parts</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">Identifier</span><span class="p">]:</span> +</span><span id="Table-2300"><a href="#Table-2300"><span class="linenos">2300</span></a><span class="w"> </span><span class="sd">"""Return the parts of a table in order catalog, db, table."""</span> +</span><span id="Table-2301"><a href="#Table-2301"><span class="linenos">2301</span></a> <span class="k">return</span> <span class="p">[</span> +</span><span id="Table-2302"><a href="#Table-2302"><span class="linenos">2302</span></a> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Identifier</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="n">part</span><span class="p">])</span> +</span><span id="Table-2303"><a href="#Table-2303"><span class="linenos">2303</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"catalog"</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">)</span> +</span><span id="Table-2304"><a href="#Table-2304"><span class="linenos">2304</span></a> <span class="k">if</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">part</span><span class="p">)</span> +</span><span id="Table-2305"><a href="#Table-2305"><span class="linenos">2305</span></a> <span class="p">]</span> </span></pre></div> @@ -31223,12 +31235,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-2311"><a href="#SystemTime-2311"><span class="linenos">2311</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-2312"><a href="#SystemTime-2312"><span class="linenos">2312</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="SystemTime-2313"><a href="#SystemTime-2313"><span class="linenos">2313</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="SystemTime-2314"><a href="#SystemTime-2314"><span class="linenos">2314</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="SystemTime-2315"><a href="#SystemTime-2315"><span class="linenos">2315</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="SystemTime-2316"><a href="#SystemTime-2316"><span class="linenos">2316</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SystemTime-2309"><a href="#SystemTime-2309"><span class="linenos">2309</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-2310"><a href="#SystemTime-2310"><span class="linenos">2310</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="SystemTime-2311"><a href="#SystemTime-2311"><span class="linenos">2311</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="SystemTime-2312"><a href="#SystemTime-2312"><span class="linenos">2312</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="SystemTime-2313"><a href="#SystemTime-2313"><span class="linenos">2313</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="SystemTime-2314"><a href="#SystemTime-2314"><span class="linenos">2314</span></a> <span class="p">}</span> </span></pre></div> @@ -31325,96 +31337,96 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Union"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Union-2319"><a href="#Union-2319"><span class="linenos">2319</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-2320"><a href="#Union-2320"><span class="linenos">2320</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Union-2321"><a href="#Union-2321"><span class="linenos">2321</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Union-2322"><a href="#Union-2322"><span class="linenos">2322</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Union-2323"><a href="#Union-2323"><span class="linenos">2323</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Union-2324"><a href="#Union-2324"><span class="linenos">2324</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Union-2325"><a href="#Union-2325"><span class="linenos">2325</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> -</span><span id="Union-2326"><a href="#Union-2326"><span class="linenos">2326</span></a> <span class="p">}</span> -</span><span id="Union-2327"><a href="#Union-2327"><span class="linenos">2327</span></a> -</span><span id="Union-2328"><a href="#Union-2328"><span class="linenos">2328</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> -</span><span id="Union-2329"><a href="#Union-2329"><span class="linenos">2329</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> -</span><span id="Union-2330"><a href="#Union-2330"><span class="linenos">2330</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Union-2331"><a href="#Union-2331"><span class="linenos">2331</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Union-2332"><a href="#Union-2332"><span class="linenos">2332</span></a><span class="sd"> Set the LIMIT expression.</span> -</span><span id="Union-2333"><a href="#Union-2333"><span class="linenos">2333</span></a> -</span><span id="Union-2334"><a href="#Union-2334"><span class="linenos">2334</span></a><span class="sd"> Example:</span> -</span><span id="Union-2335"><a href="#Union-2335"><span class="linenos">2335</span></a><span class="sd"> >>> select("1").union(select("1")).limit(1).sql()</span> -</span><span id="Union-2336"><a href="#Union-2336"><span class="linenos">2336</span></a><span class="sd"> 'SELECT * FROM (SELECT 1 UNION SELECT 1) AS _l_0 LIMIT 1'</span> -</span><span id="Union-2337"><a href="#Union-2337"><span class="linenos">2337</span></a> -</span><span id="Union-2338"><a href="#Union-2338"><span class="linenos">2338</span></a><span class="sd"> Args:</span> -</span><span id="Union-2339"><a href="#Union-2339"><span class="linenos">2339</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="Union-2340"><a href="#Union-2340"><span class="linenos">2340</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="Union-2341"><a href="#Union-2341"><span class="linenos">2341</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> -</span><span id="Union-2342"><a href="#Union-2342"><span class="linenos">2342</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> -</span><span id="Union-2343"><a href="#Union-2343"><span class="linenos">2343</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Union-2344"><a href="#Union-2344"><span class="linenos">2344</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Union-2345"><a href="#Union-2345"><span class="linenos">2345</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Union-2346"><a href="#Union-2346"><span class="linenos">2346</span></a> -</span><span id="Union-2347"><a href="#Union-2347"><span class="linenos">2347</span></a><span class="sd"> Returns:</span> -</span><span id="Union-2348"><a href="#Union-2348"><span class="linenos">2348</span></a><span class="sd"> The limited subqueryable.</span> -</span><span id="Union-2349"><a href="#Union-2349"><span class="linenos">2349</span></a><span class="sd"> """</span> -</span><span id="Union-2350"><a href="#Union-2350"><span class="linenos">2350</span></a> <span class="k">return</span> <span class="p">(</span> -</span><span id="Union-2351"><a href="#Union-2351"><span class="linenos">2351</span></a> <span class="n">select</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span> -</span><span id="Union-2352"><a href="#Union-2352"><span class="linenos">2352</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-2353"><a href="#Union-2353"><span class="linenos">2353</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-2354"><a href="#Union-2354"><span class="linenos">2354</span></a> <span class="p">)</span> -</span><span id="Union-2355"><a href="#Union-2355"><span class="linenos">2355</span></a> -</span><span id="Union-2356"><a href="#Union-2356"><span class="linenos">2356</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> -</span><span id="Union-2357"><a href="#Union-2357"><span class="linenos">2357</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Union-2358"><a href="#Union-2358"><span class="linenos">2358</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Union-2359"><a href="#Union-2359"><span class="linenos">2359</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-2360"><a href="#Union-2360"><span class="linenos">2360</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-2361"><a href="#Union-2361"><span class="linenos">2361</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-2362"><a href="#Union-2362"><span class="linenos">2362</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Union-2363"><a href="#Union-2363"><span class="linenos">2363</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> -</span><span id="Union-2364"><a href="#Union-2364"><span class="linenos">2364</span></a><span class="w"> </span><span class="sd">"""Append to or set the SELECT of the union recursively.</span> -</span><span id="Union-2365"><a href="#Union-2365"><span class="linenos">2365</span></a> -</span><span id="Union-2366"><a href="#Union-2366"><span class="linenos">2366</span></a><span class="sd"> Example:</span> -</span><span id="Union-2367"><a href="#Union-2367"><span class="linenos">2367</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="Union-2368"><a href="#Union-2368"><span class="linenos">2368</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-2369"><a href="#Union-2369"><span class="linenos">2369</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-2370"><a href="#Union-2370"><span class="linenos">2370</span></a> -</span><span id="Union-2371"><a href="#Union-2371"><span class="linenos">2371</span></a><span class="sd"> Args:</span> -</span><span id="Union-2372"><a href="#Union-2372"><span class="linenos">2372</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Union-2373"><a href="#Union-2373"><span class="linenos">2373</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Union-2374"><a href="#Union-2374"><span class="linenos">2374</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Union-2375"><a href="#Union-2375"><span class="linenos">2375</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Union-2376"><a href="#Union-2376"><span class="linenos">2376</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Union-2377"><a href="#Union-2377"><span class="linenos">2377</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Union-2378"><a href="#Union-2378"><span class="linenos">2378</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Union-2379"><a href="#Union-2379"><span class="linenos">2379</span></a> -</span><span id="Union-2380"><a href="#Union-2380"><span class="linenos">2380</span></a><span class="sd"> Returns:</span> -</span><span id="Union-2381"><a href="#Union-2381"><span class="linenos">2381</span></a><span class="sd"> Union: the modified expression.</span> -</span><span id="Union-2382"><a href="#Union-2382"><span class="linenos">2382</span></a><span class="sd"> """</span> -</span><span id="Union-2383"><a href="#Union-2383"><span class="linenos">2383</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-2384"><a href="#Union-2384"><span class="linenos">2384</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-2385"><a href="#Union-2385"><span class="linenos">2385</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-2386"><a href="#Union-2386"><span class="linenos">2386</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-2387"><a href="#Union-2387"><span class="linenos">2387</span></a> <span class="p">)</span> -</span><span id="Union-2388"><a href="#Union-2388"><span class="linenos">2388</span></a> <span class="k">return</span> <span class="n">this</span> -</span><span id="Union-2389"><a href="#Union-2389"><span class="linenos">2389</span></a> -</span><span id="Union-2390"><a href="#Union-2390"><span class="linenos">2390</span></a> <span class="nd">@property</span> -</span><span id="Union-2391"><a href="#Union-2391"><span class="linenos">2391</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-2392"><a href="#Union-2392"><span class="linenos">2392</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-2393"><a href="#Union-2393"><span class="linenos">2393</span></a> -</span><span id="Union-2394"><a href="#Union-2394"><span class="linenos">2394</span></a> <span class="nd">@property</span> -</span><span id="Union-2395"><a href="#Union-2395"><span class="linenos">2395</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-2396"><a href="#Union-2396"><span class="linenos">2396</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-2397"><a href="#Union-2397"><span class="linenos">2397</span></a> -</span><span id="Union-2398"><a href="#Union-2398"><span class="linenos">2398</span></a> <span class="nd">@property</span> -</span><span id="Union-2399"><a href="#Union-2399"><span class="linenos">2399</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-2400"><a href="#Union-2400"><span class="linenos">2400</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-2401"><a href="#Union-2401"><span class="linenos">2401</span></a> -</span><span id="Union-2402"><a href="#Union-2402"><span class="linenos">2402</span></a> <span class="nd">@property</span> -</span><span id="Union-2403"><a href="#Union-2403"><span class="linenos">2403</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-2404"><a href="#Union-2404"><span class="linenos">2404</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-2405"><a href="#Union-2405"><span class="linenos">2405</span></a> -</span><span id="Union-2406"><a href="#Union-2406"><span class="linenos">2406</span></a> <span class="nd">@property</span> -</span><span id="Union-2407"><a href="#Union-2407"><span class="linenos">2407</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-2408"><a href="#Union-2408"><span class="linenos">2408</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-2317"><a href="#Union-2317"><span class="linenos">2317</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-2318"><a href="#Union-2318"><span class="linenos">2318</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Union-2319"><a href="#Union-2319"><span class="linenos">2319</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Union-2320"><a href="#Union-2320"><span class="linenos">2320</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Union-2321"><a href="#Union-2321"><span class="linenos">2321</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Union-2322"><a href="#Union-2322"><span class="linenos">2322</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Union-2323"><a href="#Union-2323"><span class="linenos">2323</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> +</span><span id="Union-2324"><a href="#Union-2324"><span class="linenos">2324</span></a> <span class="p">}</span> +</span><span id="Union-2325"><a href="#Union-2325"><span class="linenos">2325</span></a> +</span><span id="Union-2326"><a href="#Union-2326"><span class="linenos">2326</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> +</span><span id="Union-2327"><a href="#Union-2327"><span class="linenos">2327</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> +</span><span id="Union-2328"><a href="#Union-2328"><span class="linenos">2328</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Union-2329"><a href="#Union-2329"><span class="linenos">2329</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Union-2330"><a href="#Union-2330"><span class="linenos">2330</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="Union-2331"><a href="#Union-2331"><span class="linenos">2331</span></a> +</span><span id="Union-2332"><a href="#Union-2332"><span class="linenos">2332</span></a><span class="sd"> Example:</span> +</span><span id="Union-2333"><a href="#Union-2333"><span class="linenos">2333</span></a><span class="sd"> >>> select("1").union(select("1")).limit(1).sql()</span> +</span><span id="Union-2334"><a href="#Union-2334"><span class="linenos">2334</span></a><span class="sd"> 'SELECT * FROM (SELECT 1 UNION SELECT 1) AS _l_0 LIMIT 1'</span> +</span><span id="Union-2335"><a href="#Union-2335"><span class="linenos">2335</span></a> +</span><span id="Union-2336"><a href="#Union-2336"><span class="linenos">2336</span></a><span class="sd"> Args:</span> +</span><span id="Union-2337"><a href="#Union-2337"><span class="linenos">2337</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="Union-2338"><a href="#Union-2338"><span class="linenos">2338</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="Union-2339"><a href="#Union-2339"><span class="linenos">2339</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> +</span><span id="Union-2340"><a href="#Union-2340"><span class="linenos">2340</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> +</span><span id="Union-2341"><a href="#Union-2341"><span class="linenos">2341</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Union-2342"><a href="#Union-2342"><span class="linenos">2342</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Union-2343"><a href="#Union-2343"><span class="linenos">2343</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Union-2344"><a href="#Union-2344"><span class="linenos">2344</span></a> +</span><span id="Union-2345"><a href="#Union-2345"><span class="linenos">2345</span></a><span class="sd"> Returns:</span> +</span><span id="Union-2346"><a href="#Union-2346"><span class="linenos">2346</span></a><span class="sd"> The limited subqueryable.</span> +</span><span id="Union-2347"><a href="#Union-2347"><span class="linenos">2347</span></a><span class="sd"> """</span> +</span><span id="Union-2348"><a href="#Union-2348"><span class="linenos">2348</span></a> <span class="k">return</span> <span class="p">(</span> +</span><span id="Union-2349"><a href="#Union-2349"><span class="linenos">2349</span></a> <span class="n">select</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span> +</span><span id="Union-2350"><a href="#Union-2350"><span class="linenos">2350</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-2351"><a href="#Union-2351"><span class="linenos">2351</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-2352"><a href="#Union-2352"><span class="linenos">2352</span></a> <span class="p">)</span> +</span><span id="Union-2353"><a href="#Union-2353"><span class="linenos">2353</span></a> +</span><span id="Union-2354"><a href="#Union-2354"><span class="linenos">2354</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> +</span><span id="Union-2355"><a href="#Union-2355"><span class="linenos">2355</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Union-2356"><a href="#Union-2356"><span class="linenos">2356</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Union-2357"><a href="#Union-2357"><span class="linenos">2357</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-2358"><a href="#Union-2358"><span class="linenos">2358</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-2359"><a href="#Union-2359"><span class="linenos">2359</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-2360"><a href="#Union-2360"><span class="linenos">2360</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Union-2361"><a href="#Union-2361"><span class="linenos">2361</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> +</span><span id="Union-2362"><a href="#Union-2362"><span class="linenos">2362</span></a><span class="w"> </span><span class="sd">"""Append to or set the SELECT of the union recursively.</span> +</span><span id="Union-2363"><a href="#Union-2363"><span class="linenos">2363</span></a> +</span><span id="Union-2364"><a href="#Union-2364"><span class="linenos">2364</span></a><span class="sd"> Example:</span> +</span><span id="Union-2365"><a href="#Union-2365"><span class="linenos">2365</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="Union-2366"><a href="#Union-2366"><span class="linenos">2366</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-2367"><a href="#Union-2367"><span class="linenos">2367</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-2368"><a href="#Union-2368"><span class="linenos">2368</span></a> +</span><span id="Union-2369"><a href="#Union-2369"><span class="linenos">2369</span></a><span class="sd"> Args:</span> +</span><span id="Union-2370"><a href="#Union-2370"><span class="linenos">2370</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Union-2371"><a href="#Union-2371"><span class="linenos">2371</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Union-2372"><a href="#Union-2372"><span class="linenos">2372</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Union-2373"><a href="#Union-2373"><span class="linenos">2373</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Union-2374"><a href="#Union-2374"><span class="linenos">2374</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Union-2375"><a href="#Union-2375"><span class="linenos">2375</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Union-2376"><a href="#Union-2376"><span class="linenos">2376</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Union-2377"><a href="#Union-2377"><span class="linenos">2377</span></a> +</span><span id="Union-2378"><a href="#Union-2378"><span class="linenos">2378</span></a><span class="sd"> Returns:</span> +</span><span id="Union-2379"><a href="#Union-2379"><span class="linenos">2379</span></a><span class="sd"> Union: the modified expression.</span> +</span><span id="Union-2380"><a href="#Union-2380"><span class="linenos">2380</span></a><span class="sd"> """</span> +</span><span id="Union-2381"><a href="#Union-2381"><span class="linenos">2381</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-2382"><a href="#Union-2382"><span class="linenos">2382</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-2383"><a href="#Union-2383"><span class="linenos">2383</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-2384"><a href="#Union-2384"><span class="linenos">2384</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-2385"><a href="#Union-2385"><span class="linenos">2385</span></a> <span class="p">)</span> +</span><span id="Union-2386"><a href="#Union-2386"><span class="linenos">2386</span></a> <span class="k">return</span> <span class="n">this</span> +</span><span id="Union-2387"><a href="#Union-2387"><span class="linenos">2387</span></a> +</span><span id="Union-2388"><a href="#Union-2388"><span class="linenos">2388</span></a> <span class="nd">@property</span> +</span><span id="Union-2389"><a href="#Union-2389"><span class="linenos">2389</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-2390"><a href="#Union-2390"><span class="linenos">2390</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-2391"><a href="#Union-2391"><span class="linenos">2391</span></a> +</span><span id="Union-2392"><a href="#Union-2392"><span class="linenos">2392</span></a> <span class="nd">@property</span> +</span><span id="Union-2393"><a href="#Union-2393"><span class="linenos">2393</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-2394"><a href="#Union-2394"><span class="linenos">2394</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-2395"><a href="#Union-2395"><span class="linenos">2395</span></a> +</span><span id="Union-2396"><a href="#Union-2396"><span class="linenos">2396</span></a> <span class="nd">@property</span> +</span><span id="Union-2397"><a href="#Union-2397"><span class="linenos">2397</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-2398"><a href="#Union-2398"><span class="linenos">2398</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-2399"><a href="#Union-2399"><span class="linenos">2399</span></a> +</span><span id="Union-2400"><a href="#Union-2400"><span class="linenos">2400</span></a> <span class="nd">@property</span> +</span><span id="Union-2401"><a href="#Union-2401"><span class="linenos">2401</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-2402"><a href="#Union-2402"><span class="linenos">2402</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-2403"><a href="#Union-2403"><span class="linenos">2403</span></a> +</span><span id="Union-2404"><a href="#Union-2404"><span class="linenos">2404</span></a> <span class="nd">@property</span> +</span><span id="Union-2405"><a href="#Union-2405"><span class="linenos">2405</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-2406"><a href="#Union-2406"><span class="linenos">2406</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span> </span></pre></div> @@ -31444,33 +31456,33 @@ 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-2328"><a href="#Union.limit-2328"><span class="linenos">2328</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> -</span><span id="Union.limit-2329"><a href="#Union.limit-2329"><span class="linenos">2329</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> -</span><span id="Union.limit-2330"><a href="#Union.limit-2330"><span class="linenos">2330</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Union.limit-2331"><a href="#Union.limit-2331"><span class="linenos">2331</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Union.limit-2332"><a href="#Union.limit-2332"><span class="linenos">2332</span></a><span class="sd"> Set the LIMIT expression.</span> -</span><span id="Union.limit-2333"><a href="#Union.limit-2333"><span class="linenos">2333</span></a> -</span><span id="Union.limit-2334"><a href="#Union.limit-2334"><span class="linenos">2334</span></a><span class="sd"> Example:</span> -</span><span id="Union.limit-2335"><a href="#Union.limit-2335"><span class="linenos">2335</span></a><span class="sd"> >>> select("1").union(select("1")).limit(1).sql()</span> -</span><span id="Union.limit-2336"><a href="#Union.limit-2336"><span class="linenos">2336</span></a><span class="sd"> 'SELECT * FROM (SELECT 1 UNION SELECT 1) AS _l_0 LIMIT 1'</span> -</span><span id="Union.limit-2337"><a href="#Union.limit-2337"><span class="linenos">2337</span></a> -</span><span id="Union.limit-2338"><a href="#Union.limit-2338"><span class="linenos">2338</span></a><span class="sd"> Args:</span> -</span><span id="Union.limit-2339"><a href="#Union.limit-2339"><span class="linenos">2339</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="Union.limit-2340"><a href="#Union.limit-2340"><span class="linenos">2340</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="Union.limit-2341"><a href="#Union.limit-2341"><span class="linenos">2341</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> -</span><span id="Union.limit-2342"><a href="#Union.limit-2342"><span class="linenos">2342</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> -</span><span id="Union.limit-2343"><a href="#Union.limit-2343"><span class="linenos">2343</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Union.limit-2344"><a href="#Union.limit-2344"><span class="linenos">2344</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Union.limit-2345"><a href="#Union.limit-2345"><span class="linenos">2345</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Union.limit-2346"><a href="#Union.limit-2346"><span class="linenos">2346</span></a> -</span><span id="Union.limit-2347"><a href="#Union.limit-2347"><span class="linenos">2347</span></a><span class="sd"> Returns:</span> -</span><span id="Union.limit-2348"><a href="#Union.limit-2348"><span class="linenos">2348</span></a><span class="sd"> The limited subqueryable.</span> -</span><span id="Union.limit-2349"><a href="#Union.limit-2349"><span class="linenos">2349</span></a><span class="sd"> """</span> -</span><span id="Union.limit-2350"><a href="#Union.limit-2350"><span class="linenos">2350</span></a> <span class="k">return</span> <span class="p">(</span> -</span><span id="Union.limit-2351"><a href="#Union.limit-2351"><span class="linenos">2351</span></a> <span class="n">select</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span> -</span><span id="Union.limit-2352"><a href="#Union.limit-2352"><span class="linenos">2352</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-2353"><a href="#Union.limit-2353"><span class="linenos">2353</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-2354"><a href="#Union.limit-2354"><span class="linenos">2354</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Union.limit-2326"><a href="#Union.limit-2326"><span class="linenos">2326</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> +</span><span id="Union.limit-2327"><a href="#Union.limit-2327"><span class="linenos">2327</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> +</span><span id="Union.limit-2328"><a href="#Union.limit-2328"><span class="linenos">2328</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Union.limit-2329"><a href="#Union.limit-2329"><span class="linenos">2329</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Union.limit-2330"><a href="#Union.limit-2330"><span class="linenos">2330</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="Union.limit-2331"><a href="#Union.limit-2331"><span class="linenos">2331</span></a> +</span><span id="Union.limit-2332"><a href="#Union.limit-2332"><span class="linenos">2332</span></a><span class="sd"> Example:</span> +</span><span id="Union.limit-2333"><a href="#Union.limit-2333"><span class="linenos">2333</span></a><span class="sd"> >>> select("1").union(select("1")).limit(1).sql()</span> +</span><span id="Union.limit-2334"><a href="#Union.limit-2334"><span class="linenos">2334</span></a><span class="sd"> 'SELECT * FROM (SELECT 1 UNION SELECT 1) AS _l_0 LIMIT 1'</span> +</span><span id="Union.limit-2335"><a href="#Union.limit-2335"><span class="linenos">2335</span></a> +</span><span id="Union.limit-2336"><a href="#Union.limit-2336"><span class="linenos">2336</span></a><span class="sd"> Args:</span> +</span><span id="Union.limit-2337"><a href="#Union.limit-2337"><span class="linenos">2337</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="Union.limit-2338"><a href="#Union.limit-2338"><span class="linenos">2338</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="Union.limit-2339"><a href="#Union.limit-2339"><span class="linenos">2339</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> +</span><span id="Union.limit-2340"><a href="#Union.limit-2340"><span class="linenos">2340</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> +</span><span id="Union.limit-2341"><a href="#Union.limit-2341"><span class="linenos">2341</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Union.limit-2342"><a href="#Union.limit-2342"><span class="linenos">2342</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Union.limit-2343"><a href="#Union.limit-2343"><span class="linenos">2343</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Union.limit-2344"><a href="#Union.limit-2344"><span class="linenos">2344</span></a> +</span><span id="Union.limit-2345"><a href="#Union.limit-2345"><span class="linenos">2345</span></a><span class="sd"> Returns:</span> +</span><span id="Union.limit-2346"><a href="#Union.limit-2346"><span class="linenos">2346</span></a><span class="sd"> The limited subqueryable.</span> +</span><span id="Union.limit-2347"><a href="#Union.limit-2347"><span class="linenos">2347</span></a><span class="sd"> """</span> +</span><span id="Union.limit-2348"><a href="#Union.limit-2348"><span class="linenos">2348</span></a> <span class="k">return</span> <span class="p">(</span> +</span><span id="Union.limit-2349"><a href="#Union.limit-2349"><span class="linenos">2349</span></a> <span class="n">select</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span> +</span><span id="Union.limit-2350"><a href="#Union.limit-2350"><span class="linenos">2350</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-2351"><a href="#Union.limit-2351"><span class="linenos">2351</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-2352"><a href="#Union.limit-2352"><span class="linenos">2352</span></a> <span class="p">)</span> </span></pre></div> @@ -31518,39 +31530,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-2356"><a href="#Union.select-2356"><span class="linenos">2356</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> -</span><span id="Union.select-2357"><a href="#Union.select-2357"><span class="linenos">2357</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Union.select-2358"><a href="#Union.select-2358"><span class="linenos">2358</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Union.select-2359"><a href="#Union.select-2359"><span class="linenos">2359</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-2360"><a href="#Union.select-2360"><span class="linenos">2360</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-2361"><a href="#Union.select-2361"><span class="linenos">2361</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-2362"><a href="#Union.select-2362"><span class="linenos">2362</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Union.select-2363"><a href="#Union.select-2363"><span class="linenos">2363</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> -</span><span id="Union.select-2364"><a href="#Union.select-2364"><span class="linenos">2364</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-2365"><a href="#Union.select-2365"><span class="linenos">2365</span></a> -</span><span id="Union.select-2366"><a href="#Union.select-2366"><span class="linenos">2366</span></a><span class="sd"> Example:</span> -</span><span id="Union.select-2367"><a href="#Union.select-2367"><span class="linenos">2367</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="Union.select-2368"><a href="#Union.select-2368"><span class="linenos">2368</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-2369"><a href="#Union.select-2369"><span class="linenos">2369</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-2370"><a href="#Union.select-2370"><span class="linenos">2370</span></a> -</span><span id="Union.select-2371"><a href="#Union.select-2371"><span class="linenos">2371</span></a><span class="sd"> Args:</span> -</span><span id="Union.select-2372"><a href="#Union.select-2372"><span class="linenos">2372</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Union.select-2373"><a href="#Union.select-2373"><span class="linenos">2373</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Union.select-2374"><a href="#Union.select-2374"><span class="linenos">2374</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Union.select-2375"><a href="#Union.select-2375"><span class="linenos">2375</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Union.select-2376"><a href="#Union.select-2376"><span class="linenos">2376</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Union.select-2377"><a href="#Union.select-2377"><span class="linenos">2377</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Union.select-2378"><a href="#Union.select-2378"><span class="linenos">2378</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Union.select-2379"><a href="#Union.select-2379"><span class="linenos">2379</span></a> -</span><span id="Union.select-2380"><a href="#Union.select-2380"><span class="linenos">2380</span></a><span class="sd"> Returns:</span> -</span><span id="Union.select-2381"><a href="#Union.select-2381"><span class="linenos">2381</span></a><span class="sd"> Union: the modified expression.</span> -</span><span id="Union.select-2382"><a href="#Union.select-2382"><span class="linenos">2382</span></a><span class="sd"> """</span> -</span><span id="Union.select-2383"><a href="#Union.select-2383"><span class="linenos">2383</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-2384"><a href="#Union.select-2384"><span class="linenos">2384</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-2385"><a href="#Union.select-2385"><span class="linenos">2385</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-2386"><a href="#Union.select-2386"><span class="linenos">2386</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-2387"><a href="#Union.select-2387"><span class="linenos">2387</span></a> <span class="p">)</span> -</span><span id="Union.select-2388"><a href="#Union.select-2388"><span class="linenos">2388</span></a> <span class="k">return</span> <span class="n">this</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Union.select-2354"><a href="#Union.select-2354"><span class="linenos">2354</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> +</span><span id="Union.select-2355"><a href="#Union.select-2355"><span class="linenos">2355</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Union.select-2356"><a href="#Union.select-2356"><span class="linenos">2356</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Union.select-2357"><a href="#Union.select-2357"><span class="linenos">2357</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-2358"><a href="#Union.select-2358"><span class="linenos">2358</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-2359"><a href="#Union.select-2359"><span class="linenos">2359</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-2360"><a href="#Union.select-2360"><span class="linenos">2360</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Union.select-2361"><a href="#Union.select-2361"><span class="linenos">2361</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> +</span><span id="Union.select-2362"><a href="#Union.select-2362"><span class="linenos">2362</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-2363"><a href="#Union.select-2363"><span class="linenos">2363</span></a> +</span><span id="Union.select-2364"><a href="#Union.select-2364"><span class="linenos">2364</span></a><span class="sd"> Example:</span> +</span><span id="Union.select-2365"><a href="#Union.select-2365"><span class="linenos">2365</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="Union.select-2366"><a href="#Union.select-2366"><span class="linenos">2366</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-2367"><a href="#Union.select-2367"><span class="linenos">2367</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-2368"><a href="#Union.select-2368"><span class="linenos">2368</span></a> +</span><span id="Union.select-2369"><a href="#Union.select-2369"><span class="linenos">2369</span></a><span class="sd"> Args:</span> +</span><span id="Union.select-2370"><a href="#Union.select-2370"><span class="linenos">2370</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Union.select-2371"><a href="#Union.select-2371"><span class="linenos">2371</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Union.select-2372"><a href="#Union.select-2372"><span class="linenos">2372</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Union.select-2373"><a href="#Union.select-2373"><span class="linenos">2373</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Union.select-2374"><a href="#Union.select-2374"><span class="linenos">2374</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Union.select-2375"><a href="#Union.select-2375"><span class="linenos">2375</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Union.select-2376"><a href="#Union.select-2376"><span class="linenos">2376</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Union.select-2377"><a href="#Union.select-2377"><span class="linenos">2377</span></a> +</span><span id="Union.select-2378"><a href="#Union.select-2378"><span class="linenos">2378</span></a><span class="sd"> Returns:</span> +</span><span id="Union.select-2379"><a href="#Union.select-2379"><span class="linenos">2379</span></a><span class="sd"> Union: the modified expression.</span> +</span><span id="Union.select-2380"><a href="#Union.select-2380"><span class="linenos">2380</span></a><span class="sd"> """</span> +</span><span id="Union.select-2381"><a href="#Union.select-2381"><span class="linenos">2381</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-2382"><a href="#Union.select-2382"><span class="linenos">2382</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-2383"><a href="#Union.select-2383"><span class="linenos">2383</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-2384"><a href="#Union.select-2384"><span class="linenos">2384</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-2385"><a href="#Union.select-2385"><span class="linenos">2385</span></a> <span class="p">)</span> +</span><span id="Union.select-2386"><a href="#Union.select-2386"><span class="linenos">2386</span></a> <span class="k">return</span> <span class="n">this</span> </span></pre></div> @@ -31735,8 +31747,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-2411"><a href="#Except-2411"><span class="linenos">2411</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-2412"><a href="#Except-2412"><span class="linenos">2412</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Except-2409"><a href="#Except-2409"><span class="linenos">2409</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-2410"><a href="#Except-2410"><span class="linenos">2410</span></a> <span class="k">pass</span> </span></pre></div> @@ -31843,8 +31855,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-2415"><a href="#Intersect-2415"><span class="linenos">2415</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-2416"><a href="#Intersect-2416"><span class="linenos">2416</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Intersect-2413"><a href="#Intersect-2413"><span class="linenos">2413</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-2414"><a href="#Intersect-2414"><span class="linenos">2414</span></a> <span class="k">pass</span> </span></pre></div> @@ -31951,13 +31963,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-2419"><a href="#Unnest-2419"><span class="linenos">2419</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-2420"><a href="#Unnest-2420"><span class="linenos">2420</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Unnest-2421"><a href="#Unnest-2421"><span class="linenos">2421</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Unnest-2422"><a href="#Unnest-2422"><span class="linenos">2422</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Unnest-2423"><a href="#Unnest-2423"><span class="linenos">2423</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Unnest-2424"><a href="#Unnest-2424"><span class="linenos">2424</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Unnest-2425"><a href="#Unnest-2425"><span class="linenos">2425</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Unnest-2417"><a href="#Unnest-2417"><span class="linenos">2417</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-2418"><a href="#Unnest-2418"><span class="linenos">2418</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Unnest-2419"><a href="#Unnest-2419"><span class="linenos">2419</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Unnest-2420"><a href="#Unnest-2420"><span class="linenos">2420</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Unnest-2421"><a href="#Unnest-2421"><span class="linenos">2421</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Unnest-2422"><a href="#Unnest-2422"><span class="linenos">2422</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Unnest-2423"><a href="#Unnest-2423"><span class="linenos">2423</span></a> <span class="p">}</span> </span></pre></div> @@ -32069,16 +32081,16 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Update"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Update-2428"><a href="#Update-2428"><span class="linenos">2428</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-2429"><a href="#Update-2429"><span class="linenos">2429</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Update-2430"><a href="#Update-2430"><span class="linenos">2430</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Update-2431"><a href="#Update-2431"><span class="linenos">2431</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Update-2432"><a href="#Update-2432"><span class="linenos">2432</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Update-2433"><a href="#Update-2433"><span class="linenos">2433</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Update-2434"><a href="#Update-2434"><span class="linenos">2434</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Update-2435"><a href="#Update-2435"><span class="linenos">2435</span></a> <span class="s2">"returning"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Update-2436"><a href="#Update-2436"><span class="linenos">2436</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Update-2437"><a href="#Update-2437"><span class="linenos">2437</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Update-2426"><a href="#Update-2426"><span class="linenos">2426</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-2427"><a href="#Update-2427"><span class="linenos">2427</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Update-2428"><a href="#Update-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="Update-2429"><a href="#Update-2429"><span class="linenos">2429</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Update-2430"><a href="#Update-2430"><span class="linenos">2430</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Update-2431"><a href="#Update-2431"><span class="linenos">2431</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Update-2432"><a href="#Update-2432"><span class="linenos">2432</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Update-2433"><a href="#Update-2433"><span class="linenos">2433</span></a> <span class="s2">"returning"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Update-2434"><a href="#Update-2434"><span class="linenos">2434</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Update-2435"><a href="#Update-2435"><span class="linenos">2435</span></a> <span class="p">}</span> </span></pre></div> @@ -32176,12 +32188,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-2440"><a href="#Values-2440"><span class="linenos">2440</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-2441"><a href="#Values-2441"><span class="linenos">2441</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Values-2442"><a href="#Values-2442"><span class="linenos">2442</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Values-2443"><a href="#Values-2443"><span class="linenos">2443</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Values-2444"><a href="#Values-2444"><span class="linenos">2444</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Values-2445"><a href="#Values-2445"><span class="linenos">2445</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Values-2438"><a href="#Values-2438"><span class="linenos">2438</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-2439"><a href="#Values-2439"><span class="linenos">2439</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Values-2440"><a href="#Values-2440"><span class="linenos">2440</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Values-2441"><a href="#Values-2441"><span class="linenos">2441</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Values-2442"><a href="#Values-2442"><span class="linenos">2442</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Values-2443"><a href="#Values-2443"><span class="linenos">2443</span></a> <span class="p">}</span> </span></pre></div> @@ -32293,8 +32305,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-2448"><a href="#Var-2448"><span class="linenos">2448</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-2449"><a href="#Var-2449"><span class="linenos">2449</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Var-2446"><a href="#Var-2446"><span class="linenos">2446</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-2447"><a href="#Var-2447"><span class="linenos">2447</span></a> <span class="k">pass</span> </span></pre></div> @@ -32380,8 +32392,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-2452"><a href="#Schema-2452"><span class="linenos">2452</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-2453"><a href="#Schema-2453"><span class="linenos">2453</span></a> <span class="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-2450"><a href="#Schema-2450"><span class="linenos">2450</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-2451"><a href="#Schema-2451"><span class="linenos">2451</span></a> <span class="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> @@ -32478,8 +32490,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-2458"><a href="#Lock-2458"><span class="linenos">2458</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-2459"><a href="#Lock-2459"><span class="linenos">2459</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 class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"wait"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Lock-2456"><a href="#Lock-2456"><span class="linenos">2456</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-2457"><a href="#Lock-2457"><span class="linenos">2457</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 class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"wait"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -32576,694 +32588,694 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Select"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select-2462"><a href="#Select-2462"><span class="linenos">2462</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-2463"><a href="#Select-2463"><span class="linenos">2463</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Select-2464"><a href="#Select-2464"><span class="linenos">2464</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-2465"><a href="#Select-2465"><span class="linenos">2465</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-2466"><a href="#Select-2466"><span class="linenos">2466</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-2467"><a href="#Select-2467"><span class="linenos">2467</span></a> <span class="s2">"hint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-2468"><a href="#Select-2468"><span class="linenos">2468</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-2469"><a href="#Select-2469"><span class="linenos">2469</span></a> <span class="s2">"into"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-2470"><a href="#Select-2470"><span class="linenos">2470</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-2471"><a href="#Select-2471"><span class="linenos">2471</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> -</span><span id="Select-2472"><a href="#Select-2472"><span class="linenos">2472</span></a> <span class="p">}</span> -</span><span id="Select-2473"><a href="#Select-2473"><span class="linenos">2473</span></a> -</span><span id="Select-2474"><a href="#Select-2474"><span class="linenos">2474</span></a> <span class="k">def</span> <span class="nf">from_</span><span class="p">(</span> -</span><span id="Select-2475"><a href="#Select-2475"><span class="linenos">2475</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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="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">opts</span> -</span><span id="Select-2476"><a href="#Select-2476"><span class="linenos">2476</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2477"><a href="#Select-2477"><span class="linenos">2477</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2478"><a href="#Select-2478"><span class="linenos">2478</span></a><span class="sd"> Set the FROM expression.</span> -</span><span id="Select-2479"><a href="#Select-2479"><span class="linenos">2479</span></a> -</span><span id="Select-2480"><a href="#Select-2480"><span class="linenos">2480</span></a><span class="sd"> Example:</span> -</span><span id="Select-2481"><a href="#Select-2481"><span class="linenos">2481</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sql()</span> -</span><span id="Select-2482"><a href="#Select-2482"><span class="linenos">2482</span></a><span class="sd"> 'SELECT x FROM tbl'</span> -</span><span id="Select-2483"><a href="#Select-2483"><span class="linenos">2483</span></a> -</span><span id="Select-2484"><a href="#Select-2484"><span class="linenos">2484</span></a><span class="sd"> Args:</span> -</span><span id="Select-2485"><a href="#Select-2485"><span class="linenos">2485</span></a><span class="sd"> expression : the SQL code strings to parse.</span> -</span><span id="Select-2486"><a href="#Select-2486"><span class="linenos">2486</span></a><span class="sd"> If a `From` instance is passed, this is used as-is.</span> -</span><span id="Select-2487"><a href="#Select-2487"><span class="linenos">2487</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `From`.</span> -</span><span id="Select-2488"><a href="#Select-2488"><span class="linenos">2488</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select-2489"><a href="#Select-2489"><span class="linenos">2489</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2490"><a href="#Select-2490"><span class="linenos">2490</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2491"><a href="#Select-2491"><span class="linenos">2491</span></a> -</span><span id="Select-2492"><a href="#Select-2492"><span class="linenos">2492</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2493"><a href="#Select-2493"><span class="linenos">2493</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select-2494"><a href="#Select-2494"><span class="linenos">2494</span></a><span class="sd"> """</span> -</span><span id="Select-2495"><a href="#Select-2495"><span class="linenos">2495</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Select-2496"><a href="#Select-2496"><span class="linenos">2496</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="Select-2497"><a href="#Select-2497"><span class="linenos">2497</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2498"><a href="#Select-2498"><span class="linenos">2498</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"from"</span><span class="p">,</span> -</span><span id="Select-2499"><a href="#Select-2499"><span class="linenos">2499</span></a> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> -</span><span id="Select-2500"><a href="#Select-2500"><span class="linenos">2500</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> -</span><span id="Select-2501"><a href="#Select-2501"><span class="linenos">2501</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2502"><a href="#Select-2502"><span class="linenos">2502</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2503"><a href="#Select-2503"><span class="linenos">2503</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2504"><a href="#Select-2504"><span class="linenos">2504</span></a> <span class="p">)</span> -</span><span id="Select-2505"><a href="#Select-2505"><span class="linenos">2505</span></a> -</span><span id="Select-2506"><a href="#Select-2506"><span class="linenos">2506</span></a> <span class="k">def</span> <span class="nf">group_by</span><span class="p">(</span> -</span><span id="Select-2507"><a href="#Select-2507"><span class="linenos">2507</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2508"><a href="#Select-2508"><span class="linenos">2508</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select-2509"><a href="#Select-2509"><span class="linenos">2509</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-2510"><a href="#Select-2510"><span class="linenos">2510</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-2511"><a href="#Select-2511"><span class="linenos">2511</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-2512"><a href="#Select-2512"><span class="linenos">2512</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2513"><a href="#Select-2513"><span class="linenos">2513</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2514"><a href="#Select-2514"><span class="linenos">2514</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2515"><a href="#Select-2515"><span class="linenos">2515</span></a><span class="sd"> Set the GROUP BY expression.</span> -</span><span id="Select-2516"><a href="#Select-2516"><span class="linenos">2516</span></a> -</span><span id="Select-2517"><a href="#Select-2517"><span class="linenos">2517</span></a><span class="sd"> Example:</span> -</span><span id="Select-2518"><a href="#Select-2518"><span class="linenos">2518</span></a><span class="sd"> >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()</span> -</span><span id="Select-2519"><a href="#Select-2519"><span class="linenos">2519</span></a><span class="sd"> 'SELECT x, COUNT(1) FROM tbl GROUP BY x'</span> -</span><span id="Select-2520"><a href="#Select-2520"><span class="linenos">2520</span></a> -</span><span id="Select-2521"><a href="#Select-2521"><span class="linenos">2521</span></a><span class="sd"> Args:</span> -</span><span id="Select-2522"><a href="#Select-2522"><span class="linenos">2522</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select-2523"><a href="#Select-2523"><span class="linenos">2523</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select-2524"><a href="#Select-2524"><span class="linenos">2524</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Group`.</span> -</span><span id="Select-2525"><a href="#Select-2525"><span class="linenos">2525</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-2526"><a href="#Select-2526"><span class="linenos">2526</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select-2527"><a href="#Select-2527"><span class="linenos">2527</span></a><span class="sd"> Otherwise, this flattens all the `Group` expression into a single expression.</span> -</span><span id="Select-2528"><a href="#Select-2528"><span class="linenos">2528</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select-2529"><a href="#Select-2529"><span class="linenos">2529</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2530"><a href="#Select-2530"><span class="linenos">2530</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2531"><a href="#Select-2531"><span class="linenos">2531</span></a> -</span><span id="Select-2532"><a href="#Select-2532"><span class="linenos">2532</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2533"><a href="#Select-2533"><span class="linenos">2533</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select-2534"><a href="#Select-2534"><span class="linenos">2534</span></a><span class="sd"> """</span> -</span><span id="Select-2535"><a href="#Select-2535"><span class="linenos">2535</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-2536"><a href="#Select-2536"><span class="linenos">2536</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-2537"><a href="#Select-2537"><span class="linenos">2537</span></a> -</span><span id="Select-2538"><a href="#Select-2538"><span class="linenos">2538</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select-2539"><a href="#Select-2539"><span class="linenos">2539</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2540"><a href="#Select-2540"><span class="linenos">2540</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2541"><a href="#Select-2541"><span class="linenos">2541</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"group"</span><span class="p">,</span> -</span><span id="Select-2542"><a href="#Select-2542"><span class="linenos">2542</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2543"><a href="#Select-2543"><span class="linenos">2543</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2544"><a href="#Select-2544"><span class="linenos">2544</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-2545"><a href="#Select-2545"><span class="linenos">2545</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Group</span><span class="p">,</span> -</span><span id="Select-2546"><a href="#Select-2546"><span class="linenos">2546</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2547"><a href="#Select-2547"><span class="linenos">2547</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2548"><a href="#Select-2548"><span class="linenos">2548</span></a> <span class="p">)</span> -</span><span id="Select-2549"><a href="#Select-2549"><span class="linenos">2549</span></a> -</span><span id="Select-2550"><a href="#Select-2550"><span class="linenos">2550</span></a> <span class="k">def</span> <span class="nf">order_by</span><span class="p">(</span> -</span><span id="Select-2551"><a href="#Select-2551"><span class="linenos">2551</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2552"><a href="#Select-2552"><span class="linenos">2552</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select-2553"><a href="#Select-2553"><span class="linenos">2553</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-2554"><a href="#Select-2554"><span class="linenos">2554</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-2555"><a href="#Select-2555"><span class="linenos">2555</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-2556"><a href="#Select-2556"><span class="linenos">2556</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2557"><a href="#Select-2557"><span class="linenos">2557</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2558"><a href="#Select-2558"><span class="linenos">2558</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2559"><a href="#Select-2559"><span class="linenos">2559</span></a><span class="sd"> Set the ORDER BY expression.</span> -</span><span id="Select-2560"><a href="#Select-2560"><span class="linenos">2560</span></a> -</span><span id="Select-2561"><a href="#Select-2561"><span class="linenos">2561</span></a><span class="sd"> Example:</span> -</span><span id="Select-2562"><a href="#Select-2562"><span class="linenos">2562</span></a><span class="sd"> >>> Select().from_("tbl").select("x").order_by("x DESC").sql()</span> -</span><span id="Select-2563"><a href="#Select-2563"><span class="linenos">2563</span></a><span class="sd"> 'SELECT x FROM tbl ORDER BY x DESC'</span> -</span><span id="Select-2564"><a href="#Select-2564"><span class="linenos">2564</span></a> -</span><span id="Select-2565"><a href="#Select-2565"><span class="linenos">2565</span></a><span class="sd"> Args:</span> -</span><span id="Select-2566"><a href="#Select-2566"><span class="linenos">2566</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select-2567"><a href="#Select-2567"><span class="linenos">2567</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select-2568"><a href="#Select-2568"><span class="linenos">2568</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Order`.</span> -</span><span id="Select-2569"><a href="#Select-2569"><span class="linenos">2569</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select-2570"><a href="#Select-2570"><span class="linenos">2570</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="Select-2571"><a href="#Select-2571"><span class="linenos">2571</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select-2572"><a href="#Select-2572"><span class="linenos">2572</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2573"><a href="#Select-2573"><span class="linenos">2573</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2574"><a href="#Select-2574"><span class="linenos">2574</span></a> -</span><span id="Select-2575"><a href="#Select-2575"><span class="linenos">2575</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2576"><a href="#Select-2576"><span class="linenos">2576</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select-2577"><a href="#Select-2577"><span class="linenos">2577</span></a><span class="sd"> """</span> -</span><span id="Select-2578"><a href="#Select-2578"><span class="linenos">2578</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select-2579"><a href="#Select-2579"><span class="linenos">2579</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2580"><a href="#Select-2580"><span class="linenos">2580</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2581"><a href="#Select-2581"><span class="linenos">2581</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"order"</span><span class="p">,</span> -</span><span id="Select-2582"><a href="#Select-2582"><span class="linenos">2582</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2583"><a href="#Select-2583"><span class="linenos">2583</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2584"><a href="#Select-2584"><span class="linenos">2584</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-2585"><a href="#Select-2585"><span class="linenos">2585</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Order</span><span class="p">,</span> -</span><span id="Select-2586"><a href="#Select-2586"><span class="linenos">2586</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2587"><a href="#Select-2587"><span class="linenos">2587</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2588"><a href="#Select-2588"><span class="linenos">2588</span></a> <span class="p">)</span> -</span><span id="Select-2589"><a href="#Select-2589"><span class="linenos">2589</span></a> -</span><span id="Select-2590"><a href="#Select-2590"><span class="linenos">2590</span></a> <span class="k">def</span> <span class="nf">sort_by</span><span class="p">(</span> -</span><span id="Select-2591"><a href="#Select-2591"><span class="linenos">2591</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2592"><a href="#Select-2592"><span class="linenos">2592</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select-2593"><a href="#Select-2593"><span class="linenos">2593</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-2594"><a href="#Select-2594"><span class="linenos">2594</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-2595"><a href="#Select-2595"><span class="linenos">2595</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-2596"><a href="#Select-2596"><span class="linenos">2596</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2597"><a href="#Select-2597"><span class="linenos">2597</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2598"><a href="#Select-2598"><span class="linenos">2598</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2599"><a href="#Select-2599"><span class="linenos">2599</span></a><span class="sd"> Set the SORT BY expression.</span> -</span><span id="Select-2600"><a href="#Select-2600"><span class="linenos">2600</span></a> -</span><span id="Select-2601"><a href="#Select-2601"><span class="linenos">2601</span></a><span class="sd"> Example:</span> -</span><span id="Select-2602"><a href="#Select-2602"><span class="linenos">2602</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sort_by("x DESC").sql(dialect="hive")</span> -</span><span id="Select-2603"><a href="#Select-2603"><span class="linenos">2603</span></a><span class="sd"> 'SELECT x FROM tbl SORT BY x DESC'</span> -</span><span id="Select-2604"><a href="#Select-2604"><span class="linenos">2604</span></a> -</span><span id="Select-2605"><a href="#Select-2605"><span class="linenos">2605</span></a><span class="sd"> Args:</span> -</span><span id="Select-2606"><a href="#Select-2606"><span class="linenos">2606</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select-2607"><a href="#Select-2607"><span class="linenos">2607</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select-2608"><a href="#Select-2608"><span class="linenos">2608</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `SORT`.</span> -</span><span id="Select-2609"><a href="#Select-2609"><span class="linenos">2609</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select-2610"><a href="#Select-2610"><span class="linenos">2610</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="Select-2611"><a href="#Select-2611"><span class="linenos">2611</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select-2612"><a href="#Select-2612"><span class="linenos">2612</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2613"><a href="#Select-2613"><span class="linenos">2613</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2614"><a href="#Select-2614"><span class="linenos">2614</span></a> -</span><span id="Select-2615"><a href="#Select-2615"><span class="linenos">2615</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2616"><a href="#Select-2616"><span class="linenos">2616</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select-2617"><a href="#Select-2617"><span class="linenos">2617</span></a><span class="sd"> """</span> -</span><span id="Select-2618"><a href="#Select-2618"><span class="linenos">2618</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select-2619"><a href="#Select-2619"><span class="linenos">2619</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2620"><a href="#Select-2620"><span class="linenos">2620</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2621"><a href="#Select-2621"><span class="linenos">2621</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"sort"</span><span class="p">,</span> -</span><span id="Select-2622"><a href="#Select-2622"><span class="linenos">2622</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2623"><a href="#Select-2623"><span class="linenos">2623</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2624"><a href="#Select-2624"><span class="linenos">2624</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-2625"><a href="#Select-2625"><span class="linenos">2625</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Sort</span><span class="p">,</span> -</span><span id="Select-2626"><a href="#Select-2626"><span class="linenos">2626</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2627"><a href="#Select-2627"><span class="linenos">2627</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2628"><a href="#Select-2628"><span class="linenos">2628</span></a> <span class="p">)</span> -</span><span id="Select-2629"><a href="#Select-2629"><span class="linenos">2629</span></a> -</span><span id="Select-2630"><a href="#Select-2630"><span class="linenos">2630</span></a> <span class="k">def</span> <span class="nf">cluster_by</span><span class="p">(</span> -</span><span id="Select-2631"><a href="#Select-2631"><span class="linenos">2631</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2632"><a href="#Select-2632"><span class="linenos">2632</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select-2633"><a href="#Select-2633"><span class="linenos">2633</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-2634"><a href="#Select-2634"><span class="linenos">2634</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-2635"><a href="#Select-2635"><span class="linenos">2635</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-2636"><a href="#Select-2636"><span class="linenos">2636</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2637"><a href="#Select-2637"><span class="linenos">2637</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2638"><a href="#Select-2638"><span class="linenos">2638</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2639"><a href="#Select-2639"><span class="linenos">2639</span></a><span class="sd"> Set the CLUSTER BY expression.</span> -</span><span id="Select-2640"><a href="#Select-2640"><span class="linenos">2640</span></a> -</span><span id="Select-2641"><a href="#Select-2641"><span class="linenos">2641</span></a><span class="sd"> Example:</span> -</span><span id="Select-2642"><a href="#Select-2642"><span class="linenos">2642</span></a><span class="sd"> >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql(dialect="hive")</span> -</span><span id="Select-2643"><a href="#Select-2643"><span class="linenos">2643</span></a><span class="sd"> 'SELECT x FROM tbl CLUSTER BY x DESC'</span> -</span><span id="Select-2644"><a href="#Select-2644"><span class="linenos">2644</span></a> -</span><span id="Select-2645"><a href="#Select-2645"><span class="linenos">2645</span></a><span class="sd"> Args:</span> -</span><span id="Select-2646"><a href="#Select-2646"><span class="linenos">2646</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select-2647"><a href="#Select-2647"><span class="linenos">2647</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select-2648"><a href="#Select-2648"><span class="linenos">2648</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Cluster`.</span> -</span><span id="Select-2649"><a href="#Select-2649"><span class="linenos">2649</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select-2650"><a href="#Select-2650"><span class="linenos">2650</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="Select-2651"><a href="#Select-2651"><span class="linenos">2651</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select-2652"><a href="#Select-2652"><span class="linenos">2652</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2653"><a href="#Select-2653"><span class="linenos">2653</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2654"><a href="#Select-2654"><span class="linenos">2654</span></a> -</span><span id="Select-2655"><a href="#Select-2655"><span class="linenos">2655</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2656"><a href="#Select-2656"><span class="linenos">2656</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select-2657"><a href="#Select-2657"><span class="linenos">2657</span></a><span class="sd"> """</span> -</span><span id="Select-2658"><a href="#Select-2658"><span class="linenos">2658</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select-2659"><a href="#Select-2659"><span class="linenos">2659</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2660"><a href="#Select-2660"><span class="linenos">2660</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2661"><a href="#Select-2661"><span class="linenos">2661</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"cluster"</span><span class="p">,</span> -</span><span id="Select-2662"><a href="#Select-2662"><span class="linenos">2662</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2663"><a href="#Select-2663"><span class="linenos">2663</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2664"><a href="#Select-2664"><span class="linenos">2664</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-2665"><a href="#Select-2665"><span class="linenos">2665</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Cluster</span><span class="p">,</span> -</span><span id="Select-2666"><a href="#Select-2666"><span class="linenos">2666</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2667"><a href="#Select-2667"><span class="linenos">2667</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2668"><a href="#Select-2668"><span class="linenos">2668</span></a> <span class="p">)</span> -</span><span id="Select-2669"><a href="#Select-2669"><span class="linenos">2669</span></a> -</span><span id="Select-2670"><a href="#Select-2670"><span class="linenos">2670</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> -</span><span id="Select-2671"><a href="#Select-2671"><span class="linenos">2671</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> -</span><span id="Select-2672"><a href="#Select-2672"><span class="linenos">2672</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2673"><a href="#Select-2673"><span class="linenos">2673</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2674"><a href="#Select-2674"><span class="linenos">2674</span></a><span class="sd"> Set the LIMIT expression.</span> -</span><span id="Select-2675"><a href="#Select-2675"><span class="linenos">2675</span></a> -</span><span id="Select-2676"><a href="#Select-2676"><span class="linenos">2676</span></a><span class="sd"> Example:</span> -</span><span id="Select-2677"><a href="#Select-2677"><span class="linenos">2677</span></a><span class="sd"> >>> Select().from_("tbl").select("x").limit(10).sql()</span> -</span><span id="Select-2678"><a href="#Select-2678"><span class="linenos">2678</span></a><span class="sd"> 'SELECT x FROM tbl LIMIT 10'</span> -</span><span id="Select-2679"><a href="#Select-2679"><span class="linenos">2679</span></a> -</span><span id="Select-2680"><a href="#Select-2680"><span class="linenos">2680</span></a><span class="sd"> Args:</span> -</span><span id="Select-2681"><a href="#Select-2681"><span class="linenos">2681</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="Select-2682"><a href="#Select-2682"><span class="linenos">2682</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="Select-2683"><a href="#Select-2683"><span class="linenos">2683</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> -</span><span id="Select-2684"><a href="#Select-2684"><span class="linenos">2684</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> -</span><span id="Select-2685"><a href="#Select-2685"><span class="linenos">2685</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select-2686"><a href="#Select-2686"><span class="linenos">2686</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2687"><a href="#Select-2687"><span class="linenos">2687</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2688"><a href="#Select-2688"><span class="linenos">2688</span></a> -</span><span id="Select-2689"><a href="#Select-2689"><span class="linenos">2689</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2690"><a href="#Select-2690"><span class="linenos">2690</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-2691"><a href="#Select-2691"><span class="linenos">2691</span></a><span class="sd"> """</span> -</span><span id="Select-2692"><a href="#Select-2692"><span class="linenos">2692</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Select-2693"><a href="#Select-2693"><span class="linenos">2693</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="Select-2694"><a href="#Select-2694"><span class="linenos">2694</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2695"><a href="#Select-2695"><span class="linenos">2695</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"limit"</span><span class="p">,</span> -</span><span id="Select-2696"><a href="#Select-2696"><span class="linenos">2696</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Limit</span><span class="p">,</span> -</span><span id="Select-2697"><a href="#Select-2697"><span class="linenos">2697</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LIMIT"</span><span class="p">,</span> -</span><span id="Select-2698"><a href="#Select-2698"><span class="linenos">2698</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2699"><a href="#Select-2699"><span class="linenos">2699</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2700"><a href="#Select-2700"><span class="linenos">2700</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2701"><a href="#Select-2701"><span class="linenos">2701</span></a> <span class="p">)</span> -</span><span id="Select-2702"><a href="#Select-2702"><span class="linenos">2702</span></a> -</span><span id="Select-2703"><a href="#Select-2703"><span class="linenos">2703</span></a> <span class="k">def</span> <span class="nf">offset</span><span class="p">(</span> -</span><span id="Select-2704"><a href="#Select-2704"><span class="linenos">2704</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> -</span><span id="Select-2705"><a href="#Select-2705"><span class="linenos">2705</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2706"><a href="#Select-2706"><span class="linenos">2706</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2707"><a href="#Select-2707"><span class="linenos">2707</span></a><span class="sd"> Set the OFFSET expression.</span> -</span><span id="Select-2708"><a href="#Select-2708"><span class="linenos">2708</span></a> -</span><span id="Select-2709"><a href="#Select-2709"><span class="linenos">2709</span></a><span class="sd"> Example:</span> -</span><span id="Select-2710"><a href="#Select-2710"><span class="linenos">2710</span></a><span class="sd"> >>> Select().from_("tbl").select("x").offset(10).sql()</span> -</span><span id="Select-2711"><a href="#Select-2711"><span class="linenos">2711</span></a><span class="sd"> 'SELECT x FROM tbl OFFSET 10'</span> -</span><span id="Select-2712"><a href="#Select-2712"><span class="linenos">2712</span></a> -</span><span id="Select-2713"><a href="#Select-2713"><span class="linenos">2713</span></a><span class="sd"> Args:</span> -</span><span id="Select-2714"><a href="#Select-2714"><span class="linenos">2714</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="Select-2715"><a href="#Select-2715"><span class="linenos">2715</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="Select-2716"><a href="#Select-2716"><span class="linenos">2716</span></a><span class="sd"> If a `Offset` instance is passed, this is used as-is.</span> -</span><span id="Select-2717"><a href="#Select-2717"><span class="linenos">2717</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Offset`.</span> -</span><span id="Select-2718"><a href="#Select-2718"><span class="linenos">2718</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select-2719"><a href="#Select-2719"><span class="linenos">2719</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2720"><a href="#Select-2720"><span class="linenos">2720</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2721"><a href="#Select-2721"><span class="linenos">2721</span></a> -</span><span id="Select-2722"><a href="#Select-2722"><span class="linenos">2722</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2723"><a href="#Select-2723"><span class="linenos">2723</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select-2724"><a href="#Select-2724"><span class="linenos">2724</span></a><span class="sd"> """</span> -</span><span id="Select-2725"><a href="#Select-2725"><span class="linenos">2725</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Select-2726"><a href="#Select-2726"><span class="linenos">2726</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="Select-2727"><a href="#Select-2727"><span class="linenos">2727</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2728"><a href="#Select-2728"><span class="linenos">2728</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"offset"</span><span class="p">,</span> -</span><span id="Select-2729"><a href="#Select-2729"><span class="linenos">2729</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Offset</span><span class="p">,</span> -</span><span id="Select-2730"><a href="#Select-2730"><span class="linenos">2730</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"OFFSET"</span><span class="p">,</span> -</span><span id="Select-2731"><a href="#Select-2731"><span class="linenos">2731</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2732"><a href="#Select-2732"><span class="linenos">2732</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2733"><a href="#Select-2733"><span class="linenos">2733</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2734"><a href="#Select-2734"><span class="linenos">2734</span></a> <span class="p">)</span> -</span><span id="Select-2735"><a href="#Select-2735"><span class="linenos">2735</span></a> -</span><span id="Select-2736"><a href="#Select-2736"><span class="linenos">2736</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> -</span><span id="Select-2737"><a href="#Select-2737"><span class="linenos">2737</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2738"><a href="#Select-2738"><span class="linenos">2738</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select-2739"><a href="#Select-2739"><span class="linenos">2739</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-2740"><a href="#Select-2740"><span class="linenos">2740</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-2741"><a href="#Select-2741"><span class="linenos">2741</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-2742"><a href="#Select-2742"><span class="linenos">2742</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2743"><a href="#Select-2743"><span class="linenos">2743</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2744"><a href="#Select-2744"><span class="linenos">2744</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2745"><a href="#Select-2745"><span class="linenos">2745</span></a><span class="sd"> Append to or set the SELECT expressions.</span> -</span><span id="Select-2746"><a href="#Select-2746"><span class="linenos">2746</span></a> -</span><span id="Select-2747"><a href="#Select-2747"><span class="linenos">2747</span></a><span class="sd"> Example:</span> -</span><span id="Select-2748"><a href="#Select-2748"><span class="linenos">2748</span></a><span class="sd"> >>> Select().select("x", "y").sql()</span> -</span><span id="Select-2749"><a href="#Select-2749"><span class="linenos">2749</span></a><span class="sd"> 'SELECT x, y'</span> -</span><span id="Select-2750"><a href="#Select-2750"><span class="linenos">2750</span></a> -</span><span id="Select-2751"><a href="#Select-2751"><span class="linenos">2751</span></a><span class="sd"> Args:</span> -</span><span id="Select-2752"><a href="#Select-2752"><span class="linenos">2752</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select-2753"><a href="#Select-2753"><span class="linenos">2753</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2754"><a href="#Select-2754"><span class="linenos">2754</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select-2755"><a href="#Select-2755"><span class="linenos">2755</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Select-2756"><a href="#Select-2756"><span class="linenos">2756</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Select-2757"><a href="#Select-2757"><span class="linenos">2757</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2758"><a href="#Select-2758"><span class="linenos">2758</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2759"><a href="#Select-2759"><span class="linenos">2759</span></a> -</span><span id="Select-2760"><a href="#Select-2760"><span class="linenos">2760</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2761"><a href="#Select-2761"><span class="linenos">2761</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select-2762"><a href="#Select-2762"><span class="linenos">2762</span></a><span class="sd"> """</span> -</span><span id="Select-2763"><a href="#Select-2763"><span class="linenos">2763</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select-2764"><a href="#Select-2764"><span class="linenos">2764</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2765"><a href="#Select-2765"><span class="linenos">2765</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2766"><a href="#Select-2766"><span class="linenos">2766</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="Select-2767"><a href="#Select-2767"><span class="linenos">2767</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2768"><a href="#Select-2768"><span class="linenos">2768</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2769"><a href="#Select-2769"><span class="linenos">2769</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2770"><a href="#Select-2770"><span class="linenos">2770</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2771"><a href="#Select-2771"><span class="linenos">2771</span></a> <span class="p">)</span> -</span><span id="Select-2772"><a href="#Select-2772"><span class="linenos">2772</span></a> -</span><span id="Select-2773"><a href="#Select-2773"><span class="linenos">2773</span></a> <span class="k">def</span> <span class="nf">lateral</span><span class="p">(</span> -</span><span id="Select-2774"><a href="#Select-2774"><span class="linenos">2774</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2775"><a href="#Select-2775"><span class="linenos">2775</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select-2776"><a href="#Select-2776"><span class="linenos">2776</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-2777"><a href="#Select-2777"><span class="linenos">2777</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-2778"><a href="#Select-2778"><span class="linenos">2778</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-2779"><a href="#Select-2779"><span class="linenos">2779</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2780"><a href="#Select-2780"><span class="linenos">2780</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2781"><a href="#Select-2781"><span class="linenos">2781</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2782"><a href="#Select-2782"><span class="linenos">2782</span></a><span class="sd"> Append to or set the LATERAL expressions.</span> -</span><span id="Select-2783"><a href="#Select-2783"><span class="linenos">2783</span></a> -</span><span id="Select-2784"><a href="#Select-2784"><span class="linenos">2784</span></a><span class="sd"> Example:</span> -</span><span id="Select-2785"><a href="#Select-2785"><span class="linenos">2785</span></a><span class="sd"> >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()</span> -</span><span id="Select-2786"><a href="#Select-2786"><span class="linenos">2786</span></a><span class="sd"> 'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'</span> -</span><span id="Select-2787"><a href="#Select-2787"><span class="linenos">2787</span></a> -</span><span id="Select-2788"><a href="#Select-2788"><span class="linenos">2788</span></a><span class="sd"> Args:</span> -</span><span id="Select-2789"><a href="#Select-2789"><span class="linenos">2789</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select-2790"><a href="#Select-2790"><span class="linenos">2790</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2791"><a href="#Select-2791"><span class="linenos">2791</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select-2792"><a href="#Select-2792"><span class="linenos">2792</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Select-2793"><a href="#Select-2793"><span class="linenos">2793</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Select-2794"><a href="#Select-2794"><span class="linenos">2794</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2795"><a href="#Select-2795"><span class="linenos">2795</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2796"><a href="#Select-2796"><span class="linenos">2796</span></a> -</span><span id="Select-2797"><a href="#Select-2797"><span class="linenos">2797</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2798"><a href="#Select-2798"><span class="linenos">2798</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select-2799"><a href="#Select-2799"><span class="linenos">2799</span></a><span class="sd"> """</span> -</span><span id="Select-2800"><a href="#Select-2800"><span class="linenos">2800</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select-2801"><a href="#Select-2801"><span class="linenos">2801</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2802"><a href="#Select-2802"><span class="linenos">2802</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2803"><a href="#Select-2803"><span class="linenos">2803</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"laterals"</span><span class="p">,</span> -</span><span id="Select-2804"><a href="#Select-2804"><span class="linenos">2804</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2805"><a href="#Select-2805"><span class="linenos">2805</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Lateral</span><span class="p">,</span> -</span><span id="Select-2806"><a href="#Select-2806"><span class="linenos">2806</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-2807"><a href="#Select-2807"><span class="linenos">2807</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2808"><a href="#Select-2808"><span class="linenos">2808</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2809"><a href="#Select-2809"><span class="linenos">2809</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2810"><a href="#Select-2810"><span class="linenos">2810</span></a> <span class="p">)</span> -</span><span id="Select-2811"><a href="#Select-2811"><span class="linenos">2811</span></a> -</span><span id="Select-2812"><a href="#Select-2812"><span class="linenos">2812</span></a> <span class="k">def</span> <span class="nf">join</span><span class="p">(</span> -</span><span id="Select-2813"><a href="#Select-2813"><span class="linenos">2813</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2814"><a href="#Select-2814"><span class="linenos">2814</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Select-2815"><a href="#Select-2815"><span class="linenos">2815</span></a> <span class="n">on</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Select-2816"><a href="#Select-2816"><span class="linenos">2816</span></a> <span class="n">using</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">ExpOrStr</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">ExpOrStr</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Select-2817"><a href="#Select-2817"><span class="linenos">2817</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-2818"><a href="#Select-2818"><span class="linenos">2818</span></a> <span class="n">join_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="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Select-2819"><a href="#Select-2819"><span class="linenos">2819</span></a> <span class="n">join_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="n">Identifier</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="Select-2820"><a href="#Select-2820"><span class="linenos">2820</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-2821"><a href="#Select-2821"><span class="linenos">2821</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-2822"><a href="#Select-2822"><span class="linenos">2822</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2823"><a href="#Select-2823"><span class="linenos">2823</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2824"><a href="#Select-2824"><span class="linenos">2824</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2825"><a href="#Select-2825"><span class="linenos">2825</span></a><span class="sd"> Append to or set the JOIN expressions.</span> -</span><span id="Select-2826"><a href="#Select-2826"><span class="linenos">2826</span></a> -</span><span id="Select-2827"><a href="#Select-2827"><span class="linenos">2827</span></a><span class="sd"> Example:</span> -</span><span id="Select-2828"><a href="#Select-2828"><span class="linenos">2828</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()</span> -</span><span id="Select-2829"><a href="#Select-2829"><span class="linenos">2829</span></a><span class="sd"> 'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'</span> -</span><span id="Select-2830"><a href="#Select-2830"><span class="linenos">2830</span></a> -</span><span id="Select-2831"><a href="#Select-2831"><span class="linenos">2831</span></a><span class="sd"> >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()</span> -</span><span id="Select-2832"><a href="#Select-2832"><span class="linenos">2832</span></a><span class="sd"> 'SELECT 1 FROM a JOIN b USING (x, y, z)'</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select-2460"><a href="#Select-2460"><span class="linenos">2460</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-2461"><a href="#Select-2461"><span class="linenos">2461</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Select-2462"><a href="#Select-2462"><span class="linenos">2462</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-2463"><a href="#Select-2463"><span class="linenos">2463</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-2464"><a href="#Select-2464"><span class="linenos">2464</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-2465"><a href="#Select-2465"><span class="linenos">2465</span></a> <span class="s2">"hint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-2466"><a href="#Select-2466"><span class="linenos">2466</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-2467"><a href="#Select-2467"><span class="linenos">2467</span></a> <span class="s2">"into"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-2468"><a href="#Select-2468"><span class="linenos">2468</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-2469"><a href="#Select-2469"><span class="linenos">2469</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> +</span><span id="Select-2470"><a href="#Select-2470"><span class="linenos">2470</span></a> <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="k">def</span> <span class="nf">from_</span><span class="p">(</span> +</span><span id="Select-2473"><a href="#Select-2473"><span class="linenos">2473</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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="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">opts</span> +</span><span id="Select-2474"><a href="#Select-2474"><span class="linenos">2474</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2475"><a href="#Select-2475"><span class="linenos">2475</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2476"><a href="#Select-2476"><span class="linenos">2476</span></a><span class="sd"> Set the FROM expression.</span> +</span><span id="Select-2477"><a href="#Select-2477"><span class="linenos">2477</span></a> +</span><span id="Select-2478"><a href="#Select-2478"><span class="linenos">2478</span></a><span class="sd"> Example:</span> +</span><span id="Select-2479"><a href="#Select-2479"><span class="linenos">2479</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sql()</span> +</span><span id="Select-2480"><a href="#Select-2480"><span class="linenos">2480</span></a><span class="sd"> 'SELECT x FROM tbl'</span> +</span><span id="Select-2481"><a href="#Select-2481"><span class="linenos">2481</span></a> +</span><span id="Select-2482"><a href="#Select-2482"><span class="linenos">2482</span></a><span class="sd"> Args:</span> +</span><span id="Select-2483"><a href="#Select-2483"><span class="linenos">2483</span></a><span class="sd"> expression : the SQL code strings to parse.</span> +</span><span id="Select-2484"><a href="#Select-2484"><span class="linenos">2484</span></a><span class="sd"> If a `From` instance is passed, this is used as-is.</span> +</span><span id="Select-2485"><a href="#Select-2485"><span class="linenos">2485</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `From`.</span> +</span><span id="Select-2486"><a href="#Select-2486"><span class="linenos">2486</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select-2487"><a href="#Select-2487"><span class="linenos">2487</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2488"><a href="#Select-2488"><span class="linenos">2488</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2489"><a href="#Select-2489"><span class="linenos">2489</span></a> +</span><span id="Select-2490"><a href="#Select-2490"><span class="linenos">2490</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2491"><a href="#Select-2491"><span class="linenos">2491</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select-2492"><a href="#Select-2492"><span class="linenos">2492</span></a><span class="sd"> """</span> +</span><span id="Select-2493"><a href="#Select-2493"><span class="linenos">2493</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Select-2494"><a href="#Select-2494"><span class="linenos">2494</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="Select-2495"><a href="#Select-2495"><span class="linenos">2495</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2496"><a href="#Select-2496"><span class="linenos">2496</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"from"</span><span class="p">,</span> +</span><span id="Select-2497"><a href="#Select-2497"><span class="linenos">2497</span></a> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> +</span><span id="Select-2498"><a href="#Select-2498"><span class="linenos">2498</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> +</span><span id="Select-2499"><a href="#Select-2499"><span class="linenos">2499</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2500"><a href="#Select-2500"><span class="linenos">2500</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2501"><a href="#Select-2501"><span class="linenos">2501</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2502"><a href="#Select-2502"><span class="linenos">2502</span></a> <span class="p">)</span> +</span><span id="Select-2503"><a href="#Select-2503"><span class="linenos">2503</span></a> +</span><span id="Select-2504"><a href="#Select-2504"><span class="linenos">2504</span></a> <span class="k">def</span> <span class="nf">group_by</span><span class="p">(</span> +</span><span id="Select-2505"><a href="#Select-2505"><span class="linenos">2505</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2506"><a href="#Select-2506"><span class="linenos">2506</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select-2507"><a href="#Select-2507"><span class="linenos">2507</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-2508"><a href="#Select-2508"><span class="linenos">2508</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-2509"><a href="#Select-2509"><span class="linenos">2509</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-2510"><a href="#Select-2510"><span class="linenos">2510</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2511"><a href="#Select-2511"><span class="linenos">2511</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2512"><a href="#Select-2512"><span class="linenos">2512</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2513"><a href="#Select-2513"><span class="linenos">2513</span></a><span class="sd"> Set the GROUP BY expression.</span> +</span><span id="Select-2514"><a href="#Select-2514"><span class="linenos">2514</span></a> +</span><span id="Select-2515"><a href="#Select-2515"><span class="linenos">2515</span></a><span class="sd"> Example:</span> +</span><span id="Select-2516"><a href="#Select-2516"><span class="linenos">2516</span></a><span class="sd"> >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()</span> +</span><span id="Select-2517"><a href="#Select-2517"><span class="linenos">2517</span></a><span class="sd"> 'SELECT x, COUNT(1) FROM tbl GROUP BY x'</span> +</span><span id="Select-2518"><a href="#Select-2518"><span class="linenos">2518</span></a> +</span><span id="Select-2519"><a href="#Select-2519"><span class="linenos">2519</span></a><span class="sd"> Args:</span> +</span><span id="Select-2520"><a href="#Select-2520"><span class="linenos">2520</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select-2521"><a href="#Select-2521"><span class="linenos">2521</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select-2522"><a href="#Select-2522"><span class="linenos">2522</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Group`.</span> +</span><span id="Select-2523"><a href="#Select-2523"><span class="linenos">2523</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-2524"><a href="#Select-2524"><span class="linenos">2524</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select-2525"><a href="#Select-2525"><span class="linenos">2525</span></a><span class="sd"> Otherwise, this flattens all the `Group` expression into a single expression.</span> +</span><span id="Select-2526"><a href="#Select-2526"><span class="linenos">2526</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select-2527"><a href="#Select-2527"><span class="linenos">2527</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2528"><a href="#Select-2528"><span class="linenos">2528</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2529"><a href="#Select-2529"><span class="linenos">2529</span></a> +</span><span id="Select-2530"><a href="#Select-2530"><span class="linenos">2530</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2531"><a href="#Select-2531"><span class="linenos">2531</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select-2532"><a href="#Select-2532"><span class="linenos">2532</span></a><span class="sd"> """</span> +</span><span id="Select-2533"><a href="#Select-2533"><span class="linenos">2533</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-2534"><a href="#Select-2534"><span class="linenos">2534</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-2535"><a href="#Select-2535"><span class="linenos">2535</span></a> +</span><span id="Select-2536"><a href="#Select-2536"><span class="linenos">2536</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select-2537"><a href="#Select-2537"><span class="linenos">2537</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2538"><a href="#Select-2538"><span class="linenos">2538</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2539"><a href="#Select-2539"><span class="linenos">2539</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"group"</span><span class="p">,</span> +</span><span id="Select-2540"><a href="#Select-2540"><span class="linenos">2540</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2541"><a href="#Select-2541"><span class="linenos">2541</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2542"><a href="#Select-2542"><span class="linenos">2542</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-2543"><a href="#Select-2543"><span class="linenos">2543</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Group</span><span class="p">,</span> +</span><span id="Select-2544"><a href="#Select-2544"><span class="linenos">2544</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2545"><a href="#Select-2545"><span class="linenos">2545</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2546"><a href="#Select-2546"><span class="linenos">2546</span></a> <span class="p">)</span> +</span><span id="Select-2547"><a href="#Select-2547"><span class="linenos">2547</span></a> +</span><span id="Select-2548"><a href="#Select-2548"><span class="linenos">2548</span></a> <span class="k">def</span> <span class="nf">order_by</span><span class="p">(</span> +</span><span id="Select-2549"><a href="#Select-2549"><span class="linenos">2549</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2550"><a href="#Select-2550"><span class="linenos">2550</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select-2551"><a href="#Select-2551"><span class="linenos">2551</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-2552"><a href="#Select-2552"><span class="linenos">2552</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-2553"><a href="#Select-2553"><span class="linenos">2553</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-2554"><a href="#Select-2554"><span class="linenos">2554</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2555"><a href="#Select-2555"><span class="linenos">2555</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2556"><a href="#Select-2556"><span class="linenos">2556</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2557"><a href="#Select-2557"><span class="linenos">2557</span></a><span class="sd"> Set the ORDER BY expression.</span> +</span><span id="Select-2558"><a href="#Select-2558"><span class="linenos">2558</span></a> +</span><span id="Select-2559"><a href="#Select-2559"><span class="linenos">2559</span></a><span class="sd"> Example:</span> +</span><span id="Select-2560"><a href="#Select-2560"><span class="linenos">2560</span></a><span class="sd"> >>> Select().from_("tbl").select("x").order_by("x DESC").sql()</span> +</span><span id="Select-2561"><a href="#Select-2561"><span class="linenos">2561</span></a><span class="sd"> 'SELECT x FROM tbl ORDER BY x DESC'</span> +</span><span id="Select-2562"><a href="#Select-2562"><span class="linenos">2562</span></a> +</span><span id="Select-2563"><a href="#Select-2563"><span class="linenos">2563</span></a><span class="sd"> Args:</span> +</span><span id="Select-2564"><a href="#Select-2564"><span class="linenos">2564</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select-2565"><a href="#Select-2565"><span class="linenos">2565</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select-2566"><a href="#Select-2566"><span class="linenos">2566</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Order`.</span> +</span><span id="Select-2567"><a href="#Select-2567"><span class="linenos">2567</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select-2568"><a href="#Select-2568"><span class="linenos">2568</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="Select-2569"><a href="#Select-2569"><span class="linenos">2569</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select-2570"><a href="#Select-2570"><span class="linenos">2570</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2571"><a href="#Select-2571"><span class="linenos">2571</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2572"><a href="#Select-2572"><span class="linenos">2572</span></a> +</span><span id="Select-2573"><a href="#Select-2573"><span class="linenos">2573</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2574"><a href="#Select-2574"><span class="linenos">2574</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select-2575"><a href="#Select-2575"><span class="linenos">2575</span></a><span class="sd"> """</span> +</span><span id="Select-2576"><a href="#Select-2576"><span class="linenos">2576</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select-2577"><a href="#Select-2577"><span class="linenos">2577</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2578"><a href="#Select-2578"><span class="linenos">2578</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2579"><a href="#Select-2579"><span class="linenos">2579</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"order"</span><span class="p">,</span> +</span><span id="Select-2580"><a href="#Select-2580"><span class="linenos">2580</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2581"><a href="#Select-2581"><span class="linenos">2581</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2582"><a href="#Select-2582"><span class="linenos">2582</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-2583"><a href="#Select-2583"><span class="linenos">2583</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Order</span><span class="p">,</span> +</span><span id="Select-2584"><a href="#Select-2584"><span class="linenos">2584</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2585"><a href="#Select-2585"><span class="linenos">2585</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2586"><a href="#Select-2586"><span class="linenos">2586</span></a> <span class="p">)</span> +</span><span id="Select-2587"><a href="#Select-2587"><span class="linenos">2587</span></a> +</span><span id="Select-2588"><a href="#Select-2588"><span class="linenos">2588</span></a> <span class="k">def</span> <span class="nf">sort_by</span><span class="p">(</span> +</span><span id="Select-2589"><a href="#Select-2589"><span class="linenos">2589</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2590"><a href="#Select-2590"><span class="linenos">2590</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select-2591"><a href="#Select-2591"><span class="linenos">2591</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-2592"><a href="#Select-2592"><span class="linenos">2592</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-2593"><a href="#Select-2593"><span class="linenos">2593</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-2594"><a href="#Select-2594"><span class="linenos">2594</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2595"><a href="#Select-2595"><span class="linenos">2595</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2596"><a href="#Select-2596"><span class="linenos">2596</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2597"><a href="#Select-2597"><span class="linenos">2597</span></a><span class="sd"> Set the SORT BY expression.</span> +</span><span id="Select-2598"><a href="#Select-2598"><span class="linenos">2598</span></a> +</span><span id="Select-2599"><a href="#Select-2599"><span class="linenos">2599</span></a><span class="sd"> Example:</span> +</span><span id="Select-2600"><a href="#Select-2600"><span class="linenos">2600</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sort_by("x DESC").sql(dialect="hive")</span> +</span><span id="Select-2601"><a href="#Select-2601"><span class="linenos">2601</span></a><span class="sd"> 'SELECT x FROM tbl SORT BY x DESC'</span> +</span><span id="Select-2602"><a href="#Select-2602"><span class="linenos">2602</span></a> +</span><span id="Select-2603"><a href="#Select-2603"><span class="linenos">2603</span></a><span class="sd"> Args:</span> +</span><span id="Select-2604"><a href="#Select-2604"><span class="linenos">2604</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select-2605"><a href="#Select-2605"><span class="linenos">2605</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select-2606"><a href="#Select-2606"><span class="linenos">2606</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `SORT`.</span> +</span><span id="Select-2607"><a href="#Select-2607"><span class="linenos">2607</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select-2608"><a href="#Select-2608"><span class="linenos">2608</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="Select-2609"><a href="#Select-2609"><span class="linenos">2609</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select-2610"><a href="#Select-2610"><span class="linenos">2610</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2611"><a href="#Select-2611"><span class="linenos">2611</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2612"><a href="#Select-2612"><span class="linenos">2612</span></a> +</span><span id="Select-2613"><a href="#Select-2613"><span class="linenos">2613</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2614"><a href="#Select-2614"><span class="linenos">2614</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select-2615"><a href="#Select-2615"><span class="linenos">2615</span></a><span class="sd"> """</span> +</span><span id="Select-2616"><a href="#Select-2616"><span class="linenos">2616</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select-2617"><a href="#Select-2617"><span class="linenos">2617</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2618"><a href="#Select-2618"><span class="linenos">2618</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2619"><a href="#Select-2619"><span class="linenos">2619</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"sort"</span><span class="p">,</span> +</span><span id="Select-2620"><a href="#Select-2620"><span class="linenos">2620</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2621"><a href="#Select-2621"><span class="linenos">2621</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2622"><a href="#Select-2622"><span class="linenos">2622</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-2623"><a href="#Select-2623"><span class="linenos">2623</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Sort</span><span class="p">,</span> +</span><span id="Select-2624"><a href="#Select-2624"><span class="linenos">2624</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2625"><a href="#Select-2625"><span class="linenos">2625</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2626"><a href="#Select-2626"><span class="linenos">2626</span></a> <span class="p">)</span> +</span><span id="Select-2627"><a href="#Select-2627"><span class="linenos">2627</span></a> +</span><span id="Select-2628"><a href="#Select-2628"><span class="linenos">2628</span></a> <span class="k">def</span> <span class="nf">cluster_by</span><span class="p">(</span> +</span><span id="Select-2629"><a href="#Select-2629"><span class="linenos">2629</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2630"><a href="#Select-2630"><span class="linenos">2630</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select-2631"><a href="#Select-2631"><span class="linenos">2631</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-2632"><a href="#Select-2632"><span class="linenos">2632</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-2633"><a href="#Select-2633"><span class="linenos">2633</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-2634"><a href="#Select-2634"><span class="linenos">2634</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2635"><a href="#Select-2635"><span class="linenos">2635</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2636"><a href="#Select-2636"><span class="linenos">2636</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2637"><a href="#Select-2637"><span class="linenos">2637</span></a><span class="sd"> Set the CLUSTER BY expression.</span> +</span><span id="Select-2638"><a href="#Select-2638"><span class="linenos">2638</span></a> +</span><span id="Select-2639"><a href="#Select-2639"><span class="linenos">2639</span></a><span class="sd"> Example:</span> +</span><span id="Select-2640"><a href="#Select-2640"><span class="linenos">2640</span></a><span class="sd"> >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql(dialect="hive")</span> +</span><span id="Select-2641"><a href="#Select-2641"><span class="linenos">2641</span></a><span class="sd"> 'SELECT x FROM tbl CLUSTER BY x DESC'</span> +</span><span id="Select-2642"><a href="#Select-2642"><span class="linenos">2642</span></a> +</span><span id="Select-2643"><a href="#Select-2643"><span class="linenos">2643</span></a><span class="sd"> Args:</span> +</span><span id="Select-2644"><a href="#Select-2644"><span class="linenos">2644</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select-2645"><a href="#Select-2645"><span class="linenos">2645</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select-2646"><a href="#Select-2646"><span class="linenos">2646</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Cluster`.</span> +</span><span id="Select-2647"><a href="#Select-2647"><span class="linenos">2647</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select-2648"><a href="#Select-2648"><span class="linenos">2648</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="Select-2649"><a href="#Select-2649"><span class="linenos">2649</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select-2650"><a href="#Select-2650"><span class="linenos">2650</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2651"><a href="#Select-2651"><span class="linenos">2651</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2652"><a href="#Select-2652"><span class="linenos">2652</span></a> +</span><span id="Select-2653"><a href="#Select-2653"><span class="linenos">2653</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2654"><a href="#Select-2654"><span class="linenos">2654</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select-2655"><a href="#Select-2655"><span class="linenos">2655</span></a><span class="sd"> """</span> +</span><span id="Select-2656"><a href="#Select-2656"><span class="linenos">2656</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select-2657"><a href="#Select-2657"><span class="linenos">2657</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2658"><a href="#Select-2658"><span class="linenos">2658</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2659"><a href="#Select-2659"><span class="linenos">2659</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"cluster"</span><span class="p">,</span> +</span><span id="Select-2660"><a href="#Select-2660"><span class="linenos">2660</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2661"><a href="#Select-2661"><span class="linenos">2661</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2662"><a href="#Select-2662"><span class="linenos">2662</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-2663"><a href="#Select-2663"><span class="linenos">2663</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Cluster</span><span class="p">,</span> +</span><span id="Select-2664"><a href="#Select-2664"><span class="linenos">2664</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2665"><a href="#Select-2665"><span class="linenos">2665</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2666"><a href="#Select-2666"><span class="linenos">2666</span></a> <span class="p">)</span> +</span><span id="Select-2667"><a href="#Select-2667"><span class="linenos">2667</span></a> +</span><span id="Select-2668"><a href="#Select-2668"><span class="linenos">2668</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> +</span><span id="Select-2669"><a href="#Select-2669"><span class="linenos">2669</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> +</span><span id="Select-2670"><a href="#Select-2670"><span class="linenos">2670</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2671"><a href="#Select-2671"><span class="linenos">2671</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2672"><a href="#Select-2672"><span class="linenos">2672</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="Select-2673"><a href="#Select-2673"><span class="linenos">2673</span></a> +</span><span id="Select-2674"><a href="#Select-2674"><span class="linenos">2674</span></a><span class="sd"> Example:</span> +</span><span id="Select-2675"><a href="#Select-2675"><span class="linenos">2675</span></a><span class="sd"> >>> Select().from_("tbl").select("x").limit(10).sql()</span> +</span><span id="Select-2676"><a href="#Select-2676"><span class="linenos">2676</span></a><span class="sd"> 'SELECT x FROM tbl LIMIT 10'</span> +</span><span id="Select-2677"><a href="#Select-2677"><span class="linenos">2677</span></a> +</span><span id="Select-2678"><a href="#Select-2678"><span class="linenos">2678</span></a><span class="sd"> Args:</span> +</span><span id="Select-2679"><a href="#Select-2679"><span class="linenos">2679</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="Select-2680"><a href="#Select-2680"><span class="linenos">2680</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="Select-2681"><a href="#Select-2681"><span class="linenos">2681</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> +</span><span id="Select-2682"><a href="#Select-2682"><span class="linenos">2682</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> +</span><span id="Select-2683"><a href="#Select-2683"><span class="linenos">2683</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select-2684"><a href="#Select-2684"><span class="linenos">2684</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2685"><a href="#Select-2685"><span class="linenos">2685</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2686"><a href="#Select-2686"><span class="linenos">2686</span></a> +</span><span id="Select-2687"><a href="#Select-2687"><span class="linenos">2687</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2688"><a href="#Select-2688"><span class="linenos">2688</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2689"><a href="#Select-2689"><span class="linenos">2689</span></a><span class="sd"> """</span> +</span><span id="Select-2690"><a href="#Select-2690"><span class="linenos">2690</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Select-2691"><a href="#Select-2691"><span class="linenos">2691</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="Select-2692"><a href="#Select-2692"><span class="linenos">2692</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2693"><a href="#Select-2693"><span class="linenos">2693</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"limit"</span><span class="p">,</span> +</span><span id="Select-2694"><a href="#Select-2694"><span class="linenos">2694</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Limit</span><span class="p">,</span> +</span><span id="Select-2695"><a href="#Select-2695"><span class="linenos">2695</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LIMIT"</span><span class="p">,</span> +</span><span id="Select-2696"><a href="#Select-2696"><span class="linenos">2696</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2697"><a href="#Select-2697"><span class="linenos">2697</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2698"><a href="#Select-2698"><span class="linenos">2698</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2699"><a href="#Select-2699"><span class="linenos">2699</span></a> <span class="p">)</span> +</span><span id="Select-2700"><a href="#Select-2700"><span class="linenos">2700</span></a> +</span><span id="Select-2701"><a href="#Select-2701"><span class="linenos">2701</span></a> <span class="k">def</span> <span class="nf">offset</span><span class="p">(</span> +</span><span id="Select-2702"><a href="#Select-2702"><span class="linenos">2702</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> +</span><span id="Select-2703"><a href="#Select-2703"><span class="linenos">2703</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2704"><a href="#Select-2704"><span class="linenos">2704</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2705"><a href="#Select-2705"><span class="linenos">2705</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="Select-2706"><a href="#Select-2706"><span class="linenos">2706</span></a> +</span><span id="Select-2707"><a href="#Select-2707"><span class="linenos">2707</span></a><span class="sd"> Example:</span> +</span><span id="Select-2708"><a href="#Select-2708"><span class="linenos">2708</span></a><span class="sd"> >>> Select().from_("tbl").select("x").offset(10).sql()</span> +</span><span id="Select-2709"><a href="#Select-2709"><span class="linenos">2709</span></a><span class="sd"> 'SELECT x FROM tbl OFFSET 10'</span> +</span><span id="Select-2710"><a href="#Select-2710"><span class="linenos">2710</span></a> +</span><span id="Select-2711"><a href="#Select-2711"><span class="linenos">2711</span></a><span class="sd"> Args:</span> +</span><span id="Select-2712"><a href="#Select-2712"><span class="linenos">2712</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="Select-2713"><a href="#Select-2713"><span class="linenos">2713</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="Select-2714"><a href="#Select-2714"><span class="linenos">2714</span></a><span class="sd"> If a `Offset` instance is passed, this is used as-is.</span> +</span><span id="Select-2715"><a href="#Select-2715"><span class="linenos">2715</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Offset`.</span> +</span><span id="Select-2716"><a href="#Select-2716"><span class="linenos">2716</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select-2717"><a href="#Select-2717"><span class="linenos">2717</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2718"><a href="#Select-2718"><span class="linenos">2718</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2719"><a href="#Select-2719"><span class="linenos">2719</span></a> +</span><span id="Select-2720"><a href="#Select-2720"><span class="linenos">2720</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2721"><a href="#Select-2721"><span class="linenos">2721</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select-2722"><a href="#Select-2722"><span class="linenos">2722</span></a><span class="sd"> """</span> +</span><span id="Select-2723"><a href="#Select-2723"><span class="linenos">2723</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Select-2724"><a href="#Select-2724"><span class="linenos">2724</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="Select-2725"><a href="#Select-2725"><span class="linenos">2725</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2726"><a href="#Select-2726"><span class="linenos">2726</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"offset"</span><span class="p">,</span> +</span><span id="Select-2727"><a href="#Select-2727"><span class="linenos">2727</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Offset</span><span class="p">,</span> +</span><span id="Select-2728"><a href="#Select-2728"><span class="linenos">2728</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"OFFSET"</span><span class="p">,</span> +</span><span id="Select-2729"><a href="#Select-2729"><span class="linenos">2729</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2730"><a href="#Select-2730"><span class="linenos">2730</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2731"><a href="#Select-2731"><span class="linenos">2731</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2732"><a href="#Select-2732"><span class="linenos">2732</span></a> <span class="p">)</span> +</span><span id="Select-2733"><a href="#Select-2733"><span class="linenos">2733</span></a> +</span><span id="Select-2734"><a href="#Select-2734"><span class="linenos">2734</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> +</span><span id="Select-2735"><a href="#Select-2735"><span class="linenos">2735</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2736"><a href="#Select-2736"><span class="linenos">2736</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select-2737"><a href="#Select-2737"><span class="linenos">2737</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-2738"><a href="#Select-2738"><span class="linenos">2738</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-2739"><a href="#Select-2739"><span class="linenos">2739</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-2740"><a href="#Select-2740"><span class="linenos">2740</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2741"><a href="#Select-2741"><span class="linenos">2741</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2742"><a href="#Select-2742"><span class="linenos">2742</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2743"><a href="#Select-2743"><span class="linenos">2743</span></a><span class="sd"> Append to or set the SELECT expressions.</span> +</span><span id="Select-2744"><a href="#Select-2744"><span class="linenos">2744</span></a> +</span><span id="Select-2745"><a href="#Select-2745"><span class="linenos">2745</span></a><span class="sd"> Example:</span> +</span><span id="Select-2746"><a href="#Select-2746"><span class="linenos">2746</span></a><span class="sd"> >>> Select().select("x", "y").sql()</span> +</span><span id="Select-2747"><a href="#Select-2747"><span class="linenos">2747</span></a><span class="sd"> 'SELECT x, y'</span> +</span><span id="Select-2748"><a href="#Select-2748"><span class="linenos">2748</span></a> +</span><span id="Select-2749"><a href="#Select-2749"><span class="linenos">2749</span></a><span class="sd"> Args:</span> +</span><span id="Select-2750"><a href="#Select-2750"><span class="linenos">2750</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select-2751"><a href="#Select-2751"><span class="linenos">2751</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2752"><a href="#Select-2752"><span class="linenos">2752</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select-2753"><a href="#Select-2753"><span class="linenos">2753</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Select-2754"><a href="#Select-2754"><span class="linenos">2754</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Select-2755"><a href="#Select-2755"><span class="linenos">2755</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2756"><a href="#Select-2756"><span class="linenos">2756</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2757"><a href="#Select-2757"><span class="linenos">2757</span></a> +</span><span id="Select-2758"><a href="#Select-2758"><span class="linenos">2758</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2759"><a href="#Select-2759"><span class="linenos">2759</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select-2760"><a href="#Select-2760"><span class="linenos">2760</span></a><span class="sd"> """</span> +</span><span id="Select-2761"><a href="#Select-2761"><span class="linenos">2761</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select-2762"><a href="#Select-2762"><span class="linenos">2762</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2763"><a href="#Select-2763"><span class="linenos">2763</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2764"><a href="#Select-2764"><span class="linenos">2764</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="Select-2765"><a href="#Select-2765"><span class="linenos">2765</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2766"><a href="#Select-2766"><span class="linenos">2766</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2767"><a href="#Select-2767"><span class="linenos">2767</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2768"><a href="#Select-2768"><span class="linenos">2768</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2769"><a href="#Select-2769"><span class="linenos">2769</span></a> <span class="p">)</span> +</span><span id="Select-2770"><a href="#Select-2770"><span class="linenos">2770</span></a> +</span><span id="Select-2771"><a href="#Select-2771"><span class="linenos">2771</span></a> <span class="k">def</span> <span class="nf">lateral</span><span class="p">(</span> +</span><span id="Select-2772"><a href="#Select-2772"><span class="linenos">2772</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2773"><a href="#Select-2773"><span class="linenos">2773</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select-2774"><a href="#Select-2774"><span class="linenos">2774</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-2775"><a href="#Select-2775"><span class="linenos">2775</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-2776"><a href="#Select-2776"><span class="linenos">2776</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-2777"><a href="#Select-2777"><span class="linenos">2777</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2778"><a href="#Select-2778"><span class="linenos">2778</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2779"><a href="#Select-2779"><span class="linenos">2779</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2780"><a href="#Select-2780"><span class="linenos">2780</span></a><span class="sd"> Append to or set the LATERAL expressions.</span> +</span><span id="Select-2781"><a href="#Select-2781"><span class="linenos">2781</span></a> +</span><span id="Select-2782"><a href="#Select-2782"><span class="linenos">2782</span></a><span class="sd"> Example:</span> +</span><span id="Select-2783"><a href="#Select-2783"><span class="linenos">2783</span></a><span class="sd"> >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()</span> +</span><span id="Select-2784"><a href="#Select-2784"><span class="linenos">2784</span></a><span class="sd"> 'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'</span> +</span><span id="Select-2785"><a href="#Select-2785"><span class="linenos">2785</span></a> +</span><span id="Select-2786"><a href="#Select-2786"><span class="linenos">2786</span></a><span class="sd"> Args:</span> +</span><span id="Select-2787"><a href="#Select-2787"><span class="linenos">2787</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select-2788"><a href="#Select-2788"><span class="linenos">2788</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2789"><a href="#Select-2789"><span class="linenos">2789</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select-2790"><a href="#Select-2790"><span class="linenos">2790</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Select-2791"><a href="#Select-2791"><span class="linenos">2791</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Select-2792"><a href="#Select-2792"><span class="linenos">2792</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2793"><a href="#Select-2793"><span class="linenos">2793</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2794"><a href="#Select-2794"><span class="linenos">2794</span></a> +</span><span id="Select-2795"><a href="#Select-2795"><span class="linenos">2795</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2796"><a href="#Select-2796"><span class="linenos">2796</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select-2797"><a href="#Select-2797"><span class="linenos">2797</span></a><span class="sd"> """</span> +</span><span id="Select-2798"><a href="#Select-2798"><span class="linenos">2798</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select-2799"><a href="#Select-2799"><span class="linenos">2799</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2800"><a href="#Select-2800"><span class="linenos">2800</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2801"><a href="#Select-2801"><span class="linenos">2801</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"laterals"</span><span class="p">,</span> +</span><span id="Select-2802"><a href="#Select-2802"><span class="linenos">2802</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2803"><a href="#Select-2803"><span class="linenos">2803</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Lateral</span><span class="p">,</span> +</span><span id="Select-2804"><a href="#Select-2804"><span class="linenos">2804</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-2805"><a href="#Select-2805"><span class="linenos">2805</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2806"><a href="#Select-2806"><span class="linenos">2806</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2807"><a href="#Select-2807"><span class="linenos">2807</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2808"><a href="#Select-2808"><span class="linenos">2808</span></a> <span class="p">)</span> +</span><span id="Select-2809"><a href="#Select-2809"><span class="linenos">2809</span></a> +</span><span id="Select-2810"><a href="#Select-2810"><span class="linenos">2810</span></a> <span class="k">def</span> <span class="nf">join</span><span class="p">(</span> +</span><span id="Select-2811"><a href="#Select-2811"><span class="linenos">2811</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2812"><a href="#Select-2812"><span class="linenos">2812</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Select-2813"><a href="#Select-2813"><span class="linenos">2813</span></a> <span class="n">on</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Select-2814"><a href="#Select-2814"><span class="linenos">2814</span></a> <span class="n">using</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">ExpOrStr</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">ExpOrStr</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Select-2815"><a href="#Select-2815"><span class="linenos">2815</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-2816"><a href="#Select-2816"><span class="linenos">2816</span></a> <span class="n">join_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="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Select-2817"><a href="#Select-2817"><span class="linenos">2817</span></a> <span class="n">join_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="n">Identifier</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="Select-2818"><a href="#Select-2818"><span class="linenos">2818</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-2819"><a href="#Select-2819"><span class="linenos">2819</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-2820"><a href="#Select-2820"><span class="linenos">2820</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2821"><a href="#Select-2821"><span class="linenos">2821</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2822"><a href="#Select-2822"><span class="linenos">2822</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2823"><a href="#Select-2823"><span class="linenos">2823</span></a><span class="sd"> Append to or set the JOIN expressions.</span> +</span><span id="Select-2824"><a href="#Select-2824"><span class="linenos">2824</span></a> +</span><span id="Select-2825"><a href="#Select-2825"><span class="linenos">2825</span></a><span class="sd"> Example:</span> +</span><span id="Select-2826"><a href="#Select-2826"><span class="linenos">2826</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()</span> +</span><span id="Select-2827"><a href="#Select-2827"><span class="linenos">2827</span></a><span class="sd"> 'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'</span> +</span><span id="Select-2828"><a href="#Select-2828"><span class="linenos">2828</span></a> +</span><span id="Select-2829"><a href="#Select-2829"><span class="linenos">2829</span></a><span class="sd"> >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()</span> +</span><span id="Select-2830"><a href="#Select-2830"><span class="linenos">2830</span></a><span class="sd"> 'SELECT 1 FROM a JOIN b USING (x, y, z)'</span> +</span><span id="Select-2831"><a href="#Select-2831"><span class="linenos">2831</span></a> +</span><span id="Select-2832"><a href="#Select-2832"><span class="linenos">2832</span></a><span class="sd"> Use `join_type` to change the type of join:</span> </span><span id="Select-2833"><a href="#Select-2833"><span class="linenos">2833</span></a> -</span><span id="Select-2834"><a href="#Select-2834"><span class="linenos">2834</span></a><span class="sd"> Use `join_type` to change the type of join:</span> -</span><span id="Select-2835"><a href="#Select-2835"><span class="linenos">2835</span></a> -</span><span id="Select-2836"><a href="#Select-2836"><span class="linenos">2836</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-2837"><a href="#Select-2837"><span class="linenos">2837</span></a><span class="sd"> 'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'</span> -</span><span id="Select-2838"><a href="#Select-2838"><span class="linenos">2838</span></a> -</span><span id="Select-2839"><a href="#Select-2839"><span class="linenos">2839</span></a><span class="sd"> Args:</span> -</span><span id="Select-2840"><a href="#Select-2840"><span class="linenos">2840</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="Select-2834"><a href="#Select-2834"><span class="linenos">2834</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-2835"><a href="#Select-2835"><span class="linenos">2835</span></a><span class="sd"> 'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'</span> +</span><span id="Select-2836"><a href="#Select-2836"><span class="linenos">2836</span></a> +</span><span id="Select-2837"><a href="#Select-2837"><span class="linenos">2837</span></a><span class="sd"> Args:</span> +</span><span id="Select-2838"><a href="#Select-2838"><span class="linenos">2838</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="Select-2839"><a href="#Select-2839"><span class="linenos">2839</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2840"><a href="#Select-2840"><span class="linenos">2840</span></a><span class="sd"> on: optionally specify the join "on" criteria as a SQL string.</span> </span><span id="Select-2841"><a href="#Select-2841"><span class="linenos">2841</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2842"><a href="#Select-2842"><span class="linenos">2842</span></a><span class="sd"> on: optionally specify the join "on" criteria as a SQL string.</span> +</span><span id="Select-2842"><a href="#Select-2842"><span class="linenos">2842</span></a><span class="sd"> using: optionally specify the join "using" criteria as a SQL string.</span> </span><span id="Select-2843"><a href="#Select-2843"><span class="linenos">2843</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2844"><a href="#Select-2844"><span class="linenos">2844</span></a><span class="sd"> using: optionally specify the join "using" criteria as a SQL string.</span> -</span><span id="Select-2845"><a href="#Select-2845"><span class="linenos">2845</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2846"><a href="#Select-2846"><span class="linenos">2846</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select-2847"><a href="#Select-2847"><span class="linenos">2847</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Select-2848"><a href="#Select-2848"><span class="linenos">2848</span></a><span class="sd"> join_type: if set, alter the parsed join type.</span> -</span><span id="Select-2849"><a href="#Select-2849"><span class="linenos">2849</span></a><span class="sd"> join_alias: an optional alias for the joined source.</span> -</span><span id="Select-2850"><a href="#Select-2850"><span class="linenos">2850</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Select-2851"><a href="#Select-2851"><span class="linenos">2851</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2852"><a href="#Select-2852"><span class="linenos">2852</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2853"><a href="#Select-2853"><span class="linenos">2853</span></a> -</span><span id="Select-2854"><a href="#Select-2854"><span class="linenos">2854</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2855"><a href="#Select-2855"><span class="linenos">2855</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-2856"><a href="#Select-2856"><span class="linenos">2856</span></a><span class="sd"> """</span> -</span><span id="Select-2857"><a href="#Select-2857"><span class="linenos">2857</span></a> <span class="n">parse_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 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-2858"><a href="#Select-2858"><span class="linenos">2858</span></a> -</span><span id="Select-2859"><a href="#Select-2859"><span class="linenos">2859</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="Select-2860"><a href="#Select-2860"><span class="linenos">2860</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-2861"><a href="#Select-2861"><span class="linenos">2861</span></a> <span class="k">except</span> <span class="n">ParseError</span><span class="p">:</span> -</span><span id="Select-2862"><a href="#Select-2862"><span class="linenos">2862</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-2844"><a href="#Select-2844"><span class="linenos">2844</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select-2845"><a href="#Select-2845"><span class="linenos">2845</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Select-2846"><a href="#Select-2846"><span class="linenos">2846</span></a><span class="sd"> join_type: if set, alter the parsed join type.</span> +</span><span id="Select-2847"><a href="#Select-2847"><span class="linenos">2847</span></a><span class="sd"> join_alias: an optional alias for the joined source.</span> +</span><span id="Select-2848"><a href="#Select-2848"><span class="linenos">2848</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Select-2849"><a href="#Select-2849"><span class="linenos">2849</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2850"><a href="#Select-2850"><span class="linenos">2850</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2851"><a href="#Select-2851"><span class="linenos">2851</span></a> +</span><span id="Select-2852"><a href="#Select-2852"><span class="linenos">2852</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2853"><a href="#Select-2853"><span class="linenos">2853</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2854"><a href="#Select-2854"><span class="linenos">2854</span></a><span class="sd"> """</span> +</span><span id="Select-2855"><a href="#Select-2855"><span class="linenos">2855</span></a> <span class="n">parse_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 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-2856"><a href="#Select-2856"><span class="linenos">2856</span></a> +</span><span id="Select-2857"><a href="#Select-2857"><span class="linenos">2857</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="Select-2858"><a href="#Select-2858"><span class="linenos">2858</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-2859"><a href="#Select-2859"><span class="linenos">2859</span></a> <span class="k">except</span> <span class="n">ParseError</span><span class="p">:</span> +</span><span id="Select-2860"><a href="#Select-2860"><span class="linenos">2860</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-2861"><a href="#Select-2861"><span class="linenos">2861</span></a> +</span><span id="Select-2862"><a href="#Select-2862"><span class="linenos">2862</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-2863"><a href="#Select-2863"><span class="linenos">2863</span></a> -</span><span id="Select-2864"><a href="#Select-2864"><span class="linenos">2864</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-2865"><a href="#Select-2865"><span class="linenos">2865</span></a> -</span><span id="Select-2866"><a href="#Select-2866"><span class="linenos">2866</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-2867"><a href="#Select-2867"><span class="linenos">2867</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-2868"><a href="#Select-2868"><span class="linenos">2868</span></a> -</span><span id="Select-2869"><a href="#Select-2869"><span class="linenos">2869</span></a> <span class="k">if</span> <span class="n">join_type</span><span class="p">:</span> -</span><span id="Select-2870"><a href="#Select-2870"><span class="linenos">2870</span></a> <span class="n">method</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-2871"><a href="#Select-2871"><span class="linenos">2871</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-2872"><a href="#Select-2872"><span class="linenos">2872</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-2864"><a href="#Select-2864"><span class="linenos">2864</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-2865"><a href="#Select-2865"><span class="linenos">2865</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-2866"><a href="#Select-2866"><span class="linenos">2866</span></a> +</span><span id="Select-2867"><a href="#Select-2867"><span class="linenos">2867</span></a> <span class="k">if</span> <span class="n">join_type</span><span class="p">:</span> +</span><span id="Select-2868"><a href="#Select-2868"><span class="linenos">2868</span></a> <span class="n">method</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-2869"><a href="#Select-2869"><span class="linenos">2869</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-2870"><a href="#Select-2870"><span class="linenos">2870</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-2871"><a href="#Select-2871"><span class="linenos">2871</span></a> +</span><span id="Select-2872"><a href="#Select-2872"><span class="linenos">2872</span></a> <span class="n">method</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-2873"><a href="#Select-2873"><span class="linenos">2873</span></a> -</span><span id="Select-2874"><a href="#Select-2874"><span class="linenos">2874</span></a> <span class="n">method</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-2875"><a href="#Select-2875"><span class="linenos">2875</span></a> -</span><span id="Select-2876"><a href="#Select-2876"><span class="linenos">2876</span></a> <span class="k">if</span> <span class="n">method</span><span class="p">:</span> -</span><span id="Select-2877"><a href="#Select-2877"><span class="linenos">2877</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"method"</span><span class="p">,</span> <span class="n">method</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> -</span><span id="Select-2878"><a href="#Select-2878"><span class="linenos">2878</span></a> <span class="k">if</span> <span class="n">side</span><span class="p">:</span> -</span><span id="Select-2879"><a href="#Select-2879"><span class="linenos">2879</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-2880"><a href="#Select-2880"><span class="linenos">2880</span></a> <span class="k">if</span> <span class="n">kind</span><span class="p">:</span> -</span><span id="Select-2881"><a href="#Select-2881"><span class="linenos">2881</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-2882"><a href="#Select-2882"><span class="linenos">2882</span></a> -</span><span id="Select-2883"><a href="#Select-2883"><span class="linenos">2883</span></a> <span class="k">if</span> <span class="n">on</span><span class="p">:</span> -</span><span id="Select-2884"><a href="#Select-2884"><span class="linenos">2884</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_list</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Select-2885"><a href="#Select-2885"><span class="linenos">2885</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-2886"><a href="#Select-2886"><span class="linenos">2886</span></a> -</span><span id="Select-2887"><a href="#Select-2887"><span class="linenos">2887</span></a> <span class="k">if</span> <span class="n">using</span><span class="p">:</span> -</span><span id="Select-2888"><a href="#Select-2888"><span class="linenos">2888</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-2889"><a href="#Select-2889"><span class="linenos">2889</span></a> <span class="o">*</span><span class="n">ensure_list</span><span class="p">(</span><span class="n">using</span><span class="p">),</span> -</span><span id="Select-2890"><a href="#Select-2890"><span class="linenos">2890</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">join</span><span class="p">,</span> -</span><span id="Select-2891"><a href="#Select-2891"><span class="linenos">2891</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> -</span><span id="Select-2892"><a href="#Select-2892"><span class="linenos">2892</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2893"><a href="#Select-2893"><span class="linenos">2893</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2894"><a href="#Select-2894"><span class="linenos">2894</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2895"><a href="#Select-2895"><span class="linenos">2895</span></a> <span class="p">)</span> -</span><span id="Select-2896"><a href="#Select-2896"><span class="linenos">2896</span></a> -</span><span id="Select-2897"><a href="#Select-2897"><span class="linenos">2897</span></a> <span class="k">if</span> <span class="n">join_alias</span><span class="p">:</span> -</span><span id="Select-2898"><a href="#Select-2898"><span class="linenos">2898</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-2899"><a href="#Select-2899"><span class="linenos">2899</span></a> -</span><span id="Select-2900"><a href="#Select-2900"><span class="linenos">2900</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select-2901"><a href="#Select-2901"><span class="linenos">2901</span></a> <span class="n">join</span><span class="p">,</span> -</span><span id="Select-2902"><a href="#Select-2902"><span class="linenos">2902</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2903"><a href="#Select-2903"><span class="linenos">2903</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"joins"</span><span class="p">,</span> -</span><span id="Select-2904"><a href="#Select-2904"><span class="linenos">2904</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2905"><a href="#Select-2905"><span class="linenos">2905</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2906"><a href="#Select-2906"><span class="linenos">2906</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2907"><a href="#Select-2907"><span class="linenos">2907</span></a> <span class="p">)</span> -</span><span id="Select-2908"><a href="#Select-2908"><span class="linenos">2908</span></a> -</span><span id="Select-2909"><a href="#Select-2909"><span class="linenos">2909</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span> -</span><span id="Select-2910"><a href="#Select-2910"><span class="linenos">2910</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2911"><a href="#Select-2911"><span class="linenos">2911</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select-2912"><a href="#Select-2912"><span class="linenos">2912</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-2913"><a href="#Select-2913"><span class="linenos">2913</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-2914"><a href="#Select-2914"><span class="linenos">2914</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-2915"><a href="#Select-2915"><span class="linenos">2915</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2916"><a href="#Select-2916"><span class="linenos">2916</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2917"><a href="#Select-2917"><span class="linenos">2917</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2918"><a href="#Select-2918"><span class="linenos">2918</span></a><span class="sd"> Append to or set the WHERE expressions.</span> -</span><span id="Select-2919"><a href="#Select-2919"><span class="linenos">2919</span></a> -</span><span id="Select-2920"><a href="#Select-2920"><span class="linenos">2920</span></a><span class="sd"> Example:</span> -</span><span id="Select-2921"><a href="#Select-2921"><span class="linenos">2921</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()</span> -</span><span id="Select-2922"><a href="#Select-2922"><span class="linenos">2922</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"</span> -</span><span id="Select-2923"><a href="#Select-2923"><span class="linenos">2923</span></a> -</span><span id="Select-2924"><a href="#Select-2924"><span class="linenos">2924</span></a><span class="sd"> Args:</span> -</span><span id="Select-2925"><a href="#Select-2925"><span class="linenos">2925</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select-2926"><a href="#Select-2926"><span class="linenos">2926</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2927"><a href="#Select-2927"><span class="linenos">2927</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Select-2928"><a href="#Select-2928"><span class="linenos">2928</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Select-2929"><a href="#Select-2929"><span class="linenos">2929</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Select-2930"><a href="#Select-2930"><span class="linenos">2930</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Select-2931"><a href="#Select-2931"><span class="linenos">2931</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2932"><a href="#Select-2932"><span class="linenos">2932</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2933"><a href="#Select-2933"><span class="linenos">2933</span></a> -</span><span id="Select-2934"><a href="#Select-2934"><span class="linenos">2934</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2935"><a href="#Select-2935"><span class="linenos">2935</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-2936"><a href="#Select-2936"><span class="linenos">2936</span></a><span class="sd"> """</span> -</span><span id="Select-2937"><a href="#Select-2937"><span class="linenos">2937</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Select-2938"><a href="#Select-2938"><span class="linenos">2938</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2939"><a href="#Select-2939"><span class="linenos">2939</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2940"><a href="#Select-2940"><span class="linenos">2940</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> -</span><span id="Select-2941"><a href="#Select-2941"><span class="linenos">2941</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2942"><a href="#Select-2942"><span class="linenos">2942</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> -</span><span id="Select-2943"><a href="#Select-2943"><span class="linenos">2943</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2944"><a href="#Select-2944"><span class="linenos">2944</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2945"><a href="#Select-2945"><span class="linenos">2945</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2946"><a href="#Select-2946"><span class="linenos">2946</span></a> <span class="p">)</span> -</span><span id="Select-2947"><a href="#Select-2947"><span class="linenos">2947</span></a> -</span><span id="Select-2948"><a href="#Select-2948"><span class="linenos">2948</span></a> <span class="k">def</span> <span class="nf">having</span><span class="p">(</span> -</span><span id="Select-2949"><a href="#Select-2949"><span class="linenos">2949</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2950"><a href="#Select-2950"><span class="linenos">2950</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select-2951"><a href="#Select-2951"><span class="linenos">2951</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-2952"><a href="#Select-2952"><span class="linenos">2952</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-2953"><a href="#Select-2953"><span class="linenos">2953</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-2954"><a href="#Select-2954"><span class="linenos">2954</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2955"><a href="#Select-2955"><span class="linenos">2955</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2956"><a href="#Select-2956"><span class="linenos">2956</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2957"><a href="#Select-2957"><span class="linenos">2957</span></a><span class="sd"> Append to or set the HAVING expressions.</span> -</span><span id="Select-2958"><a href="#Select-2958"><span class="linenos">2958</span></a> -</span><span id="Select-2959"><a href="#Select-2959"><span class="linenos">2959</span></a><span class="sd"> Example:</span> -</span><span id="Select-2960"><a href="#Select-2960"><span class="linenos">2960</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-2961"><a href="#Select-2961"><span class="linenos">2961</span></a><span class="sd"> 'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'</span> -</span><span id="Select-2962"><a href="#Select-2962"><span class="linenos">2962</span></a> -</span><span id="Select-2963"><a href="#Select-2963"><span class="linenos">2963</span></a><span class="sd"> Args:</span> -</span><span id="Select-2964"><a href="#Select-2964"><span class="linenos">2964</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select-2965"><a href="#Select-2965"><span class="linenos">2965</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2966"><a href="#Select-2966"><span class="linenos">2966</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Select-2967"><a href="#Select-2967"><span class="linenos">2967</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Select-2968"><a href="#Select-2968"><span class="linenos">2968</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Select-2969"><a href="#Select-2969"><span class="linenos">2969</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Select-2970"><a href="#Select-2970"><span class="linenos">2970</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2971"><a href="#Select-2971"><span class="linenos">2971</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2972"><a href="#Select-2972"><span class="linenos">2972</span></a> -</span><span id="Select-2973"><a href="#Select-2973"><span class="linenos">2973</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2974"><a href="#Select-2974"><span class="linenos">2974</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select-2975"><a href="#Select-2975"><span class="linenos">2975</span></a><span class="sd"> """</span> -</span><span id="Select-2976"><a href="#Select-2976"><span class="linenos">2976</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Select-2977"><a href="#Select-2977"><span class="linenos">2977</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2978"><a href="#Select-2978"><span class="linenos">2978</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2979"><a href="#Select-2979"><span class="linenos">2979</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"having"</span><span class="p">,</span> -</span><span id="Select-2980"><a href="#Select-2980"><span class="linenos">2980</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2981"><a href="#Select-2981"><span class="linenos">2981</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Having</span><span class="p">,</span> -</span><span id="Select-2982"><a href="#Select-2982"><span class="linenos">2982</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2983"><a href="#Select-2983"><span class="linenos">2983</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2984"><a href="#Select-2984"><span class="linenos">2984</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2985"><a href="#Select-2985"><span class="linenos">2985</span></a> <span class="p">)</span> -</span><span id="Select-2986"><a href="#Select-2986"><span class="linenos">2986</span></a> -</span><span id="Select-2987"><a href="#Select-2987"><span class="linenos">2987</span></a> <span class="k">def</span> <span class="nf">window</span><span class="p">(</span> -</span><span id="Select-2988"><a href="#Select-2988"><span class="linenos">2988</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2989"><a href="#Select-2989"><span class="linenos">2989</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select-2990"><a href="#Select-2990"><span class="linenos">2990</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-2991"><a href="#Select-2991"><span class="linenos">2991</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-2992"><a href="#Select-2992"><span class="linenos">2992</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-2993"><a href="#Select-2993"><span class="linenos">2993</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2994"><a href="#Select-2994"><span class="linenos">2994</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2995"><a href="#Select-2995"><span class="linenos">2995</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select-2996"><a href="#Select-2996"><span class="linenos">2996</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2997"><a href="#Select-2997"><span class="linenos">2997</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2998"><a href="#Select-2998"><span class="linenos">2998</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"windows"</span><span class="p">,</span> -</span><span id="Select-2999"><a href="#Select-2999"><span class="linenos">2999</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-3000"><a href="#Select-3000"><span class="linenos">3000</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Window</span><span class="p">,</span> -</span><span id="Select-3001"><a href="#Select-3001"><span class="linenos">3001</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-3002"><a href="#Select-3002"><span class="linenos">3002</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-3003"><a href="#Select-3003"><span class="linenos">3003</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-3004"><a href="#Select-3004"><span class="linenos">3004</span></a> <span class="p">)</span> -</span><span id="Select-3005"><a href="#Select-3005"><span class="linenos">3005</span></a> -</span><span id="Select-3006"><a href="#Select-3006"><span class="linenos">3006</span></a> <span class="k">def</span> <span class="nf">qualify</span><span class="p">(</span> -</span><span id="Select-3007"><a href="#Select-3007"><span class="linenos">3007</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-3008"><a href="#Select-3008"><span class="linenos">3008</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select-3009"><a href="#Select-3009"><span class="linenos">3009</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-3010"><a href="#Select-3010"><span class="linenos">3010</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-3011"><a href="#Select-3011"><span class="linenos">3011</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-3012"><a href="#Select-3012"><span class="linenos">3012</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-3013"><a href="#Select-3013"><span class="linenos">3013</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-3014"><a href="#Select-3014"><span class="linenos">3014</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Select-3015"><a href="#Select-3015"><span class="linenos">3015</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-3016"><a href="#Select-3016"><span class="linenos">3016</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-3017"><a href="#Select-3017"><span class="linenos">3017</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"qualify"</span><span class="p">,</span> -</span><span id="Select-3018"><a href="#Select-3018"><span class="linenos">3018</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-3019"><a href="#Select-3019"><span class="linenos">3019</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Qualify</span><span class="p">,</span> -</span><span id="Select-3020"><a href="#Select-3020"><span class="linenos">3020</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-3021"><a href="#Select-3021"><span class="linenos">3021</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-3022"><a href="#Select-3022"><span class="linenos">3022</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-3023"><a href="#Select-3023"><span class="linenos">3023</span></a> <span class="p">)</span> -</span><span id="Select-3024"><a href="#Select-3024"><span class="linenos">3024</span></a> -</span><span id="Select-3025"><a href="#Select-3025"><span class="linenos">3025</span></a> <span class="k">def</span> <span class="nf">distinct</span><span class="p">(</span> -</span><span id="Select-3026"><a href="#Select-3026"><span class="linenos">3026</span></a> <span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">ons</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">ExpOrStr</span><span class="p">],</span> <span class="n">distinct</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><span id="Select-3027"><a href="#Select-3027"><span class="linenos">3027</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-3028"><a href="#Select-3028"><span class="linenos">3028</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-3029"><a href="#Select-3029"><span class="linenos">3029</span></a><span class="sd"> Set the OFFSET expression.</span> -</span><span id="Select-3030"><a href="#Select-3030"><span class="linenos">3030</span></a> -</span><span id="Select-3031"><a href="#Select-3031"><span class="linenos">3031</span></a><span class="sd"> Example:</span> -</span><span id="Select-3032"><a href="#Select-3032"><span class="linenos">3032</span></a><span class="sd"> >>> Select().from_("tbl").select("x").distinct().sql()</span> -</span><span id="Select-3033"><a href="#Select-3033"><span class="linenos">3033</span></a><span class="sd"> 'SELECT DISTINCT x FROM tbl'</span> -</span><span id="Select-3034"><a href="#Select-3034"><span class="linenos">3034</span></a> -</span><span id="Select-3035"><a href="#Select-3035"><span class="linenos">3035</span></a><span class="sd"> Args:</span> -</span><span id="Select-3036"><a href="#Select-3036"><span class="linenos">3036</span></a><span class="sd"> ons: the expressions to distinct on</span> -</span><span id="Select-3037"><a href="#Select-3037"><span class="linenos">3037</span></a><span class="sd"> distinct: whether the Select should be distinct</span> -</span><span id="Select-3038"><a href="#Select-3038"><span class="linenos">3038</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-3039"><a href="#Select-3039"><span class="linenos">3039</span></a> -</span><span id="Select-3040"><a href="#Select-3040"><span class="linenos">3040</span></a><span class="sd"> Returns:</span> -</span><span id="Select-3041"><a href="#Select-3041"><span class="linenos">3041</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-3042"><a href="#Select-3042"><span class="linenos">3042</span></a><span class="sd"> """</span> -</span><span id="Select-3043"><a href="#Select-3043"><span class="linenos">3043</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-3044"><a href="#Select-3044"><span class="linenos">3044</span></a> <span class="n">on</span> <span class="o">=</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">maybe_parse</span><span class="p">(</span><span class="n">on</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">on</span> <span class="ow">in</span> <span class="n">ons</span> <span class="k">if</span> <span class="n">on</span><span class="p">])</span> <span class="k">if</span> <span class="n">ons</span> <span class="k">else</span> <span class="kc">None</span> -</span><span id="Select-3045"><a href="#Select-3045"><span class="linenos">3045</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="n">on</span><span class="o">=</span><span class="n">on</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-3046"><a href="#Select-3046"><span class="linenos">3046</span></a> <span class="k">return</span> <span class="n">instance</span> -</span><span id="Select-3047"><a href="#Select-3047"><span class="linenos">3047</span></a> -</span><span id="Select-3048"><a href="#Select-3048"><span class="linenos">3048</span></a> <span class="k">def</span> <span class="nf">ctas</span><span class="p">(</span> -</span><span id="Select-3049"><a href="#Select-3049"><span class="linenos">3049</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-3050"><a href="#Select-3050"><span class="linenos">3050</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Select-3051"><a href="#Select-3051"><span class="linenos">3051</span></a> <span class="n">properties</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="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Select-3052"><a href="#Select-3052"><span class="linenos">3052</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-3053"><a href="#Select-3053"><span class="linenos">3053</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-3054"><a href="#Select-3054"><span class="linenos">3054</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-3055"><a href="#Select-3055"><span class="linenos">3055</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Create</span><span class="p">:</span> -</span><span id="Select-3056"><a href="#Select-3056"><span class="linenos">3056</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-3057"><a href="#Select-3057"><span class="linenos">3057</span></a><span class="sd"> Convert this expression to a CREATE TABLE AS statement.</span> -</span><span id="Select-3058"><a href="#Select-3058"><span class="linenos">3058</span></a> -</span><span id="Select-3059"><a href="#Select-3059"><span class="linenos">3059</span></a><span class="sd"> Example:</span> -</span><span id="Select-3060"><a href="#Select-3060"><span class="linenos">3060</span></a><span class="sd"> >>> Select().select("*").from_("tbl").ctas("x").sql()</span> -</span><span id="Select-3061"><a href="#Select-3061"><span class="linenos">3061</span></a><span class="sd"> 'CREATE TABLE x AS SELECT * FROM tbl'</span> -</span><span id="Select-3062"><a href="#Select-3062"><span class="linenos">3062</span></a> -</span><span id="Select-3063"><a href="#Select-3063"><span class="linenos">3063</span></a><span class="sd"> Args:</span> -</span><span id="Select-3064"><a href="#Select-3064"><span class="linenos">3064</span></a><span class="sd"> table: the SQL code string to parse as the table name.</span> -</span><span id="Select-3065"><a href="#Select-3065"><span class="linenos">3065</span></a><span class="sd"> If another `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-3066"><a href="#Select-3066"><span class="linenos">3066</span></a><span class="sd"> properties: an optional mapping of table properties</span> -</span><span id="Select-3067"><a href="#Select-3067"><span class="linenos">3067</span></a><span class="sd"> dialect: the dialect used to parse the input table.</span> -</span><span id="Select-3068"><a href="#Select-3068"><span class="linenos">3068</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-3069"><a href="#Select-3069"><span class="linenos">3069</span></a><span class="sd"> opts: other options to use to parse the input table.</span> -</span><span id="Select-3070"><a href="#Select-3070"><span class="linenos">3070</span></a> -</span><span id="Select-3071"><a href="#Select-3071"><span class="linenos">3071</span></a><span class="sd"> Returns:</span> -</span><span id="Select-3072"><a href="#Select-3072"><span class="linenos">3072</span></a><span class="sd"> The new Create expression.</span> -</span><span id="Select-3073"><a href="#Select-3073"><span class="linenos">3073</span></a><span class="sd"> """</span> -</span><span id="Select-3074"><a href="#Select-3074"><span class="linenos">3074</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-3075"><a href="#Select-3075"><span class="linenos">3075</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-3076"><a href="#Select-3076"><span class="linenos">3076</span></a> <span class="n">table</span><span class="p">,</span> -</span><span id="Select-3077"><a href="#Select-3077"><span class="linenos">3077</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> -</span><span id="Select-3078"><a href="#Select-3078"><span class="linenos">3078</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-3079"><a href="#Select-3079"><span class="linenos">3079</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-3080"><a href="#Select-3080"><span class="linenos">3080</span></a> <span class="p">)</span> -</span><span id="Select-3081"><a href="#Select-3081"><span class="linenos">3081</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="Select-3082"><a href="#Select-3082"><span class="linenos">3082</span></a> <span class="k">if</span> <span class="n">properties</span><span class="p">:</span> -</span><span id="Select-3083"><a href="#Select-3083"><span class="linenos">3083</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-3084"><a href="#Select-3084"><span class="linenos">3084</span></a> -</span><span id="Select-3085"><a href="#Select-3085"><span class="linenos">3085</span></a> <span class="k">return</span> <span class="n">Create</span><span class="p">(</span> -</span><span id="Select-3086"><a href="#Select-3086"><span class="linenos">3086</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-3087"><a href="#Select-3087"><span class="linenos">3087</span></a> <span class="n">kind</span><span class="o">=</span><span class="s2">"table"</span><span class="p">,</span> -</span><span id="Select-3088"><a href="#Select-3088"><span class="linenos">3088</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> -</span><span id="Select-3089"><a href="#Select-3089"><span class="linenos">3089</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-3090"><a href="#Select-3090"><span class="linenos">3090</span></a> <span class="p">)</span> -</span><span id="Select-3091"><a href="#Select-3091"><span class="linenos">3091</span></a> -</span><span id="Select-3092"><a href="#Select-3092"><span class="linenos">3092</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-3093"><a href="#Select-3093"><span class="linenos">3093</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-3094"><a href="#Select-3094"><span class="linenos">3094</span></a><span class="sd"> Set the locking read mode for this expression.</span> -</span><span id="Select-3095"><a href="#Select-3095"><span class="linenos">3095</span></a> -</span><span id="Select-3096"><a href="#Select-3096"><span class="linenos">3096</span></a><span class="sd"> Examples:</span> -</span><span id="Select-3097"><a href="#Select-3097"><span class="linenos">3097</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")</span> -</span><span id="Select-3098"><a href="#Select-3098"><span class="linenos">3098</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"</span> -</span><span id="Select-3099"><a href="#Select-3099"><span class="linenos">3099</span></a> -</span><span id="Select-3100"><a href="#Select-3100"><span class="linenos">3100</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")</span> -</span><span id="Select-3101"><a href="#Select-3101"><span class="linenos">3101</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"</span> -</span><span id="Select-3102"><a href="#Select-3102"><span class="linenos">3102</span></a> -</span><span id="Select-3103"><a href="#Select-3103"><span class="linenos">3103</span></a><span class="sd"> Args:</span> -</span><span id="Select-3104"><a href="#Select-3104"><span class="linenos">3104</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-3105"><a href="#Select-3105"><span class="linenos">3105</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-3106"><a href="#Select-3106"><span class="linenos">3106</span></a> -</span><span id="Select-3107"><a href="#Select-3107"><span class="linenos">3107</span></a><span class="sd"> Returns:</span> -</span><span id="Select-3108"><a href="#Select-3108"><span class="linenos">3108</span></a><span class="sd"> The modified expression.</span> -</span><span id="Select-3109"><a href="#Select-3109"><span class="linenos">3109</span></a><span class="sd"> """</span> -</span><span id="Select-3110"><a href="#Select-3110"><span class="linenos">3110</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-3111"><a href="#Select-3111"><span class="linenos">3111</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"locks"</span><span class="p">,</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-2874"><a href="#Select-2874"><span class="linenos">2874</span></a> <span class="k">if</span> <span class="n">method</span><span class="p">:</span> +</span><span id="Select-2875"><a href="#Select-2875"><span class="linenos">2875</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"method"</span><span class="p">,</span> <span class="n">method</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> +</span><span id="Select-2876"><a href="#Select-2876"><span class="linenos">2876</span></a> <span class="k">if</span> <span class="n">side</span><span class="p">:</span> +</span><span id="Select-2877"><a href="#Select-2877"><span class="linenos">2877</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-2878"><a href="#Select-2878"><span class="linenos">2878</span></a> <span class="k">if</span> <span class="n">kind</span><span class="p">:</span> +</span><span id="Select-2879"><a href="#Select-2879"><span class="linenos">2879</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-2880"><a href="#Select-2880"><span class="linenos">2880</span></a> +</span><span id="Select-2881"><a href="#Select-2881"><span class="linenos">2881</span></a> <span class="k">if</span> <span class="n">on</span><span class="p">:</span> +</span><span id="Select-2882"><a href="#Select-2882"><span class="linenos">2882</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_list</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Select-2883"><a href="#Select-2883"><span class="linenos">2883</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-2884"><a href="#Select-2884"><span class="linenos">2884</span></a> +</span><span id="Select-2885"><a href="#Select-2885"><span class="linenos">2885</span></a> <span class="k">if</span> <span class="n">using</span><span class="p">:</span> +</span><span id="Select-2886"><a href="#Select-2886"><span class="linenos">2886</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-2887"><a href="#Select-2887"><span class="linenos">2887</span></a> <span class="o">*</span><span class="n">ensure_list</span><span class="p">(</span><span class="n">using</span><span class="p">),</span> +</span><span id="Select-2888"><a href="#Select-2888"><span class="linenos">2888</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">join</span><span class="p">,</span> +</span><span id="Select-2889"><a href="#Select-2889"><span class="linenos">2889</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> +</span><span id="Select-2890"><a href="#Select-2890"><span class="linenos">2890</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2891"><a href="#Select-2891"><span class="linenos">2891</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2892"><a href="#Select-2892"><span class="linenos">2892</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2893"><a href="#Select-2893"><span class="linenos">2893</span></a> <span class="p">)</span> +</span><span id="Select-2894"><a href="#Select-2894"><span class="linenos">2894</span></a> +</span><span id="Select-2895"><a href="#Select-2895"><span class="linenos">2895</span></a> <span class="k">if</span> <span class="n">join_alias</span><span class="p">:</span> +</span><span id="Select-2896"><a href="#Select-2896"><span class="linenos">2896</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-2897"><a href="#Select-2897"><span class="linenos">2897</span></a> +</span><span id="Select-2898"><a href="#Select-2898"><span class="linenos">2898</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select-2899"><a href="#Select-2899"><span class="linenos">2899</span></a> <span class="n">join</span><span class="p">,</span> +</span><span id="Select-2900"><a href="#Select-2900"><span class="linenos">2900</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2901"><a href="#Select-2901"><span class="linenos">2901</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"joins"</span><span class="p">,</span> +</span><span id="Select-2902"><a href="#Select-2902"><span class="linenos">2902</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2903"><a href="#Select-2903"><span class="linenos">2903</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2904"><a href="#Select-2904"><span class="linenos">2904</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2905"><a href="#Select-2905"><span class="linenos">2905</span></a> <span class="p">)</span> +</span><span id="Select-2906"><a href="#Select-2906"><span class="linenos">2906</span></a> +</span><span id="Select-2907"><a href="#Select-2907"><span class="linenos">2907</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span> +</span><span id="Select-2908"><a href="#Select-2908"><span class="linenos">2908</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2909"><a href="#Select-2909"><span class="linenos">2909</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select-2910"><a href="#Select-2910"><span class="linenos">2910</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-2911"><a href="#Select-2911"><span class="linenos">2911</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-2912"><a href="#Select-2912"><span class="linenos">2912</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-2913"><a href="#Select-2913"><span class="linenos">2913</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2914"><a href="#Select-2914"><span class="linenos">2914</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2915"><a href="#Select-2915"><span class="linenos">2915</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2916"><a href="#Select-2916"><span class="linenos">2916</span></a><span class="sd"> Append to or set the WHERE expressions.</span> +</span><span id="Select-2917"><a href="#Select-2917"><span class="linenos">2917</span></a> +</span><span id="Select-2918"><a href="#Select-2918"><span class="linenos">2918</span></a><span class="sd"> Example:</span> +</span><span id="Select-2919"><a href="#Select-2919"><span class="linenos">2919</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()</span> +</span><span id="Select-2920"><a href="#Select-2920"><span class="linenos">2920</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"</span> +</span><span id="Select-2921"><a href="#Select-2921"><span class="linenos">2921</span></a> +</span><span id="Select-2922"><a href="#Select-2922"><span class="linenos">2922</span></a><span class="sd"> Args:</span> +</span><span id="Select-2923"><a href="#Select-2923"><span class="linenos">2923</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select-2924"><a href="#Select-2924"><span class="linenos">2924</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2925"><a href="#Select-2925"><span class="linenos">2925</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Select-2926"><a href="#Select-2926"><span class="linenos">2926</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Select-2927"><a href="#Select-2927"><span class="linenos">2927</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Select-2928"><a href="#Select-2928"><span class="linenos">2928</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Select-2929"><a href="#Select-2929"><span class="linenos">2929</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2930"><a href="#Select-2930"><span class="linenos">2930</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2931"><a href="#Select-2931"><span class="linenos">2931</span></a> +</span><span id="Select-2932"><a href="#Select-2932"><span class="linenos">2932</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2933"><a href="#Select-2933"><span class="linenos">2933</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2934"><a href="#Select-2934"><span class="linenos">2934</span></a><span class="sd"> """</span> +</span><span id="Select-2935"><a href="#Select-2935"><span class="linenos">2935</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Select-2936"><a href="#Select-2936"><span class="linenos">2936</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2937"><a href="#Select-2937"><span class="linenos">2937</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2938"><a href="#Select-2938"><span class="linenos">2938</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> +</span><span id="Select-2939"><a href="#Select-2939"><span class="linenos">2939</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2940"><a href="#Select-2940"><span class="linenos">2940</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> +</span><span id="Select-2941"><a href="#Select-2941"><span class="linenos">2941</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2942"><a href="#Select-2942"><span class="linenos">2942</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2943"><a href="#Select-2943"><span class="linenos">2943</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2944"><a href="#Select-2944"><span class="linenos">2944</span></a> <span class="p">)</span> +</span><span id="Select-2945"><a href="#Select-2945"><span class="linenos">2945</span></a> +</span><span id="Select-2946"><a href="#Select-2946"><span class="linenos">2946</span></a> <span class="k">def</span> <span class="nf">having</span><span class="p">(</span> +</span><span id="Select-2947"><a href="#Select-2947"><span class="linenos">2947</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2948"><a href="#Select-2948"><span class="linenos">2948</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select-2949"><a href="#Select-2949"><span class="linenos">2949</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-2950"><a href="#Select-2950"><span class="linenos">2950</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-2951"><a href="#Select-2951"><span class="linenos">2951</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-2952"><a href="#Select-2952"><span class="linenos">2952</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2953"><a href="#Select-2953"><span class="linenos">2953</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2954"><a href="#Select-2954"><span class="linenos">2954</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2955"><a href="#Select-2955"><span class="linenos">2955</span></a><span class="sd"> Append to or set the HAVING expressions.</span> +</span><span id="Select-2956"><a href="#Select-2956"><span class="linenos">2956</span></a> +</span><span id="Select-2957"><a href="#Select-2957"><span class="linenos">2957</span></a><span class="sd"> Example:</span> +</span><span id="Select-2958"><a href="#Select-2958"><span class="linenos">2958</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-2959"><a href="#Select-2959"><span class="linenos">2959</span></a><span class="sd"> 'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'</span> +</span><span id="Select-2960"><a href="#Select-2960"><span class="linenos">2960</span></a> +</span><span id="Select-2961"><a href="#Select-2961"><span class="linenos">2961</span></a><span class="sd"> Args:</span> +</span><span id="Select-2962"><a href="#Select-2962"><span class="linenos">2962</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select-2963"><a href="#Select-2963"><span class="linenos">2963</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2964"><a href="#Select-2964"><span class="linenos">2964</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Select-2965"><a href="#Select-2965"><span class="linenos">2965</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Select-2966"><a href="#Select-2966"><span class="linenos">2966</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Select-2967"><a href="#Select-2967"><span class="linenos">2967</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Select-2968"><a href="#Select-2968"><span class="linenos">2968</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2969"><a href="#Select-2969"><span class="linenos">2969</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2970"><a href="#Select-2970"><span class="linenos">2970</span></a> +</span><span id="Select-2971"><a href="#Select-2971"><span class="linenos">2971</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2972"><a href="#Select-2972"><span class="linenos">2972</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select-2973"><a href="#Select-2973"><span class="linenos">2973</span></a><span class="sd"> """</span> +</span><span id="Select-2974"><a href="#Select-2974"><span class="linenos">2974</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Select-2975"><a href="#Select-2975"><span class="linenos">2975</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2976"><a href="#Select-2976"><span class="linenos">2976</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2977"><a href="#Select-2977"><span class="linenos">2977</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"having"</span><span class="p">,</span> +</span><span id="Select-2978"><a href="#Select-2978"><span class="linenos">2978</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2979"><a href="#Select-2979"><span class="linenos">2979</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Having</span><span class="p">,</span> +</span><span id="Select-2980"><a href="#Select-2980"><span class="linenos">2980</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2981"><a href="#Select-2981"><span class="linenos">2981</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2982"><a href="#Select-2982"><span class="linenos">2982</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2983"><a href="#Select-2983"><span class="linenos">2983</span></a> <span class="p">)</span> +</span><span id="Select-2984"><a href="#Select-2984"><span class="linenos">2984</span></a> +</span><span id="Select-2985"><a href="#Select-2985"><span class="linenos">2985</span></a> <span class="k">def</span> <span class="nf">window</span><span class="p">(</span> +</span><span id="Select-2986"><a href="#Select-2986"><span class="linenos">2986</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2987"><a href="#Select-2987"><span class="linenos">2987</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select-2988"><a href="#Select-2988"><span class="linenos">2988</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-2989"><a href="#Select-2989"><span class="linenos">2989</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-2990"><a href="#Select-2990"><span class="linenos">2990</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-2991"><a href="#Select-2991"><span class="linenos">2991</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2992"><a href="#Select-2992"><span class="linenos">2992</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2993"><a href="#Select-2993"><span class="linenos">2993</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select-2994"><a href="#Select-2994"><span class="linenos">2994</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2995"><a href="#Select-2995"><span class="linenos">2995</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2996"><a href="#Select-2996"><span class="linenos">2996</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"windows"</span><span class="p">,</span> +</span><span id="Select-2997"><a href="#Select-2997"><span class="linenos">2997</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2998"><a href="#Select-2998"><span class="linenos">2998</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Window</span><span class="p">,</span> +</span><span id="Select-2999"><a href="#Select-2999"><span class="linenos">2999</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-3000"><a href="#Select-3000"><span class="linenos">3000</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-3001"><a href="#Select-3001"><span class="linenos">3001</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-3002"><a href="#Select-3002"><span class="linenos">3002</span></a> <span class="p">)</span> +</span><span id="Select-3003"><a href="#Select-3003"><span class="linenos">3003</span></a> +</span><span id="Select-3004"><a href="#Select-3004"><span class="linenos">3004</span></a> <span class="k">def</span> <span class="nf">qualify</span><span class="p">(</span> +</span><span id="Select-3005"><a href="#Select-3005"><span class="linenos">3005</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-3006"><a href="#Select-3006"><span class="linenos">3006</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select-3007"><a href="#Select-3007"><span class="linenos">3007</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-3008"><a href="#Select-3008"><span class="linenos">3008</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-3009"><a href="#Select-3009"><span class="linenos">3009</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-3010"><a href="#Select-3010"><span class="linenos">3010</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-3011"><a href="#Select-3011"><span class="linenos">3011</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-3012"><a href="#Select-3012"><span class="linenos">3012</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Select-3013"><a href="#Select-3013"><span class="linenos">3013</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-3014"><a href="#Select-3014"><span class="linenos">3014</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-3015"><a href="#Select-3015"><span class="linenos">3015</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"qualify"</span><span class="p">,</span> +</span><span id="Select-3016"><a href="#Select-3016"><span class="linenos">3016</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-3017"><a href="#Select-3017"><span class="linenos">3017</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Qualify</span><span class="p">,</span> +</span><span id="Select-3018"><a href="#Select-3018"><span class="linenos">3018</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-3019"><a href="#Select-3019"><span class="linenos">3019</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-3020"><a href="#Select-3020"><span class="linenos">3020</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-3021"><a href="#Select-3021"><span class="linenos">3021</span></a> <span class="p">)</span> +</span><span id="Select-3022"><a href="#Select-3022"><span class="linenos">3022</span></a> +</span><span id="Select-3023"><a href="#Select-3023"><span class="linenos">3023</span></a> <span class="k">def</span> <span class="nf">distinct</span><span class="p">(</span> +</span><span id="Select-3024"><a href="#Select-3024"><span class="linenos">3024</span></a> <span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">ons</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">ExpOrStr</span><span class="p">],</span> <span class="n">distinct</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><span id="Select-3025"><a href="#Select-3025"><span class="linenos">3025</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-3026"><a href="#Select-3026"><span class="linenos">3026</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-3027"><a href="#Select-3027"><span class="linenos">3027</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="Select-3028"><a href="#Select-3028"><span class="linenos">3028</span></a> +</span><span id="Select-3029"><a href="#Select-3029"><span class="linenos">3029</span></a><span class="sd"> Example:</span> +</span><span id="Select-3030"><a href="#Select-3030"><span class="linenos">3030</span></a><span class="sd"> >>> Select().from_("tbl").select("x").distinct().sql()</span> +</span><span id="Select-3031"><a href="#Select-3031"><span class="linenos">3031</span></a><span class="sd"> 'SELECT DISTINCT x FROM tbl'</span> +</span><span id="Select-3032"><a href="#Select-3032"><span class="linenos">3032</span></a> +</span><span id="Select-3033"><a href="#Select-3033"><span class="linenos">3033</span></a><span class="sd"> Args:</span> +</span><span id="Select-3034"><a href="#Select-3034"><span class="linenos">3034</span></a><span class="sd"> ons: the expressions to distinct on</span> +</span><span id="Select-3035"><a href="#Select-3035"><span class="linenos">3035</span></a><span class="sd"> distinct: whether the Select should be distinct</span> +</span><span id="Select-3036"><a href="#Select-3036"><span class="linenos">3036</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-3037"><a href="#Select-3037"><span class="linenos">3037</span></a> +</span><span id="Select-3038"><a href="#Select-3038"><span class="linenos">3038</span></a><span class="sd"> Returns:</span> +</span><span id="Select-3039"><a href="#Select-3039"><span class="linenos">3039</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-3040"><a href="#Select-3040"><span class="linenos">3040</span></a><span class="sd"> """</span> +</span><span id="Select-3041"><a href="#Select-3041"><span class="linenos">3041</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-3042"><a href="#Select-3042"><span class="linenos">3042</span></a> <span class="n">on</span> <span class="o">=</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">maybe_parse</span><span class="p">(</span><span class="n">on</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">on</span> <span class="ow">in</span> <span class="n">ons</span> <span class="k">if</span> <span class="n">on</span><span class="p">])</span> <span class="k">if</span> <span class="n">ons</span> <span class="k">else</span> <span class="kc">None</span> +</span><span id="Select-3043"><a href="#Select-3043"><span class="linenos">3043</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="n">on</span><span class="o">=</span><span class="n">on</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-3044"><a href="#Select-3044"><span class="linenos">3044</span></a> <span class="k">return</span> <span class="n">instance</span> +</span><span id="Select-3045"><a href="#Select-3045"><span class="linenos">3045</span></a> +</span><span id="Select-3046"><a href="#Select-3046"><span class="linenos">3046</span></a> <span class="k">def</span> <span class="nf">ctas</span><span class="p">(</span> +</span><span id="Select-3047"><a href="#Select-3047"><span class="linenos">3047</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-3048"><a href="#Select-3048"><span class="linenos">3048</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Select-3049"><a href="#Select-3049"><span class="linenos">3049</span></a> <span class="n">properties</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="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Select-3050"><a href="#Select-3050"><span class="linenos">3050</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-3051"><a href="#Select-3051"><span class="linenos">3051</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-3052"><a href="#Select-3052"><span class="linenos">3052</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-3053"><a href="#Select-3053"><span class="linenos">3053</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Create</span><span class="p">:</span> +</span><span id="Select-3054"><a href="#Select-3054"><span class="linenos">3054</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-3055"><a href="#Select-3055"><span class="linenos">3055</span></a><span class="sd"> Convert this expression to a CREATE TABLE AS statement.</span> +</span><span id="Select-3056"><a href="#Select-3056"><span class="linenos">3056</span></a> +</span><span id="Select-3057"><a href="#Select-3057"><span class="linenos">3057</span></a><span class="sd"> Example:</span> +</span><span id="Select-3058"><a href="#Select-3058"><span class="linenos">3058</span></a><span class="sd"> >>> Select().select("*").from_("tbl").ctas("x").sql()</span> +</span><span id="Select-3059"><a href="#Select-3059"><span class="linenos">3059</span></a><span class="sd"> 'CREATE TABLE x AS SELECT * FROM tbl'</span> +</span><span id="Select-3060"><a href="#Select-3060"><span class="linenos">3060</span></a> +</span><span id="Select-3061"><a href="#Select-3061"><span class="linenos">3061</span></a><span class="sd"> Args:</span> +</span><span id="Select-3062"><a href="#Select-3062"><span class="linenos">3062</span></a><span class="sd"> table: the SQL code string to parse as the table name.</span> +</span><span id="Select-3063"><a href="#Select-3063"><span class="linenos">3063</span></a><span class="sd"> If another `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-3064"><a href="#Select-3064"><span class="linenos">3064</span></a><span class="sd"> properties: an optional mapping of table properties</span> +</span><span id="Select-3065"><a href="#Select-3065"><span class="linenos">3065</span></a><span class="sd"> dialect: the dialect used to parse the input table.</span> +</span><span id="Select-3066"><a href="#Select-3066"><span class="linenos">3066</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-3067"><a href="#Select-3067"><span class="linenos">3067</span></a><span class="sd"> opts: other options to use to parse the input table.</span> +</span><span id="Select-3068"><a href="#Select-3068"><span class="linenos">3068</span></a> +</span><span id="Select-3069"><a href="#Select-3069"><span class="linenos">3069</span></a><span class="sd"> Returns:</span> +</span><span id="Select-3070"><a href="#Select-3070"><span class="linenos">3070</span></a><span class="sd"> The new Create expression.</span> +</span><span id="Select-3071"><a href="#Select-3071"><span class="linenos">3071</span></a><span class="sd"> """</span> +</span><span id="Select-3072"><a href="#Select-3072"><span class="linenos">3072</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-3073"><a href="#Select-3073"><span class="linenos">3073</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-3074"><a href="#Select-3074"><span class="linenos">3074</span></a> <span class="n">table</span><span class="p">,</span> +</span><span id="Select-3075"><a href="#Select-3075"><span class="linenos">3075</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> +</span><span id="Select-3076"><a href="#Select-3076"><span class="linenos">3076</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-3077"><a href="#Select-3077"><span class="linenos">3077</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-3078"><a href="#Select-3078"><span class="linenos">3078</span></a> <span class="p">)</span> +</span><span id="Select-3079"><a href="#Select-3079"><span class="linenos">3079</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="Select-3080"><a href="#Select-3080"><span class="linenos">3080</span></a> <span class="k">if</span> <span class="n">properties</span><span class="p">:</span> +</span><span id="Select-3081"><a href="#Select-3081"><span class="linenos">3081</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-3082"><a href="#Select-3082"><span class="linenos">3082</span></a> +</span><span id="Select-3083"><a href="#Select-3083"><span class="linenos">3083</span></a> <span class="k">return</span> <span class="n">Create</span><span class="p">(</span> +</span><span id="Select-3084"><a href="#Select-3084"><span class="linenos">3084</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-3085"><a href="#Select-3085"><span class="linenos">3085</span></a> <span class="n">kind</span><span class="o">=</span><span class="s2">"table"</span><span class="p">,</span> +</span><span id="Select-3086"><a href="#Select-3086"><span class="linenos">3086</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> +</span><span id="Select-3087"><a href="#Select-3087"><span class="linenos">3087</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-3088"><a href="#Select-3088"><span class="linenos">3088</span></a> <span class="p">)</span> +</span><span id="Select-3089"><a href="#Select-3089"><span class="linenos">3089</span></a> +</span><span id="Select-3090"><a href="#Select-3090"><span class="linenos">3090</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-3091"><a href="#Select-3091"><span class="linenos">3091</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-3092"><a href="#Select-3092"><span class="linenos">3092</span></a><span class="sd"> Set the locking read mode for this expression.</span> +</span><span id="Select-3093"><a href="#Select-3093"><span class="linenos">3093</span></a> +</span><span id="Select-3094"><a href="#Select-3094"><span class="linenos">3094</span></a><span class="sd"> Examples:</span> +</span><span id="Select-3095"><a href="#Select-3095"><span class="linenos">3095</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")</span> +</span><span id="Select-3096"><a href="#Select-3096"><span class="linenos">3096</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"</span> +</span><span id="Select-3097"><a href="#Select-3097"><span class="linenos">3097</span></a> +</span><span id="Select-3098"><a href="#Select-3098"><span class="linenos">3098</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")</span> +</span><span id="Select-3099"><a href="#Select-3099"><span class="linenos">3099</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"</span> +</span><span id="Select-3100"><a href="#Select-3100"><span class="linenos">3100</span></a> +</span><span id="Select-3101"><a href="#Select-3101"><span class="linenos">3101</span></a><span class="sd"> Args:</span> +</span><span id="Select-3102"><a href="#Select-3102"><span class="linenos">3102</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-3103"><a href="#Select-3103"><span class="linenos">3103</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-3104"><a href="#Select-3104"><span class="linenos">3104</span></a> +</span><span id="Select-3105"><a href="#Select-3105"><span class="linenos">3105</span></a><span class="sd"> Returns:</span> +</span><span id="Select-3106"><a href="#Select-3106"><span class="linenos">3106</span></a><span class="sd"> The modified expression.</span> +</span><span id="Select-3107"><a href="#Select-3107"><span class="linenos">3107</span></a><span class="sd"> """</span> +</span><span id="Select-3108"><a href="#Select-3108"><span class="linenos">3108</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-3109"><a href="#Select-3109"><span class="linenos">3109</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"locks"</span><span class="p">,</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-3110"><a href="#Select-3110"><span class="linenos">3110</span></a> +</span><span id="Select-3111"><a href="#Select-3111"><span class="linenos">3111</span></a> <span class="k">return</span> <span class="n">inst</span> </span><span id="Select-3112"><a href="#Select-3112"><span class="linenos">3112</span></a> -</span><span id="Select-3113"><a href="#Select-3113"><span class="linenos">3113</span></a> <span class="k">return</span> <span class="n">inst</span> -</span><span id="Select-3114"><a href="#Select-3114"><span class="linenos">3114</span></a> -</span><span id="Select-3115"><a href="#Select-3115"><span class="linenos">3115</span></a> <span class="k">def</span> <span class="nf">hint</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">hints</span><span class="p">:</span> <span class="n">ExpOrStr</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="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-3116"><a href="#Select-3116"><span class="linenos">3116</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-3117"><a href="#Select-3117"><span class="linenos">3117</span></a><span class="sd"> Set hints for this expression.</span> -</span><span id="Select-3118"><a href="#Select-3118"><span class="linenos">3118</span></a> -</span><span id="Select-3119"><a href="#Select-3119"><span class="linenos">3119</span></a><span class="sd"> Examples:</span> -</span><span id="Select-3120"><a href="#Select-3120"><span class="linenos">3120</span></a><span class="sd"> >>> Select().select("x").from_("tbl").hint("BROADCAST(y)").sql(dialect="spark")</span> -</span><span id="Select-3121"><a href="#Select-3121"><span class="linenos">3121</span></a><span class="sd"> 'SELECT /*+ BROADCAST(y) */ x FROM tbl'</span> -</span><span id="Select-3122"><a href="#Select-3122"><span class="linenos">3122</span></a> -</span><span id="Select-3123"><a href="#Select-3123"><span class="linenos">3123</span></a><span class="sd"> Args:</span> -</span><span id="Select-3124"><a href="#Select-3124"><span class="linenos">3124</span></a><span class="sd"> hints: The SQL code strings to parse as the hints.</span> -</span><span id="Select-3125"><a href="#Select-3125"><span class="linenos">3125</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-3126"><a href="#Select-3126"><span class="linenos">3126</span></a><span class="sd"> dialect: The dialect used to parse the hints.</span> -</span><span id="Select-3127"><a href="#Select-3127"><span class="linenos">3127</span></a><span class="sd"> copy: If `False`, modify this expression instance in-place.</span> -</span><span id="Select-3128"><a href="#Select-3128"><span class="linenos">3128</span></a> -</span><span id="Select-3129"><a href="#Select-3129"><span class="linenos">3129</span></a><span class="sd"> Returns:</span> -</span><span id="Select-3130"><a href="#Select-3130"><span class="linenos">3130</span></a><span class="sd"> The modified expression.</span> -</span><span id="Select-3131"><a href="#Select-3131"><span class="linenos">3131</span></a><span class="sd"> """</span> -</span><span id="Select-3132"><a href="#Select-3132"><span class="linenos">3132</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-3133"><a href="#Select-3133"><span class="linenos">3133</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="Select-3134"><a href="#Select-3134"><span class="linenos">3134</span></a> <span class="s2">"hint"</span><span class="p">,</span> <span class="n">Hint</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">h</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</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="k">for</span> <span class="n">h</span> <span class="ow">in</span> <span class="n">hints</span><span class="p">])</span> -</span><span id="Select-3135"><a href="#Select-3135"><span class="linenos">3135</span></a> <span class="p">)</span> +</span><span id="Select-3113"><a href="#Select-3113"><span class="linenos">3113</span></a> <span class="k">def</span> <span class="nf">hint</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">hints</span><span class="p">:</span> <span class="n">ExpOrStr</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="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-3114"><a href="#Select-3114"><span class="linenos">3114</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-3115"><a href="#Select-3115"><span class="linenos">3115</span></a><span class="sd"> Set hints for this expression.</span> +</span><span id="Select-3116"><a href="#Select-3116"><span class="linenos">3116</span></a> +</span><span id="Select-3117"><a href="#Select-3117"><span class="linenos">3117</span></a><span class="sd"> Examples:</span> +</span><span id="Select-3118"><a href="#Select-3118"><span class="linenos">3118</span></a><span class="sd"> >>> Select().select("x").from_("tbl").hint("BROADCAST(y)").sql(dialect="spark")</span> +</span><span id="Select-3119"><a href="#Select-3119"><span class="linenos">3119</span></a><span class="sd"> 'SELECT /*+ BROADCAST(y) */ x FROM tbl'</span> +</span><span id="Select-3120"><a href="#Select-3120"><span class="linenos">3120</span></a> +</span><span id="Select-3121"><a href="#Select-3121"><span class="linenos">3121</span></a><span class="sd"> Args:</span> +</span><span id="Select-3122"><a href="#Select-3122"><span class="linenos">3122</span></a><span class="sd"> hints: The SQL code strings to parse as the hints.</span> +</span><span id="Select-3123"><a href="#Select-3123"><span class="linenos">3123</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-3124"><a href="#Select-3124"><span class="linenos">3124</span></a><span class="sd"> dialect: The dialect used to parse the hints.</span> +</span><span id="Select-3125"><a href="#Select-3125"><span class="linenos">3125</span></a><span class="sd"> copy: If `False`, modify this expression instance in-place.</span> +</span><span id="Select-3126"><a href="#Select-3126"><span class="linenos">3126</span></a> +</span><span id="Select-3127"><a href="#Select-3127"><span class="linenos">3127</span></a><span class="sd"> Returns:</span> +</span><span id="Select-3128"><a href="#Select-3128"><span class="linenos">3128</span></a><span class="sd"> The modified expression.</span> +</span><span id="Select-3129"><a href="#Select-3129"><span class="linenos">3129</span></a><span class="sd"> """</span> +</span><span id="Select-3130"><a href="#Select-3130"><span class="linenos">3130</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-3131"><a href="#Select-3131"><span class="linenos">3131</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="Select-3132"><a href="#Select-3132"><span class="linenos">3132</span></a> <span class="s2">"hint"</span><span class="p">,</span> <span class="n">Hint</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">h</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</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="k">for</span> <span class="n">h</span> <span class="ow">in</span> <span class="n">hints</span><span class="p">])</span> +</span><span id="Select-3133"><a href="#Select-3133"><span class="linenos">3133</span></a> <span class="p">)</span> +</span><span id="Select-3134"><a href="#Select-3134"><span class="linenos">3134</span></a> +</span><span id="Select-3135"><a href="#Select-3135"><span class="linenos">3135</span></a> <span class="k">return</span> <span class="n">inst</span> </span><span id="Select-3136"><a href="#Select-3136"><span class="linenos">3136</span></a> -</span><span id="Select-3137"><a href="#Select-3137"><span class="linenos">3137</span></a> <span class="k">return</span> <span class="n">inst</span> -</span><span id="Select-3138"><a href="#Select-3138"><span class="linenos">3138</span></a> -</span><span id="Select-3139"><a href="#Select-3139"><span class="linenos">3139</span></a> <span class="nd">@property</span> -</span><span id="Select-3140"><a href="#Select-3140"><span class="linenos">3140</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-3141"><a href="#Select-3141"><span class="linenos">3141</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-3142"><a href="#Select-3142"><span class="linenos">3142</span></a> -</span><span id="Select-3143"><a href="#Select-3143"><span class="linenos">3143</span></a> <span class="nd">@property</span> -</span><span id="Select-3144"><a href="#Select-3144"><span class="linenos">3144</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-3145"><a href="#Select-3145"><span class="linenos">3145</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-3146"><a href="#Select-3146"><span class="linenos">3146</span></a> -</span><span id="Select-3147"><a href="#Select-3147"><span class="linenos">3147</span></a> <span class="nd">@property</span> -</span><span id="Select-3148"><a href="#Select-3148"><span class="linenos">3148</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-3149"><a href="#Select-3149"><span class="linenos">3149</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-3137"><a href="#Select-3137"><span class="linenos">3137</span></a> <span class="nd">@property</span> +</span><span id="Select-3138"><a href="#Select-3138"><span class="linenos">3138</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-3139"><a href="#Select-3139"><span class="linenos">3139</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-3140"><a href="#Select-3140"><span class="linenos">3140</span></a> +</span><span id="Select-3141"><a href="#Select-3141"><span class="linenos">3141</span></a> <span class="nd">@property</span> +</span><span id="Select-3142"><a href="#Select-3142"><span class="linenos">3142</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-3143"><a href="#Select-3143"><span class="linenos">3143</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-3144"><a href="#Select-3144"><span class="linenos">3144</span></a> +</span><span id="Select-3145"><a href="#Select-3145"><span class="linenos">3145</span></a> <span class="nd">@property</span> +</span><span id="Select-3146"><a href="#Select-3146"><span class="linenos">3146</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-3147"><a href="#Select-3147"><span class="linenos">3147</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> </span></pre></div> @@ -33293,37 +33305,37 @@ 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_-2474"><a href="#Select.from_-2474"><span class="linenos">2474</span></a> <span class="k">def</span> <span class="nf">from_</span><span class="p">(</span> -</span><span id="Select.from_-2475"><a href="#Select.from_-2475"><span class="linenos">2475</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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="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">opts</span> -</span><span id="Select.from_-2476"><a href="#Select.from_-2476"><span class="linenos">2476</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.from_-2477"><a href="#Select.from_-2477"><span class="linenos">2477</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.from_-2478"><a href="#Select.from_-2478"><span class="linenos">2478</span></a><span class="sd"> Set the FROM expression.</span> -</span><span id="Select.from_-2479"><a href="#Select.from_-2479"><span class="linenos">2479</span></a> -</span><span id="Select.from_-2480"><a href="#Select.from_-2480"><span class="linenos">2480</span></a><span class="sd"> Example:</span> -</span><span id="Select.from_-2481"><a href="#Select.from_-2481"><span class="linenos">2481</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sql()</span> -</span><span id="Select.from_-2482"><a href="#Select.from_-2482"><span class="linenos">2482</span></a><span class="sd"> 'SELECT x FROM tbl'</span> -</span><span id="Select.from_-2483"><a href="#Select.from_-2483"><span class="linenos">2483</span></a> -</span><span id="Select.from_-2484"><a href="#Select.from_-2484"><span class="linenos">2484</span></a><span class="sd"> Args:</span> -</span><span id="Select.from_-2485"><a href="#Select.from_-2485"><span class="linenos">2485</span></a><span class="sd"> expression : the SQL code strings to parse.</span> -</span><span id="Select.from_-2486"><a href="#Select.from_-2486"><span class="linenos">2486</span></a><span class="sd"> If a `From` instance is passed, this is used as-is.</span> -</span><span id="Select.from_-2487"><a href="#Select.from_-2487"><span class="linenos">2487</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `From`.</span> -</span><span id="Select.from_-2488"><a href="#Select.from_-2488"><span class="linenos">2488</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select.from_-2489"><a href="#Select.from_-2489"><span class="linenos">2489</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.from_-2490"><a href="#Select.from_-2490"><span class="linenos">2490</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.from_-2491"><a href="#Select.from_-2491"><span class="linenos">2491</span></a> -</span><span id="Select.from_-2492"><a href="#Select.from_-2492"><span class="linenos">2492</span></a><span class="sd"> Returns:</span> -</span><span id="Select.from_-2493"><a href="#Select.from_-2493"><span class="linenos">2493</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select.from_-2494"><a href="#Select.from_-2494"><span class="linenos">2494</span></a><span class="sd"> """</span> -</span><span id="Select.from_-2495"><a href="#Select.from_-2495"><span class="linenos">2495</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Select.from_-2496"><a href="#Select.from_-2496"><span class="linenos">2496</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="Select.from_-2497"><a href="#Select.from_-2497"><span class="linenos">2497</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_-2498"><a href="#Select.from_-2498"><span class="linenos">2498</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_-2499"><a href="#Select.from_-2499"><span class="linenos">2499</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_-2500"><a href="#Select.from_-2500"><span class="linenos">2500</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_-2501"><a href="#Select.from_-2501"><span class="linenos">2501</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_-2502"><a href="#Select.from_-2502"><span class="linenos">2502</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_-2503"><a href="#Select.from_-2503"><span class="linenos">2503</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.from_-2504"><a href="#Select.from_-2504"><span class="linenos">2504</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.from_-2472"><a href="#Select.from_-2472"><span class="linenos">2472</span></a> <span class="k">def</span> <span class="nf">from_</span><span class="p">(</span> +</span><span id="Select.from_-2473"><a href="#Select.from_-2473"><span class="linenos">2473</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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="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">opts</span> +</span><span id="Select.from_-2474"><a href="#Select.from_-2474"><span class="linenos">2474</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.from_-2475"><a href="#Select.from_-2475"><span class="linenos">2475</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.from_-2476"><a href="#Select.from_-2476"><span class="linenos">2476</span></a><span class="sd"> Set the FROM expression.</span> +</span><span id="Select.from_-2477"><a href="#Select.from_-2477"><span class="linenos">2477</span></a> +</span><span id="Select.from_-2478"><a href="#Select.from_-2478"><span class="linenos">2478</span></a><span class="sd"> Example:</span> +</span><span id="Select.from_-2479"><a href="#Select.from_-2479"><span class="linenos">2479</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sql()</span> +</span><span id="Select.from_-2480"><a href="#Select.from_-2480"><span class="linenos">2480</span></a><span class="sd"> 'SELECT x FROM tbl'</span> +</span><span id="Select.from_-2481"><a href="#Select.from_-2481"><span class="linenos">2481</span></a> +</span><span id="Select.from_-2482"><a href="#Select.from_-2482"><span class="linenos">2482</span></a><span class="sd"> Args:</span> +</span><span id="Select.from_-2483"><a href="#Select.from_-2483"><span class="linenos">2483</span></a><span class="sd"> expression : the SQL code strings to parse.</span> +</span><span id="Select.from_-2484"><a href="#Select.from_-2484"><span class="linenos">2484</span></a><span class="sd"> If a `From` instance is passed, this is used as-is.</span> +</span><span id="Select.from_-2485"><a href="#Select.from_-2485"><span class="linenos">2485</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `From`.</span> +</span><span id="Select.from_-2486"><a href="#Select.from_-2486"><span class="linenos">2486</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select.from_-2487"><a href="#Select.from_-2487"><span class="linenos">2487</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.from_-2488"><a href="#Select.from_-2488"><span class="linenos">2488</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.from_-2489"><a href="#Select.from_-2489"><span class="linenos">2489</span></a> +</span><span id="Select.from_-2490"><a href="#Select.from_-2490"><span class="linenos">2490</span></a><span class="sd"> Returns:</span> +</span><span id="Select.from_-2491"><a href="#Select.from_-2491"><span class="linenos">2491</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select.from_-2492"><a href="#Select.from_-2492"><span class="linenos">2492</span></a><span class="sd"> """</span> +</span><span id="Select.from_-2493"><a href="#Select.from_-2493"><span class="linenos">2493</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Select.from_-2494"><a href="#Select.from_-2494"><span class="linenos">2494</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="Select.from_-2495"><a href="#Select.from_-2495"><span class="linenos">2495</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_-2496"><a href="#Select.from_-2496"><span class="linenos">2496</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_-2497"><a href="#Select.from_-2497"><span class="linenos">2497</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_-2498"><a href="#Select.from_-2498"><span class="linenos">2498</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_-2499"><a href="#Select.from_-2499"><span class="linenos">2499</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_-2500"><a href="#Select.from_-2500"><span class="linenos">2500</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_-2501"><a href="#Select.from_-2501"><span class="linenos">2501</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.from_-2502"><a href="#Select.from_-2502"><span class="linenos">2502</span></a> <span class="p">)</span> </span></pre></div> @@ -33370,49 +33382,49 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Select.group_by"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.group_by-2506"><a href="#Select.group_by-2506"><span class="linenos">2506</span></a> <span class="k">def</span> <span class="nf">group_by</span><span class="p">(</span> -</span><span id="Select.group_by-2507"><a href="#Select.group_by-2507"><span class="linenos">2507</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.group_by-2508"><a href="#Select.group_by-2508"><span class="linenos">2508</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select.group_by-2509"><a href="#Select.group_by-2509"><span class="linenos">2509</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.group_by-2510"><a href="#Select.group_by-2510"><span class="linenos">2510</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.group_by-2511"><a href="#Select.group_by-2511"><span class="linenos">2511</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.group_by-2512"><a href="#Select.group_by-2512"><span class="linenos">2512</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.group_by-2513"><a href="#Select.group_by-2513"><span class="linenos">2513</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.group_by-2514"><a href="#Select.group_by-2514"><span class="linenos">2514</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.group_by-2515"><a href="#Select.group_by-2515"><span class="linenos">2515</span></a><span class="sd"> Set the GROUP BY expression.</span> -</span><span id="Select.group_by-2516"><a href="#Select.group_by-2516"><span class="linenos">2516</span></a> -</span><span id="Select.group_by-2517"><a href="#Select.group_by-2517"><span class="linenos">2517</span></a><span class="sd"> Example:</span> -</span><span id="Select.group_by-2518"><a href="#Select.group_by-2518"><span class="linenos">2518</span></a><span class="sd"> >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()</span> -</span><span id="Select.group_by-2519"><a href="#Select.group_by-2519"><span class="linenos">2519</span></a><span class="sd"> 'SELECT x, COUNT(1) FROM tbl GROUP BY x'</span> -</span><span id="Select.group_by-2520"><a href="#Select.group_by-2520"><span class="linenos">2520</span></a> -</span><span id="Select.group_by-2521"><a href="#Select.group_by-2521"><span class="linenos">2521</span></a><span class="sd"> Args:</span> -</span><span id="Select.group_by-2522"><a href="#Select.group_by-2522"><span class="linenos">2522</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select.group_by-2523"><a href="#Select.group_by-2523"><span class="linenos">2523</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select.group_by-2524"><a href="#Select.group_by-2524"><span class="linenos">2524</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-2525"><a href="#Select.group_by-2525"><span class="linenos">2525</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-2526"><a href="#Select.group_by-2526"><span class="linenos">2526</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select.group_by-2527"><a href="#Select.group_by-2527"><span class="linenos">2527</span></a><span class="sd"> Otherwise, this flattens all the `Group` expression into a single expression.</span> -</span><span id="Select.group_by-2528"><a href="#Select.group_by-2528"><span class="linenos">2528</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select.group_by-2529"><a href="#Select.group_by-2529"><span class="linenos">2529</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.group_by-2530"><a href="#Select.group_by-2530"><span class="linenos">2530</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.group_by-2531"><a href="#Select.group_by-2531"><span class="linenos">2531</span></a> -</span><span id="Select.group_by-2532"><a href="#Select.group_by-2532"><span class="linenos">2532</span></a><span class="sd"> Returns:</span> -</span><span id="Select.group_by-2533"><a href="#Select.group_by-2533"><span class="linenos">2533</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select.group_by-2534"><a href="#Select.group_by-2534"><span class="linenos">2534</span></a><span class="sd"> """</span> -</span><span id="Select.group_by-2535"><a href="#Select.group_by-2535"><span class="linenos">2535</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-2536"><a href="#Select.group_by-2536"><span class="linenos">2536</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-2537"><a href="#Select.group_by-2537"><span class="linenos">2537</span></a> -</span><span id="Select.group_by-2538"><a href="#Select.group_by-2538"><span class="linenos">2538</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-2539"><a href="#Select.group_by-2539"><span class="linenos">2539</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.group_by-2540"><a href="#Select.group_by-2540"><span class="linenos">2540</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-2541"><a href="#Select.group_by-2541"><span class="linenos">2541</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-2542"><a href="#Select.group_by-2542"><span class="linenos">2542</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-2543"><a href="#Select.group_by-2543"><span class="linenos">2543</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-2544"><a href="#Select.group_by-2544"><span class="linenos">2544</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-2545"><a href="#Select.group_by-2545"><span class="linenos">2545</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-2546"><a href="#Select.group_by-2546"><span class="linenos">2546</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-2547"><a href="#Select.group_by-2547"><span class="linenos">2547</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.group_by-2548"><a href="#Select.group_by-2548"><span class="linenos">2548</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.group_by-2504"><a href="#Select.group_by-2504"><span class="linenos">2504</span></a> <span class="k">def</span> <span class="nf">group_by</span><span class="p">(</span> +</span><span id="Select.group_by-2505"><a href="#Select.group_by-2505"><span class="linenos">2505</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.group_by-2506"><a href="#Select.group_by-2506"><span class="linenos">2506</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select.group_by-2507"><a href="#Select.group_by-2507"><span class="linenos">2507</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.group_by-2508"><a href="#Select.group_by-2508"><span class="linenos">2508</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.group_by-2509"><a href="#Select.group_by-2509"><span class="linenos">2509</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.group_by-2510"><a href="#Select.group_by-2510"><span class="linenos">2510</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.group_by-2511"><a href="#Select.group_by-2511"><span class="linenos">2511</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.group_by-2512"><a href="#Select.group_by-2512"><span class="linenos">2512</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.group_by-2513"><a href="#Select.group_by-2513"><span class="linenos">2513</span></a><span class="sd"> Set the GROUP BY expression.</span> +</span><span id="Select.group_by-2514"><a href="#Select.group_by-2514"><span class="linenos">2514</span></a> +</span><span id="Select.group_by-2515"><a href="#Select.group_by-2515"><span class="linenos">2515</span></a><span class="sd"> Example:</span> +</span><span id="Select.group_by-2516"><a href="#Select.group_by-2516"><span class="linenos">2516</span></a><span class="sd"> >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()</span> +</span><span id="Select.group_by-2517"><a href="#Select.group_by-2517"><span class="linenos">2517</span></a><span class="sd"> 'SELECT x, COUNT(1) FROM tbl GROUP BY x'</span> +</span><span id="Select.group_by-2518"><a href="#Select.group_by-2518"><span class="linenos">2518</span></a> +</span><span id="Select.group_by-2519"><a href="#Select.group_by-2519"><span class="linenos">2519</span></a><span class="sd"> Args:</span> +</span><span id="Select.group_by-2520"><a href="#Select.group_by-2520"><span class="linenos">2520</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select.group_by-2521"><a href="#Select.group_by-2521"><span class="linenos">2521</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select.group_by-2522"><a href="#Select.group_by-2522"><span class="linenos">2522</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-2523"><a href="#Select.group_by-2523"><span class="linenos">2523</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-2524"><a href="#Select.group_by-2524"><span class="linenos">2524</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select.group_by-2525"><a href="#Select.group_by-2525"><span class="linenos">2525</span></a><span class="sd"> Otherwise, this flattens all the `Group` expression into a single expression.</span> +</span><span id="Select.group_by-2526"><a href="#Select.group_by-2526"><span class="linenos">2526</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select.group_by-2527"><a href="#Select.group_by-2527"><span class="linenos">2527</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.group_by-2528"><a href="#Select.group_by-2528"><span class="linenos">2528</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.group_by-2529"><a href="#Select.group_by-2529"><span class="linenos">2529</span></a> +</span><span id="Select.group_by-2530"><a href="#Select.group_by-2530"><span class="linenos">2530</span></a><span class="sd"> Returns:</span> +</span><span id="Select.group_by-2531"><a href="#Select.group_by-2531"><span class="linenos">2531</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select.group_by-2532"><a href="#Select.group_by-2532"><span class="linenos">2532</span></a><span class="sd"> """</span> +</span><span id="Select.group_by-2533"><a href="#Select.group_by-2533"><span class="linenos">2533</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-2534"><a href="#Select.group_by-2534"><span class="linenos">2534</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-2535"><a href="#Select.group_by-2535"><span class="linenos">2535</span></a> +</span><span id="Select.group_by-2536"><a href="#Select.group_by-2536"><span class="linenos">2536</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-2537"><a href="#Select.group_by-2537"><span class="linenos">2537</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.group_by-2538"><a href="#Select.group_by-2538"><span class="linenos">2538</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-2539"><a href="#Select.group_by-2539"><span class="linenos">2539</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-2540"><a href="#Select.group_by-2540"><span class="linenos">2540</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-2541"><a href="#Select.group_by-2541"><span class="linenos">2541</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-2542"><a href="#Select.group_by-2542"><span class="linenos">2542</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-2543"><a href="#Select.group_by-2543"><span class="linenos">2543</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-2544"><a href="#Select.group_by-2544"><span class="linenos">2544</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-2545"><a href="#Select.group_by-2545"><span class="linenos">2545</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.group_by-2546"><a href="#Select.group_by-2546"><span class="linenos">2546</span></a> <span class="p">)</span> </span></pre></div> @@ -33462,45 +33474,45 @@ 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-2550"><a href="#Select.order_by-2550"><span class="linenos">2550</span></a> <span class="k">def</span> <span class="nf">order_by</span><span class="p">(</span> -</span><span id="Select.order_by-2551"><a href="#Select.order_by-2551"><span class="linenos">2551</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.order_by-2552"><a href="#Select.order_by-2552"><span class="linenos">2552</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select.order_by-2553"><a href="#Select.order_by-2553"><span class="linenos">2553</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.order_by-2554"><a href="#Select.order_by-2554"><span class="linenos">2554</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.order_by-2555"><a href="#Select.order_by-2555"><span class="linenos">2555</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.order_by-2556"><a href="#Select.order_by-2556"><span class="linenos">2556</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.order_by-2557"><a href="#Select.order_by-2557"><span class="linenos">2557</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.order_by-2558"><a href="#Select.order_by-2558"><span class="linenos">2558</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.order_by-2559"><a href="#Select.order_by-2559"><span class="linenos">2559</span></a><span class="sd"> Set the ORDER BY expression.</span> -</span><span id="Select.order_by-2560"><a href="#Select.order_by-2560"><span class="linenos">2560</span></a> -</span><span id="Select.order_by-2561"><a href="#Select.order_by-2561"><span class="linenos">2561</span></a><span class="sd"> Example:</span> -</span><span id="Select.order_by-2562"><a href="#Select.order_by-2562"><span class="linenos">2562</span></a><span class="sd"> >>> Select().from_("tbl").select("x").order_by("x DESC").sql()</span> -</span><span id="Select.order_by-2563"><a href="#Select.order_by-2563"><span class="linenos">2563</span></a><span class="sd"> 'SELECT x FROM tbl ORDER BY x DESC'</span> -</span><span id="Select.order_by-2564"><a href="#Select.order_by-2564"><span class="linenos">2564</span></a> -</span><span id="Select.order_by-2565"><a href="#Select.order_by-2565"><span class="linenos">2565</span></a><span class="sd"> Args:</span> -</span><span id="Select.order_by-2566"><a href="#Select.order_by-2566"><span class="linenos">2566</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select.order_by-2567"><a href="#Select.order_by-2567"><span class="linenos">2567</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select.order_by-2568"><a href="#Select.order_by-2568"><span class="linenos">2568</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-2569"><a href="#Select.order_by-2569"><span class="linenos">2569</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select.order_by-2570"><a href="#Select.order_by-2570"><span class="linenos">2570</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="Select.order_by-2571"><a href="#Select.order_by-2571"><span class="linenos">2571</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select.order_by-2572"><a href="#Select.order_by-2572"><span class="linenos">2572</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.order_by-2573"><a href="#Select.order_by-2573"><span class="linenos">2573</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.order_by-2574"><a href="#Select.order_by-2574"><span class="linenos">2574</span></a> -</span><span id="Select.order_by-2575"><a href="#Select.order_by-2575"><span class="linenos">2575</span></a><span class="sd"> Returns:</span> -</span><span id="Select.order_by-2576"><a href="#Select.order_by-2576"><span class="linenos">2576</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select.order_by-2577"><a href="#Select.order_by-2577"><span class="linenos">2577</span></a><span class="sd"> """</span> -</span><span id="Select.order_by-2578"><a href="#Select.order_by-2578"><span class="linenos">2578</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-2579"><a href="#Select.order_by-2579"><span class="linenos">2579</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.order_by-2580"><a href="#Select.order_by-2580"><span class="linenos">2580</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-2581"><a href="#Select.order_by-2581"><span class="linenos">2581</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-2582"><a href="#Select.order_by-2582"><span class="linenos">2582</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-2583"><a href="#Select.order_by-2583"><span class="linenos">2583</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-2584"><a href="#Select.order_by-2584"><span class="linenos">2584</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-2585"><a href="#Select.order_by-2585"><span class="linenos">2585</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-2586"><a href="#Select.order_by-2586"><span class="linenos">2586</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-2587"><a href="#Select.order_by-2587"><span class="linenos">2587</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.order_by-2588"><a href="#Select.order_by-2588"><span class="linenos">2588</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.order_by-2548"><a href="#Select.order_by-2548"><span class="linenos">2548</span></a> <span class="k">def</span> <span class="nf">order_by</span><span class="p">(</span> +</span><span id="Select.order_by-2549"><a href="#Select.order_by-2549"><span class="linenos">2549</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.order_by-2550"><a href="#Select.order_by-2550"><span class="linenos">2550</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select.order_by-2551"><a href="#Select.order_by-2551"><span class="linenos">2551</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.order_by-2552"><a href="#Select.order_by-2552"><span class="linenos">2552</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.order_by-2553"><a href="#Select.order_by-2553"><span class="linenos">2553</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.order_by-2554"><a href="#Select.order_by-2554"><span class="linenos">2554</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.order_by-2555"><a href="#Select.order_by-2555"><span class="linenos">2555</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.order_by-2556"><a href="#Select.order_by-2556"><span class="linenos">2556</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.order_by-2557"><a href="#Select.order_by-2557"><span class="linenos">2557</span></a><span class="sd"> Set the ORDER BY expression.</span> +</span><span id="Select.order_by-2558"><a href="#Select.order_by-2558"><span class="linenos">2558</span></a> +</span><span id="Select.order_by-2559"><a href="#Select.order_by-2559"><span class="linenos">2559</span></a><span class="sd"> Example:</span> +</span><span id="Select.order_by-2560"><a href="#Select.order_by-2560"><span class="linenos">2560</span></a><span class="sd"> >>> Select().from_("tbl").select("x").order_by("x DESC").sql()</span> +</span><span id="Select.order_by-2561"><a href="#Select.order_by-2561"><span class="linenos">2561</span></a><span class="sd"> 'SELECT x FROM tbl ORDER BY x DESC'</span> +</span><span id="Select.order_by-2562"><a href="#Select.order_by-2562"><span class="linenos">2562</span></a> +</span><span id="Select.order_by-2563"><a href="#Select.order_by-2563"><span class="linenos">2563</span></a><span class="sd"> Args:</span> +</span><span id="Select.order_by-2564"><a href="#Select.order_by-2564"><span class="linenos">2564</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select.order_by-2565"><a href="#Select.order_by-2565"><span class="linenos">2565</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select.order_by-2566"><a href="#Select.order_by-2566"><span class="linenos">2566</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-2567"><a href="#Select.order_by-2567"><span class="linenos">2567</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select.order_by-2568"><a href="#Select.order_by-2568"><span class="linenos">2568</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="Select.order_by-2569"><a href="#Select.order_by-2569"><span class="linenos">2569</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select.order_by-2570"><a href="#Select.order_by-2570"><span class="linenos">2570</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.order_by-2571"><a href="#Select.order_by-2571"><span class="linenos">2571</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.order_by-2572"><a href="#Select.order_by-2572"><span class="linenos">2572</span></a> +</span><span id="Select.order_by-2573"><a href="#Select.order_by-2573"><span class="linenos">2573</span></a><span class="sd"> Returns:</span> +</span><span id="Select.order_by-2574"><a href="#Select.order_by-2574"><span class="linenos">2574</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select.order_by-2575"><a href="#Select.order_by-2575"><span class="linenos">2575</span></a><span class="sd"> """</span> +</span><span id="Select.order_by-2576"><a href="#Select.order_by-2576"><span class="linenos">2576</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-2577"><a href="#Select.order_by-2577"><span class="linenos">2577</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.order_by-2578"><a href="#Select.order_by-2578"><span class="linenos">2578</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-2579"><a href="#Select.order_by-2579"><span class="linenos">2579</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-2580"><a href="#Select.order_by-2580"><span class="linenos">2580</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-2581"><a href="#Select.order_by-2581"><span class="linenos">2581</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-2582"><a href="#Select.order_by-2582"><span class="linenos">2582</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-2583"><a href="#Select.order_by-2583"><span class="linenos">2583</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-2584"><a href="#Select.order_by-2584"><span class="linenos">2584</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-2585"><a href="#Select.order_by-2585"><span class="linenos">2585</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.order_by-2586"><a href="#Select.order_by-2586"><span class="linenos">2586</span></a> <span class="p">)</span> </span></pre></div> @@ -33549,45 +33561,45 @@ 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-2590"><a href="#Select.sort_by-2590"><span class="linenos">2590</span></a> <span class="k">def</span> <span class="nf">sort_by</span><span class="p">(</span> -</span><span id="Select.sort_by-2591"><a href="#Select.sort_by-2591"><span class="linenos">2591</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.sort_by-2592"><a href="#Select.sort_by-2592"><span class="linenos">2592</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select.sort_by-2593"><a href="#Select.sort_by-2593"><span class="linenos">2593</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.sort_by-2594"><a href="#Select.sort_by-2594"><span class="linenos">2594</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.sort_by-2595"><a href="#Select.sort_by-2595"><span class="linenos">2595</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.sort_by-2596"><a href="#Select.sort_by-2596"><span class="linenos">2596</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.sort_by-2597"><a href="#Select.sort_by-2597"><span class="linenos">2597</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.sort_by-2598"><a href="#Select.sort_by-2598"><span class="linenos">2598</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.sort_by-2599"><a href="#Select.sort_by-2599"><span class="linenos">2599</span></a><span class="sd"> Set the SORT BY expression.</span> -</span><span id="Select.sort_by-2600"><a href="#Select.sort_by-2600"><span class="linenos">2600</span></a> -</span><span id="Select.sort_by-2601"><a href="#Select.sort_by-2601"><span class="linenos">2601</span></a><span class="sd"> Example:</span> -</span><span id="Select.sort_by-2602"><a href="#Select.sort_by-2602"><span class="linenos">2602</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sort_by("x DESC").sql(dialect="hive")</span> -</span><span id="Select.sort_by-2603"><a href="#Select.sort_by-2603"><span class="linenos">2603</span></a><span class="sd"> 'SELECT x FROM tbl SORT BY x DESC'</span> -</span><span id="Select.sort_by-2604"><a href="#Select.sort_by-2604"><span class="linenos">2604</span></a> -</span><span id="Select.sort_by-2605"><a href="#Select.sort_by-2605"><span class="linenos">2605</span></a><span class="sd"> Args:</span> -</span><span id="Select.sort_by-2606"><a href="#Select.sort_by-2606"><span class="linenos">2606</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select.sort_by-2607"><a href="#Select.sort_by-2607"><span class="linenos">2607</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select.sort_by-2608"><a href="#Select.sort_by-2608"><span class="linenos">2608</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-2609"><a href="#Select.sort_by-2609"><span class="linenos">2609</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select.sort_by-2610"><a href="#Select.sort_by-2610"><span class="linenos">2610</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="Select.sort_by-2611"><a href="#Select.sort_by-2611"><span class="linenos">2611</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select.sort_by-2612"><a href="#Select.sort_by-2612"><span class="linenos">2612</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.sort_by-2613"><a href="#Select.sort_by-2613"><span class="linenos">2613</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.sort_by-2614"><a href="#Select.sort_by-2614"><span class="linenos">2614</span></a> -</span><span id="Select.sort_by-2615"><a href="#Select.sort_by-2615"><span class="linenos">2615</span></a><span class="sd"> Returns:</span> -</span><span id="Select.sort_by-2616"><a href="#Select.sort_by-2616"><span class="linenos">2616</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select.sort_by-2617"><a href="#Select.sort_by-2617"><span class="linenos">2617</span></a><span class="sd"> """</span> -</span><span id="Select.sort_by-2618"><a href="#Select.sort_by-2618"><span class="linenos">2618</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-2619"><a href="#Select.sort_by-2619"><span class="linenos">2619</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.sort_by-2620"><a href="#Select.sort_by-2620"><span class="linenos">2620</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-2621"><a href="#Select.sort_by-2621"><span class="linenos">2621</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-2622"><a href="#Select.sort_by-2622"><span class="linenos">2622</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-2623"><a href="#Select.sort_by-2623"><span class="linenos">2623</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-2624"><a href="#Select.sort_by-2624"><span class="linenos">2624</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-2625"><a href="#Select.sort_by-2625"><span class="linenos">2625</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-2626"><a href="#Select.sort_by-2626"><span class="linenos">2626</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-2627"><a href="#Select.sort_by-2627"><span class="linenos">2627</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.sort_by-2628"><a href="#Select.sort_by-2628"><span class="linenos">2628</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.sort_by-2588"><a href="#Select.sort_by-2588"><span class="linenos">2588</span></a> <span class="k">def</span> <span class="nf">sort_by</span><span class="p">(</span> +</span><span id="Select.sort_by-2589"><a href="#Select.sort_by-2589"><span class="linenos">2589</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.sort_by-2590"><a href="#Select.sort_by-2590"><span class="linenos">2590</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select.sort_by-2591"><a href="#Select.sort_by-2591"><span class="linenos">2591</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.sort_by-2592"><a href="#Select.sort_by-2592"><span class="linenos">2592</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.sort_by-2593"><a href="#Select.sort_by-2593"><span class="linenos">2593</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.sort_by-2594"><a href="#Select.sort_by-2594"><span class="linenos">2594</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.sort_by-2595"><a href="#Select.sort_by-2595"><span class="linenos">2595</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.sort_by-2596"><a href="#Select.sort_by-2596"><span class="linenos">2596</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.sort_by-2597"><a href="#Select.sort_by-2597"><span class="linenos">2597</span></a><span class="sd"> Set the SORT BY expression.</span> +</span><span id="Select.sort_by-2598"><a href="#Select.sort_by-2598"><span class="linenos">2598</span></a> +</span><span id="Select.sort_by-2599"><a href="#Select.sort_by-2599"><span class="linenos">2599</span></a><span class="sd"> Example:</span> +</span><span id="Select.sort_by-2600"><a href="#Select.sort_by-2600"><span class="linenos">2600</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sort_by("x DESC").sql(dialect="hive")</span> +</span><span id="Select.sort_by-2601"><a href="#Select.sort_by-2601"><span class="linenos">2601</span></a><span class="sd"> 'SELECT x FROM tbl SORT BY x DESC'</span> +</span><span id="Select.sort_by-2602"><a href="#Select.sort_by-2602"><span class="linenos">2602</span></a> +</span><span id="Select.sort_by-2603"><a href="#Select.sort_by-2603"><span class="linenos">2603</span></a><span class="sd"> Args:</span> +</span><span id="Select.sort_by-2604"><a href="#Select.sort_by-2604"><span class="linenos">2604</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select.sort_by-2605"><a href="#Select.sort_by-2605"><span class="linenos">2605</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select.sort_by-2606"><a href="#Select.sort_by-2606"><span class="linenos">2606</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-2607"><a href="#Select.sort_by-2607"><span class="linenos">2607</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select.sort_by-2608"><a href="#Select.sort_by-2608"><span class="linenos">2608</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="Select.sort_by-2609"><a href="#Select.sort_by-2609"><span class="linenos">2609</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select.sort_by-2610"><a href="#Select.sort_by-2610"><span class="linenos">2610</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.sort_by-2611"><a href="#Select.sort_by-2611"><span class="linenos">2611</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.sort_by-2612"><a href="#Select.sort_by-2612"><span class="linenos">2612</span></a> +</span><span id="Select.sort_by-2613"><a href="#Select.sort_by-2613"><span class="linenos">2613</span></a><span class="sd"> Returns:</span> +</span><span id="Select.sort_by-2614"><a href="#Select.sort_by-2614"><span class="linenos">2614</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select.sort_by-2615"><a href="#Select.sort_by-2615"><span class="linenos">2615</span></a><span class="sd"> """</span> +</span><span id="Select.sort_by-2616"><a href="#Select.sort_by-2616"><span class="linenos">2616</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-2617"><a href="#Select.sort_by-2617"><span class="linenos">2617</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.sort_by-2618"><a href="#Select.sort_by-2618"><span class="linenos">2618</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-2619"><a href="#Select.sort_by-2619"><span class="linenos">2619</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-2620"><a href="#Select.sort_by-2620"><span class="linenos">2620</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-2621"><a href="#Select.sort_by-2621"><span class="linenos">2621</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-2622"><a href="#Select.sort_by-2622"><span class="linenos">2622</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-2623"><a href="#Select.sort_by-2623"><span class="linenos">2623</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-2624"><a href="#Select.sort_by-2624"><span class="linenos">2624</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-2625"><a href="#Select.sort_by-2625"><span class="linenos">2625</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.sort_by-2626"><a href="#Select.sort_by-2626"><span class="linenos">2626</span></a> <span class="p">)</span> </span></pre></div> @@ -33636,45 +33648,45 @@ 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-2630"><a href="#Select.cluster_by-2630"><span class="linenos">2630</span></a> <span class="k">def</span> <span class="nf">cluster_by</span><span class="p">(</span> -</span><span id="Select.cluster_by-2631"><a href="#Select.cluster_by-2631"><span class="linenos">2631</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.cluster_by-2632"><a href="#Select.cluster_by-2632"><span class="linenos">2632</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select.cluster_by-2633"><a href="#Select.cluster_by-2633"><span class="linenos">2633</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.cluster_by-2634"><a href="#Select.cluster_by-2634"><span class="linenos">2634</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.cluster_by-2635"><a href="#Select.cluster_by-2635"><span class="linenos">2635</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.cluster_by-2636"><a href="#Select.cluster_by-2636"><span class="linenos">2636</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.cluster_by-2637"><a href="#Select.cluster_by-2637"><span class="linenos">2637</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.cluster_by-2638"><a href="#Select.cluster_by-2638"><span class="linenos">2638</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.cluster_by-2639"><a href="#Select.cluster_by-2639"><span class="linenos">2639</span></a><span class="sd"> Set the CLUSTER BY expression.</span> -</span><span id="Select.cluster_by-2640"><a href="#Select.cluster_by-2640"><span class="linenos">2640</span></a> -</span><span id="Select.cluster_by-2641"><a href="#Select.cluster_by-2641"><span class="linenos">2641</span></a><span class="sd"> Example:</span> -</span><span id="Select.cluster_by-2642"><a href="#Select.cluster_by-2642"><span class="linenos">2642</span></a><span class="sd"> >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql(dialect="hive")</span> -</span><span id="Select.cluster_by-2643"><a href="#Select.cluster_by-2643"><span class="linenos">2643</span></a><span class="sd"> 'SELECT x FROM tbl CLUSTER BY x DESC'</span> -</span><span id="Select.cluster_by-2644"><a href="#Select.cluster_by-2644"><span class="linenos">2644</span></a> -</span><span id="Select.cluster_by-2645"><a href="#Select.cluster_by-2645"><span class="linenos">2645</span></a><span class="sd"> Args:</span> -</span><span id="Select.cluster_by-2646"><a href="#Select.cluster_by-2646"><span class="linenos">2646</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select.cluster_by-2647"><a href="#Select.cluster_by-2647"><span class="linenos">2647</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select.cluster_by-2648"><a href="#Select.cluster_by-2648"><span class="linenos">2648</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-2649"><a href="#Select.cluster_by-2649"><span class="linenos">2649</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select.cluster_by-2650"><a href="#Select.cluster_by-2650"><span class="linenos">2650</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="Select.cluster_by-2651"><a href="#Select.cluster_by-2651"><span class="linenos">2651</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select.cluster_by-2652"><a href="#Select.cluster_by-2652"><span class="linenos">2652</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.cluster_by-2653"><a href="#Select.cluster_by-2653"><span class="linenos">2653</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.cluster_by-2654"><a href="#Select.cluster_by-2654"><span class="linenos">2654</span></a> -</span><span id="Select.cluster_by-2655"><a href="#Select.cluster_by-2655"><span class="linenos">2655</span></a><span class="sd"> Returns:</span> -</span><span id="Select.cluster_by-2656"><a href="#Select.cluster_by-2656"><span class="linenos">2656</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select.cluster_by-2657"><a href="#Select.cluster_by-2657"><span class="linenos">2657</span></a><span class="sd"> """</span> -</span><span id="Select.cluster_by-2658"><a href="#Select.cluster_by-2658"><span class="linenos">2658</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-2659"><a href="#Select.cluster_by-2659"><span class="linenos">2659</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.cluster_by-2660"><a href="#Select.cluster_by-2660"><span class="linenos">2660</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-2661"><a href="#Select.cluster_by-2661"><span class="linenos">2661</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-2662"><a href="#Select.cluster_by-2662"><span class="linenos">2662</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-2663"><a href="#Select.cluster_by-2663"><span class="linenos">2663</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-2664"><a href="#Select.cluster_by-2664"><span class="linenos">2664</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-2665"><a href="#Select.cluster_by-2665"><span class="linenos">2665</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-2666"><a href="#Select.cluster_by-2666"><span class="linenos">2666</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-2667"><a href="#Select.cluster_by-2667"><span class="linenos">2667</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.cluster_by-2668"><a href="#Select.cluster_by-2668"><span class="linenos">2668</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.cluster_by-2628"><a href="#Select.cluster_by-2628"><span class="linenos">2628</span></a> <span class="k">def</span> <span class="nf">cluster_by</span><span class="p">(</span> +</span><span id="Select.cluster_by-2629"><a href="#Select.cluster_by-2629"><span class="linenos">2629</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.cluster_by-2630"><a href="#Select.cluster_by-2630"><span class="linenos">2630</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select.cluster_by-2631"><a href="#Select.cluster_by-2631"><span class="linenos">2631</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.cluster_by-2632"><a href="#Select.cluster_by-2632"><span class="linenos">2632</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.cluster_by-2633"><a href="#Select.cluster_by-2633"><span class="linenos">2633</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.cluster_by-2634"><a href="#Select.cluster_by-2634"><span class="linenos">2634</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.cluster_by-2635"><a href="#Select.cluster_by-2635"><span class="linenos">2635</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.cluster_by-2636"><a href="#Select.cluster_by-2636"><span class="linenos">2636</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.cluster_by-2637"><a href="#Select.cluster_by-2637"><span class="linenos">2637</span></a><span class="sd"> Set the CLUSTER BY expression.</span> +</span><span id="Select.cluster_by-2638"><a href="#Select.cluster_by-2638"><span class="linenos">2638</span></a> +</span><span id="Select.cluster_by-2639"><a href="#Select.cluster_by-2639"><span class="linenos">2639</span></a><span class="sd"> Example:</span> +</span><span id="Select.cluster_by-2640"><a href="#Select.cluster_by-2640"><span class="linenos">2640</span></a><span class="sd"> >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql(dialect="hive")</span> +</span><span id="Select.cluster_by-2641"><a href="#Select.cluster_by-2641"><span class="linenos">2641</span></a><span class="sd"> 'SELECT x FROM tbl CLUSTER BY x DESC'</span> +</span><span id="Select.cluster_by-2642"><a href="#Select.cluster_by-2642"><span class="linenos">2642</span></a> +</span><span id="Select.cluster_by-2643"><a href="#Select.cluster_by-2643"><span class="linenos">2643</span></a><span class="sd"> Args:</span> +</span><span id="Select.cluster_by-2644"><a href="#Select.cluster_by-2644"><span class="linenos">2644</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select.cluster_by-2645"><a href="#Select.cluster_by-2645"><span class="linenos">2645</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select.cluster_by-2646"><a href="#Select.cluster_by-2646"><span class="linenos">2646</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-2647"><a href="#Select.cluster_by-2647"><span class="linenos">2647</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select.cluster_by-2648"><a href="#Select.cluster_by-2648"><span class="linenos">2648</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="Select.cluster_by-2649"><a href="#Select.cluster_by-2649"><span class="linenos">2649</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select.cluster_by-2650"><a href="#Select.cluster_by-2650"><span class="linenos">2650</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.cluster_by-2651"><a href="#Select.cluster_by-2651"><span class="linenos">2651</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.cluster_by-2652"><a href="#Select.cluster_by-2652"><span class="linenos">2652</span></a> +</span><span id="Select.cluster_by-2653"><a href="#Select.cluster_by-2653"><span class="linenos">2653</span></a><span class="sd"> Returns:</span> +</span><span id="Select.cluster_by-2654"><a href="#Select.cluster_by-2654"><span class="linenos">2654</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select.cluster_by-2655"><a href="#Select.cluster_by-2655"><span class="linenos">2655</span></a><span class="sd"> """</span> +</span><span id="Select.cluster_by-2656"><a href="#Select.cluster_by-2656"><span class="linenos">2656</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-2657"><a href="#Select.cluster_by-2657"><span class="linenos">2657</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.cluster_by-2658"><a href="#Select.cluster_by-2658"><span class="linenos">2658</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-2659"><a href="#Select.cluster_by-2659"><span class="linenos">2659</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-2660"><a href="#Select.cluster_by-2660"><span class="linenos">2660</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-2661"><a href="#Select.cluster_by-2661"><span class="linenos">2661</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-2662"><a href="#Select.cluster_by-2662"><span class="linenos">2662</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-2663"><a href="#Select.cluster_by-2663"><span class="linenos">2663</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-2664"><a href="#Select.cluster_by-2664"><span class="linenos">2664</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-2665"><a href="#Select.cluster_by-2665"><span class="linenos">2665</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.cluster_by-2666"><a href="#Select.cluster_by-2666"><span class="linenos">2666</span></a> <span class="p">)</span> </span></pre></div> @@ -33723,38 +33735,38 @@ 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-2670"><a href="#Select.limit-2670"><span class="linenos">2670</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> -</span><span id="Select.limit-2671"><a href="#Select.limit-2671"><span class="linenos">2671</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> -</span><span id="Select.limit-2672"><a href="#Select.limit-2672"><span class="linenos">2672</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.limit-2673"><a href="#Select.limit-2673"><span class="linenos">2673</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.limit-2674"><a href="#Select.limit-2674"><span class="linenos">2674</span></a><span class="sd"> Set the LIMIT expression.</span> -</span><span id="Select.limit-2675"><a href="#Select.limit-2675"><span class="linenos">2675</span></a> -</span><span id="Select.limit-2676"><a href="#Select.limit-2676"><span class="linenos">2676</span></a><span class="sd"> Example:</span> -</span><span id="Select.limit-2677"><a href="#Select.limit-2677"><span class="linenos">2677</span></a><span class="sd"> >>> Select().from_("tbl").select("x").limit(10).sql()</span> -</span><span id="Select.limit-2678"><a href="#Select.limit-2678"><span class="linenos">2678</span></a><span class="sd"> 'SELECT x FROM tbl LIMIT 10'</span> -</span><span id="Select.limit-2679"><a href="#Select.limit-2679"><span class="linenos">2679</span></a> -</span><span id="Select.limit-2680"><a href="#Select.limit-2680"><span class="linenos">2680</span></a><span class="sd"> Args:</span> -</span><span id="Select.limit-2681"><a href="#Select.limit-2681"><span class="linenos">2681</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="Select.limit-2682"><a href="#Select.limit-2682"><span class="linenos">2682</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="Select.limit-2683"><a href="#Select.limit-2683"><span class="linenos">2683</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> -</span><span id="Select.limit-2684"><a href="#Select.limit-2684"><span class="linenos">2684</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> -</span><span id="Select.limit-2685"><a href="#Select.limit-2685"><span class="linenos">2685</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select.limit-2686"><a href="#Select.limit-2686"><span class="linenos">2686</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.limit-2687"><a href="#Select.limit-2687"><span class="linenos">2687</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.limit-2688"><a href="#Select.limit-2688"><span class="linenos">2688</span></a> -</span><span id="Select.limit-2689"><a href="#Select.limit-2689"><span class="linenos">2689</span></a><span class="sd"> Returns:</span> -</span><span id="Select.limit-2690"><a href="#Select.limit-2690"><span class="linenos">2690</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.limit-2691"><a href="#Select.limit-2691"><span class="linenos">2691</span></a><span class="sd"> """</span> -</span><span id="Select.limit-2692"><a href="#Select.limit-2692"><span class="linenos">2692</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Select.limit-2693"><a href="#Select.limit-2693"><span class="linenos">2693</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-2694"><a href="#Select.limit-2694"><span class="linenos">2694</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-2695"><a href="#Select.limit-2695"><span class="linenos">2695</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-2696"><a href="#Select.limit-2696"><span class="linenos">2696</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-2697"><a href="#Select.limit-2697"><span class="linenos">2697</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-2698"><a href="#Select.limit-2698"><span class="linenos">2698</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-2699"><a href="#Select.limit-2699"><span class="linenos">2699</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-2700"><a href="#Select.limit-2700"><span class="linenos">2700</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.limit-2701"><a href="#Select.limit-2701"><span class="linenos">2701</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.limit-2668"><a href="#Select.limit-2668"><span class="linenos">2668</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span> +</span><span id="Select.limit-2669"><a href="#Select.limit-2669"><span class="linenos">2669</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> +</span><span id="Select.limit-2670"><a href="#Select.limit-2670"><span class="linenos">2670</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.limit-2671"><a href="#Select.limit-2671"><span class="linenos">2671</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.limit-2672"><a href="#Select.limit-2672"><span class="linenos">2672</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="Select.limit-2673"><a href="#Select.limit-2673"><span class="linenos">2673</span></a> +</span><span id="Select.limit-2674"><a href="#Select.limit-2674"><span class="linenos">2674</span></a><span class="sd"> Example:</span> +</span><span id="Select.limit-2675"><a href="#Select.limit-2675"><span class="linenos">2675</span></a><span class="sd"> >>> Select().from_("tbl").select("x").limit(10).sql()</span> +</span><span id="Select.limit-2676"><a href="#Select.limit-2676"><span class="linenos">2676</span></a><span class="sd"> 'SELECT x FROM tbl LIMIT 10'</span> +</span><span id="Select.limit-2677"><a href="#Select.limit-2677"><span class="linenos">2677</span></a> +</span><span id="Select.limit-2678"><a href="#Select.limit-2678"><span class="linenos">2678</span></a><span class="sd"> Args:</span> +</span><span id="Select.limit-2679"><a href="#Select.limit-2679"><span class="linenos">2679</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="Select.limit-2680"><a href="#Select.limit-2680"><span class="linenos">2680</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="Select.limit-2681"><a href="#Select.limit-2681"><span class="linenos">2681</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> +</span><span id="Select.limit-2682"><a href="#Select.limit-2682"><span class="linenos">2682</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> +</span><span id="Select.limit-2683"><a href="#Select.limit-2683"><span class="linenos">2683</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select.limit-2684"><a href="#Select.limit-2684"><span class="linenos">2684</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.limit-2685"><a href="#Select.limit-2685"><span class="linenos">2685</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.limit-2686"><a href="#Select.limit-2686"><span class="linenos">2686</span></a> +</span><span id="Select.limit-2687"><a href="#Select.limit-2687"><span class="linenos">2687</span></a><span class="sd"> Returns:</span> +</span><span id="Select.limit-2688"><a href="#Select.limit-2688"><span class="linenos">2688</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.limit-2689"><a href="#Select.limit-2689"><span class="linenos">2689</span></a><span class="sd"> """</span> +</span><span id="Select.limit-2690"><a href="#Select.limit-2690"><span class="linenos">2690</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Select.limit-2691"><a href="#Select.limit-2691"><span class="linenos">2691</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-2692"><a href="#Select.limit-2692"><span class="linenos">2692</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-2693"><a href="#Select.limit-2693"><span class="linenos">2693</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-2694"><a href="#Select.limit-2694"><span class="linenos">2694</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-2695"><a href="#Select.limit-2695"><span class="linenos">2695</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-2696"><a href="#Select.limit-2696"><span class="linenos">2696</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-2697"><a href="#Select.limit-2697"><span class="linenos">2697</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-2698"><a href="#Select.limit-2698"><span class="linenos">2698</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.limit-2699"><a href="#Select.limit-2699"><span class="linenos">2699</span></a> <span class="p">)</span> </span></pre></div> @@ -33802,38 +33814,38 @@ 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-2703"><a href="#Select.offset-2703"><span class="linenos">2703</span></a> <span class="k">def</span> <span class="nf">offset</span><span class="p">(</span> -</span><span id="Select.offset-2704"><a href="#Select.offset-2704"><span class="linenos">2704</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> -</span><span id="Select.offset-2705"><a href="#Select.offset-2705"><span class="linenos">2705</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.offset-2706"><a href="#Select.offset-2706"><span class="linenos">2706</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.offset-2707"><a href="#Select.offset-2707"><span class="linenos">2707</span></a><span class="sd"> Set the OFFSET expression.</span> -</span><span id="Select.offset-2708"><a href="#Select.offset-2708"><span class="linenos">2708</span></a> -</span><span id="Select.offset-2709"><a href="#Select.offset-2709"><span class="linenos">2709</span></a><span class="sd"> Example:</span> -</span><span id="Select.offset-2710"><a href="#Select.offset-2710"><span class="linenos">2710</span></a><span class="sd"> >>> Select().from_("tbl").select("x").offset(10).sql()</span> -</span><span id="Select.offset-2711"><a href="#Select.offset-2711"><span class="linenos">2711</span></a><span class="sd"> 'SELECT x FROM tbl OFFSET 10'</span> -</span><span id="Select.offset-2712"><a href="#Select.offset-2712"><span class="linenos">2712</span></a> -</span><span id="Select.offset-2713"><a href="#Select.offset-2713"><span class="linenos">2713</span></a><span class="sd"> Args:</span> -</span><span id="Select.offset-2714"><a href="#Select.offset-2714"><span class="linenos">2714</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="Select.offset-2715"><a href="#Select.offset-2715"><span class="linenos">2715</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="Select.offset-2716"><a href="#Select.offset-2716"><span class="linenos">2716</span></a><span class="sd"> If a `Offset` instance is passed, this is used as-is.</span> -</span><span id="Select.offset-2717"><a href="#Select.offset-2717"><span class="linenos">2717</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Offset`.</span> -</span><span id="Select.offset-2718"><a href="#Select.offset-2718"><span class="linenos">2718</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="Select.offset-2719"><a href="#Select.offset-2719"><span class="linenos">2719</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.offset-2720"><a href="#Select.offset-2720"><span class="linenos">2720</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.offset-2721"><a href="#Select.offset-2721"><span class="linenos">2721</span></a> -</span><span id="Select.offset-2722"><a href="#Select.offset-2722"><span class="linenos">2722</span></a><span class="sd"> Returns:</span> -</span><span id="Select.offset-2723"><a href="#Select.offset-2723"><span class="linenos">2723</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select.offset-2724"><a href="#Select.offset-2724"><span class="linenos">2724</span></a><span class="sd"> """</span> -</span><span id="Select.offset-2725"><a href="#Select.offset-2725"><span class="linenos">2725</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Select.offset-2726"><a href="#Select.offset-2726"><span class="linenos">2726</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-2727"><a href="#Select.offset-2727"><span class="linenos">2727</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-2728"><a href="#Select.offset-2728"><span class="linenos">2728</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-2729"><a href="#Select.offset-2729"><span class="linenos">2729</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-2730"><a href="#Select.offset-2730"><span class="linenos">2730</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-2731"><a href="#Select.offset-2731"><span class="linenos">2731</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-2732"><a href="#Select.offset-2732"><span class="linenos">2732</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-2733"><a href="#Select.offset-2733"><span class="linenos">2733</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.offset-2734"><a href="#Select.offset-2734"><span class="linenos">2734</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.offset-2701"><a href="#Select.offset-2701"><span class="linenos">2701</span></a> <span class="k">def</span> <span class="nf">offset</span><span class="p">(</span> +</span><span id="Select.offset-2702"><a href="#Select.offset-2702"><span class="linenos">2702</span></a> <span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span> <span class="o">|</span> <span class="nb">int</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="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">opts</span> +</span><span id="Select.offset-2703"><a href="#Select.offset-2703"><span class="linenos">2703</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.offset-2704"><a href="#Select.offset-2704"><span class="linenos">2704</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.offset-2705"><a href="#Select.offset-2705"><span class="linenos">2705</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="Select.offset-2706"><a href="#Select.offset-2706"><span class="linenos">2706</span></a> +</span><span id="Select.offset-2707"><a href="#Select.offset-2707"><span class="linenos">2707</span></a><span class="sd"> Example:</span> +</span><span id="Select.offset-2708"><a href="#Select.offset-2708"><span class="linenos">2708</span></a><span class="sd"> >>> Select().from_("tbl").select("x").offset(10).sql()</span> +</span><span id="Select.offset-2709"><a href="#Select.offset-2709"><span class="linenos">2709</span></a><span class="sd"> 'SELECT x FROM tbl OFFSET 10'</span> +</span><span id="Select.offset-2710"><a href="#Select.offset-2710"><span class="linenos">2710</span></a> +</span><span id="Select.offset-2711"><a href="#Select.offset-2711"><span class="linenos">2711</span></a><span class="sd"> Args:</span> +</span><span id="Select.offset-2712"><a href="#Select.offset-2712"><span class="linenos">2712</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="Select.offset-2713"><a href="#Select.offset-2713"><span class="linenos">2713</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="Select.offset-2714"><a href="#Select.offset-2714"><span class="linenos">2714</span></a><span class="sd"> If a `Offset` instance is passed, this is used as-is.</span> +</span><span id="Select.offset-2715"><a href="#Select.offset-2715"><span class="linenos">2715</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Offset`.</span> +</span><span id="Select.offset-2716"><a href="#Select.offset-2716"><span class="linenos">2716</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="Select.offset-2717"><a href="#Select.offset-2717"><span class="linenos">2717</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.offset-2718"><a href="#Select.offset-2718"><span class="linenos">2718</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.offset-2719"><a href="#Select.offset-2719"><span class="linenos">2719</span></a> +</span><span id="Select.offset-2720"><a href="#Select.offset-2720"><span class="linenos">2720</span></a><span class="sd"> Returns:</span> +</span><span id="Select.offset-2721"><a href="#Select.offset-2721"><span class="linenos">2721</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select.offset-2722"><a href="#Select.offset-2722"><span class="linenos">2722</span></a><span class="sd"> """</span> +</span><span id="Select.offset-2723"><a href="#Select.offset-2723"><span class="linenos">2723</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Select.offset-2724"><a href="#Select.offset-2724"><span class="linenos">2724</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-2725"><a href="#Select.offset-2725"><span class="linenos">2725</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-2726"><a href="#Select.offset-2726"><span class="linenos">2726</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-2727"><a href="#Select.offset-2727"><span class="linenos">2727</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-2728"><a href="#Select.offset-2728"><span class="linenos">2728</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-2729"><a href="#Select.offset-2729"><span class="linenos">2729</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-2730"><a href="#Select.offset-2730"><span class="linenos">2730</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-2731"><a href="#Select.offset-2731"><span class="linenos">2731</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.offset-2732"><a href="#Select.offset-2732"><span class="linenos">2732</span></a> <span class="p">)</span> </span></pre></div> @@ -33881,42 +33893,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-2736"><a href="#Select.select-2736"><span class="linenos">2736</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> -</span><span id="Select.select-2737"><a href="#Select.select-2737"><span class="linenos">2737</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.select-2738"><a href="#Select.select-2738"><span class="linenos">2738</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select.select-2739"><a href="#Select.select-2739"><span class="linenos">2739</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-2740"><a href="#Select.select-2740"><span class="linenos">2740</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-2741"><a href="#Select.select-2741"><span class="linenos">2741</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-2742"><a href="#Select.select-2742"><span class="linenos">2742</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.select-2743"><a href="#Select.select-2743"><span class="linenos">2743</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.select-2744"><a href="#Select.select-2744"><span class="linenos">2744</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.select-2745"><a href="#Select.select-2745"><span class="linenos">2745</span></a><span class="sd"> Append to or set the SELECT expressions.</span> -</span><span id="Select.select-2746"><a href="#Select.select-2746"><span class="linenos">2746</span></a> -</span><span id="Select.select-2747"><a href="#Select.select-2747"><span class="linenos">2747</span></a><span class="sd"> Example:</span> -</span><span id="Select.select-2748"><a href="#Select.select-2748"><span class="linenos">2748</span></a><span class="sd"> >>> Select().select("x", "y").sql()</span> -</span><span id="Select.select-2749"><a href="#Select.select-2749"><span class="linenos">2749</span></a><span class="sd"> 'SELECT x, y'</span> -</span><span id="Select.select-2750"><a href="#Select.select-2750"><span class="linenos">2750</span></a> -</span><span id="Select.select-2751"><a href="#Select.select-2751"><span class="linenos">2751</span></a><span class="sd"> Args:</span> -</span><span id="Select.select-2752"><a href="#Select.select-2752"><span class="linenos">2752</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select.select-2753"><a href="#Select.select-2753"><span class="linenos">2753</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.select-2754"><a href="#Select.select-2754"><span class="linenos">2754</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select.select-2755"><a href="#Select.select-2755"><span class="linenos">2755</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Select.select-2756"><a href="#Select.select-2756"><span class="linenos">2756</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Select.select-2757"><a href="#Select.select-2757"><span class="linenos">2757</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.select-2758"><a href="#Select.select-2758"><span class="linenos">2758</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.select-2759"><a href="#Select.select-2759"><span class="linenos">2759</span></a> -</span><span id="Select.select-2760"><a href="#Select.select-2760"><span class="linenos">2760</span></a><span class="sd"> Returns:</span> -</span><span id="Select.select-2761"><a href="#Select.select-2761"><span class="linenos">2761</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select.select-2762"><a href="#Select.select-2762"><span class="linenos">2762</span></a><span class="sd"> """</span> -</span><span id="Select.select-2763"><a href="#Select.select-2763"><span class="linenos">2763</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select.select-2764"><a href="#Select.select-2764"><span class="linenos">2764</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.select-2765"><a href="#Select.select-2765"><span class="linenos">2765</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-2766"><a href="#Select.select-2766"><span class="linenos">2766</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-2767"><a href="#Select.select-2767"><span class="linenos">2767</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-2768"><a href="#Select.select-2768"><span class="linenos">2768</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-2769"><a href="#Select.select-2769"><span class="linenos">2769</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-2770"><a href="#Select.select-2770"><span class="linenos">2770</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.select-2771"><a href="#Select.select-2771"><span class="linenos">2771</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.select-2734"><a href="#Select.select-2734"><span class="linenos">2734</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> +</span><span id="Select.select-2735"><a href="#Select.select-2735"><span class="linenos">2735</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.select-2736"><a href="#Select.select-2736"><span class="linenos">2736</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select.select-2737"><a href="#Select.select-2737"><span class="linenos">2737</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-2738"><a href="#Select.select-2738"><span class="linenos">2738</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-2739"><a href="#Select.select-2739"><span class="linenos">2739</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-2740"><a href="#Select.select-2740"><span class="linenos">2740</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.select-2741"><a href="#Select.select-2741"><span class="linenos">2741</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.select-2742"><a href="#Select.select-2742"><span class="linenos">2742</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.select-2743"><a href="#Select.select-2743"><span class="linenos">2743</span></a><span class="sd"> Append to or set the SELECT expressions.</span> +</span><span id="Select.select-2744"><a href="#Select.select-2744"><span class="linenos">2744</span></a> +</span><span id="Select.select-2745"><a href="#Select.select-2745"><span class="linenos">2745</span></a><span class="sd"> Example:</span> +</span><span id="Select.select-2746"><a href="#Select.select-2746"><span class="linenos">2746</span></a><span class="sd"> >>> Select().select("x", "y").sql()</span> +</span><span id="Select.select-2747"><a href="#Select.select-2747"><span class="linenos">2747</span></a><span class="sd"> 'SELECT x, y'</span> +</span><span id="Select.select-2748"><a href="#Select.select-2748"><span class="linenos">2748</span></a> +</span><span id="Select.select-2749"><a href="#Select.select-2749"><span class="linenos">2749</span></a><span class="sd"> Args:</span> +</span><span id="Select.select-2750"><a href="#Select.select-2750"><span class="linenos">2750</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select.select-2751"><a href="#Select.select-2751"><span class="linenos">2751</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.select-2752"><a href="#Select.select-2752"><span class="linenos">2752</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select.select-2753"><a href="#Select.select-2753"><span class="linenos">2753</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Select.select-2754"><a href="#Select.select-2754"><span class="linenos">2754</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Select.select-2755"><a href="#Select.select-2755"><span class="linenos">2755</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.select-2756"><a href="#Select.select-2756"><span class="linenos">2756</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.select-2757"><a href="#Select.select-2757"><span class="linenos">2757</span></a> +</span><span id="Select.select-2758"><a href="#Select.select-2758"><span class="linenos">2758</span></a><span class="sd"> Returns:</span> +</span><span id="Select.select-2759"><a href="#Select.select-2759"><span class="linenos">2759</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select.select-2760"><a href="#Select.select-2760"><span class="linenos">2760</span></a><span class="sd"> """</span> +</span><span id="Select.select-2761"><a href="#Select.select-2761"><span class="linenos">2761</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select.select-2762"><a href="#Select.select-2762"><span class="linenos">2762</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.select-2763"><a href="#Select.select-2763"><span class="linenos">2763</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-2764"><a href="#Select.select-2764"><span class="linenos">2764</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-2765"><a href="#Select.select-2765"><span class="linenos">2765</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-2766"><a href="#Select.select-2766"><span class="linenos">2766</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-2767"><a href="#Select.select-2767"><span class="linenos">2767</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-2768"><a href="#Select.select-2768"><span class="linenos">2768</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.select-2769"><a href="#Select.select-2769"><span class="linenos">2769</span></a> <span class="p">)</span> </span></pre></div> @@ -33964,44 +33976,44 @@ 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-2773"><a href="#Select.lateral-2773"><span class="linenos">2773</span></a> <span class="k">def</span> <span class="nf">lateral</span><span class="p">(</span> -</span><span id="Select.lateral-2774"><a href="#Select.lateral-2774"><span class="linenos">2774</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.lateral-2775"><a href="#Select.lateral-2775"><span class="linenos">2775</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select.lateral-2776"><a href="#Select.lateral-2776"><span class="linenos">2776</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.lateral-2777"><a href="#Select.lateral-2777"><span class="linenos">2777</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.lateral-2778"><a href="#Select.lateral-2778"><span class="linenos">2778</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.lateral-2779"><a href="#Select.lateral-2779"><span class="linenos">2779</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.lateral-2780"><a href="#Select.lateral-2780"><span class="linenos">2780</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.lateral-2781"><a href="#Select.lateral-2781"><span class="linenos">2781</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.lateral-2782"><a href="#Select.lateral-2782"><span class="linenos">2782</span></a><span class="sd"> Append to or set the LATERAL expressions.</span> -</span><span id="Select.lateral-2783"><a href="#Select.lateral-2783"><span class="linenos">2783</span></a> -</span><span id="Select.lateral-2784"><a href="#Select.lateral-2784"><span class="linenos">2784</span></a><span class="sd"> Example:</span> -</span><span id="Select.lateral-2785"><a href="#Select.lateral-2785"><span class="linenos">2785</span></a><span class="sd"> >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()</span> -</span><span id="Select.lateral-2786"><a href="#Select.lateral-2786"><span class="linenos">2786</span></a><span class="sd"> 'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'</span> -</span><span id="Select.lateral-2787"><a href="#Select.lateral-2787"><span class="linenos">2787</span></a> -</span><span id="Select.lateral-2788"><a href="#Select.lateral-2788"><span class="linenos">2788</span></a><span class="sd"> Args:</span> -</span><span id="Select.lateral-2789"><a href="#Select.lateral-2789"><span class="linenos">2789</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select.lateral-2790"><a href="#Select.lateral-2790"><span class="linenos">2790</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.lateral-2791"><a href="#Select.lateral-2791"><span class="linenos">2791</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select.lateral-2792"><a href="#Select.lateral-2792"><span class="linenos">2792</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Select.lateral-2793"><a href="#Select.lateral-2793"><span class="linenos">2793</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Select.lateral-2794"><a href="#Select.lateral-2794"><span class="linenos">2794</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.lateral-2795"><a href="#Select.lateral-2795"><span class="linenos">2795</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.lateral-2796"><a href="#Select.lateral-2796"><span class="linenos">2796</span></a> -</span><span id="Select.lateral-2797"><a href="#Select.lateral-2797"><span class="linenos">2797</span></a><span class="sd"> Returns:</span> -</span><span id="Select.lateral-2798"><a href="#Select.lateral-2798"><span class="linenos">2798</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select.lateral-2799"><a href="#Select.lateral-2799"><span class="linenos">2799</span></a><span class="sd"> """</span> -</span><span id="Select.lateral-2800"><a href="#Select.lateral-2800"><span class="linenos">2800</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select.lateral-2801"><a href="#Select.lateral-2801"><span class="linenos">2801</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.lateral-2802"><a href="#Select.lateral-2802"><span class="linenos">2802</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-2803"><a href="#Select.lateral-2803"><span class="linenos">2803</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-2804"><a href="#Select.lateral-2804"><span class="linenos">2804</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-2805"><a href="#Select.lateral-2805"><span class="linenos">2805</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-2806"><a href="#Select.lateral-2806"><span class="linenos">2806</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-2807"><a href="#Select.lateral-2807"><span class="linenos">2807</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-2808"><a href="#Select.lateral-2808"><span class="linenos">2808</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-2809"><a href="#Select.lateral-2809"><span class="linenos">2809</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.lateral-2810"><a href="#Select.lateral-2810"><span class="linenos">2810</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.lateral-2771"><a href="#Select.lateral-2771"><span class="linenos">2771</span></a> <span class="k">def</span> <span class="nf">lateral</span><span class="p">(</span> +</span><span id="Select.lateral-2772"><a href="#Select.lateral-2772"><span class="linenos">2772</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.lateral-2773"><a href="#Select.lateral-2773"><span class="linenos">2773</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select.lateral-2774"><a href="#Select.lateral-2774"><span class="linenos">2774</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.lateral-2775"><a href="#Select.lateral-2775"><span class="linenos">2775</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.lateral-2776"><a href="#Select.lateral-2776"><span class="linenos">2776</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.lateral-2777"><a href="#Select.lateral-2777"><span class="linenos">2777</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.lateral-2778"><a href="#Select.lateral-2778"><span class="linenos">2778</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.lateral-2779"><a href="#Select.lateral-2779"><span class="linenos">2779</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.lateral-2780"><a href="#Select.lateral-2780"><span class="linenos">2780</span></a><span class="sd"> Append to or set the LATERAL expressions.</span> +</span><span id="Select.lateral-2781"><a href="#Select.lateral-2781"><span class="linenos">2781</span></a> +</span><span id="Select.lateral-2782"><a href="#Select.lateral-2782"><span class="linenos">2782</span></a><span class="sd"> Example:</span> +</span><span id="Select.lateral-2783"><a href="#Select.lateral-2783"><span class="linenos">2783</span></a><span class="sd"> >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()</span> +</span><span id="Select.lateral-2784"><a href="#Select.lateral-2784"><span class="linenos">2784</span></a><span class="sd"> 'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'</span> +</span><span id="Select.lateral-2785"><a href="#Select.lateral-2785"><span class="linenos">2785</span></a> +</span><span id="Select.lateral-2786"><a href="#Select.lateral-2786"><span class="linenos">2786</span></a><span class="sd"> Args:</span> +</span><span id="Select.lateral-2787"><a href="#Select.lateral-2787"><span class="linenos">2787</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select.lateral-2788"><a href="#Select.lateral-2788"><span class="linenos">2788</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.lateral-2789"><a href="#Select.lateral-2789"><span class="linenos">2789</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select.lateral-2790"><a href="#Select.lateral-2790"><span class="linenos">2790</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Select.lateral-2791"><a href="#Select.lateral-2791"><span class="linenos">2791</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Select.lateral-2792"><a href="#Select.lateral-2792"><span class="linenos">2792</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.lateral-2793"><a href="#Select.lateral-2793"><span class="linenos">2793</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.lateral-2794"><a href="#Select.lateral-2794"><span class="linenos">2794</span></a> +</span><span id="Select.lateral-2795"><a href="#Select.lateral-2795"><span class="linenos">2795</span></a><span class="sd"> Returns:</span> +</span><span id="Select.lateral-2796"><a href="#Select.lateral-2796"><span class="linenos">2796</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select.lateral-2797"><a href="#Select.lateral-2797"><span class="linenos">2797</span></a><span class="sd"> """</span> +</span><span id="Select.lateral-2798"><a href="#Select.lateral-2798"><span class="linenos">2798</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select.lateral-2799"><a href="#Select.lateral-2799"><span class="linenos">2799</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.lateral-2800"><a href="#Select.lateral-2800"><span class="linenos">2800</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-2801"><a href="#Select.lateral-2801"><span class="linenos">2801</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-2802"><a href="#Select.lateral-2802"><span class="linenos">2802</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-2803"><a href="#Select.lateral-2803"><span class="linenos">2803</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-2804"><a href="#Select.lateral-2804"><span class="linenos">2804</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-2805"><a href="#Select.lateral-2805"><span class="linenos">2805</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-2806"><a href="#Select.lateral-2806"><span class="linenos">2806</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-2807"><a href="#Select.lateral-2807"><span class="linenos">2807</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.lateral-2808"><a href="#Select.lateral-2808"><span class="linenos">2808</span></a> <span class="p">)</span> </span></pre></div> @@ -34049,102 +34061,102 @@ 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-2812"><a href="#Select.join-2812"><span class="linenos">2812</span></a> <span class="k">def</span> <span class="nf">join</span><span class="p">(</span> -</span><span id="Select.join-2813"><a href="#Select.join-2813"><span class="linenos">2813</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.join-2814"><a href="#Select.join-2814"><span class="linenos">2814</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Select.join-2815"><a href="#Select.join-2815"><span class="linenos">2815</span></a> <span class="n">on</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Select.join-2816"><a href="#Select.join-2816"><span class="linenos">2816</span></a> <span class="n">using</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">ExpOrStr</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">ExpOrStr</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Select.join-2817"><a href="#Select.join-2817"><span class="linenos">2817</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.join-2818"><a href="#Select.join-2818"><span class="linenos">2818</span></a> <span class="n">join_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="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Select.join-2819"><a href="#Select.join-2819"><span class="linenos">2819</span></a> <span class="n">join_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="n">Identifier</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="Select.join-2820"><a href="#Select.join-2820"><span class="linenos">2820</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.join-2821"><a href="#Select.join-2821"><span class="linenos">2821</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.join-2822"><a href="#Select.join-2822"><span class="linenos">2822</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.join-2823"><a href="#Select.join-2823"><span class="linenos">2823</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.join-2824"><a href="#Select.join-2824"><span class="linenos">2824</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.join-2825"><a href="#Select.join-2825"><span class="linenos">2825</span></a><span class="sd"> Append to or set the JOIN expressions.</span> -</span><span id="Select.join-2826"><a href="#Select.join-2826"><span class="linenos">2826</span></a> -</span><span id="Select.join-2827"><a href="#Select.join-2827"><span class="linenos">2827</span></a><span class="sd"> Example:</span> -</span><span id="Select.join-2828"><a href="#Select.join-2828"><span class="linenos">2828</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()</span> -</span><span id="Select.join-2829"><a href="#Select.join-2829"><span class="linenos">2829</span></a><span class="sd"> 'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'</span> -</span><span id="Select.join-2830"><a href="#Select.join-2830"><span class="linenos">2830</span></a> -</span><span id="Select.join-2831"><a href="#Select.join-2831"><span class="linenos">2831</span></a><span class="sd"> >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()</span> -</span><span id="Select.join-2832"><a href="#Select.join-2832"><span class="linenos">2832</span></a><span class="sd"> 'SELECT 1 FROM a JOIN b USING (x, y, z)'</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.join-2810"><a href="#Select.join-2810"><span class="linenos">2810</span></a> <span class="k">def</span> <span class="nf">join</span><span class="p">(</span> +</span><span id="Select.join-2811"><a href="#Select.join-2811"><span class="linenos">2811</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.join-2812"><a href="#Select.join-2812"><span class="linenos">2812</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Select.join-2813"><a href="#Select.join-2813"><span class="linenos">2813</span></a> <span class="n">on</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Select.join-2814"><a href="#Select.join-2814"><span class="linenos">2814</span></a> <span class="n">using</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">ExpOrStr</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">ExpOrStr</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Select.join-2815"><a href="#Select.join-2815"><span class="linenos">2815</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.join-2816"><a href="#Select.join-2816"><span class="linenos">2816</span></a> <span class="n">join_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="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Select.join-2817"><a href="#Select.join-2817"><span class="linenos">2817</span></a> <span class="n">join_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="n">Identifier</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="Select.join-2818"><a href="#Select.join-2818"><span class="linenos">2818</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.join-2819"><a href="#Select.join-2819"><span class="linenos">2819</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.join-2820"><a href="#Select.join-2820"><span class="linenos">2820</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.join-2821"><a href="#Select.join-2821"><span class="linenos">2821</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.join-2822"><a href="#Select.join-2822"><span class="linenos">2822</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.join-2823"><a href="#Select.join-2823"><span class="linenos">2823</span></a><span class="sd"> Append to or set the JOIN expressions.</span> +</span><span id="Select.join-2824"><a href="#Select.join-2824"><span class="linenos">2824</span></a> +</span><span id="Select.join-2825"><a href="#Select.join-2825"><span class="linenos">2825</span></a><span class="sd"> Example:</span> +</span><span id="Select.join-2826"><a href="#Select.join-2826"><span class="linenos">2826</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()</span> +</span><span id="Select.join-2827"><a href="#Select.join-2827"><span class="linenos">2827</span></a><span class="sd"> 'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'</span> +</span><span id="Select.join-2828"><a href="#Select.join-2828"><span class="linenos">2828</span></a> +</span><span id="Select.join-2829"><a href="#Select.join-2829"><span class="linenos">2829</span></a><span class="sd"> >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()</span> +</span><span id="Select.join-2830"><a href="#Select.join-2830"><span class="linenos">2830</span></a><span class="sd"> 'SELECT 1 FROM a JOIN b USING (x, y, z)'</span> +</span><span id="Select.join-2831"><a href="#Select.join-2831"><span class="linenos">2831</span></a> +</span><span id="Select.join-2832"><a href="#Select.join-2832"><span class="linenos">2832</span></a><span class="sd"> Use `join_type` to change the type of join:</span> </span><span id="Select.join-2833"><a href="#Select.join-2833"><span class="linenos">2833</span></a> -</span><span id="Select.join-2834"><a href="#Select.join-2834"><span class="linenos">2834</span></a><span class="sd"> Use `join_type` to change the type of join:</span> -</span><span id="Select.join-2835"><a href="#Select.join-2835"><span class="linenos">2835</span></a> -</span><span id="Select.join-2836"><a href="#Select.join-2836"><span class="linenos">2836</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-2837"><a href="#Select.join-2837"><span class="linenos">2837</span></a><span class="sd"> 'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'</span> -</span><span id="Select.join-2838"><a href="#Select.join-2838"><span class="linenos">2838</span></a> -</span><span id="Select.join-2839"><a href="#Select.join-2839"><span class="linenos">2839</span></a><span class="sd"> Args:</span> -</span><span id="Select.join-2840"><a href="#Select.join-2840"><span class="linenos">2840</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="Select.join-2834"><a href="#Select.join-2834"><span class="linenos">2834</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-2835"><a href="#Select.join-2835"><span class="linenos">2835</span></a><span class="sd"> 'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'</span> +</span><span id="Select.join-2836"><a href="#Select.join-2836"><span class="linenos">2836</span></a> +</span><span id="Select.join-2837"><a href="#Select.join-2837"><span class="linenos">2837</span></a><span class="sd"> Args:</span> +</span><span id="Select.join-2838"><a href="#Select.join-2838"><span class="linenos">2838</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="Select.join-2839"><a href="#Select.join-2839"><span class="linenos">2839</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.join-2840"><a href="#Select.join-2840"><span class="linenos">2840</span></a><span class="sd"> on: optionally specify the join "on" criteria as a SQL string.</span> </span><span id="Select.join-2841"><a href="#Select.join-2841"><span class="linenos">2841</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.join-2842"><a href="#Select.join-2842"><span class="linenos">2842</span></a><span class="sd"> on: optionally specify the join "on" criteria as a SQL string.</span> +</span><span id="Select.join-2842"><a href="#Select.join-2842"><span class="linenos">2842</span></a><span class="sd"> using: optionally specify the join "using" criteria as a SQL string.</span> </span><span id="Select.join-2843"><a href="#Select.join-2843"><span class="linenos">2843</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.join-2844"><a href="#Select.join-2844"><span class="linenos">2844</span></a><span class="sd"> using: optionally specify the join "using" criteria as a SQL string.</span> -</span><span id="Select.join-2845"><a href="#Select.join-2845"><span class="linenos">2845</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.join-2846"><a href="#Select.join-2846"><span class="linenos">2846</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select.join-2847"><a href="#Select.join-2847"><span class="linenos">2847</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Select.join-2848"><a href="#Select.join-2848"><span class="linenos">2848</span></a><span class="sd"> join_type: if set, alter the parsed join type.</span> -</span><span id="Select.join-2849"><a href="#Select.join-2849"><span class="linenos">2849</span></a><span class="sd"> join_alias: an optional alias for the joined source.</span> -</span><span id="Select.join-2850"><a href="#Select.join-2850"><span class="linenos">2850</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Select.join-2851"><a href="#Select.join-2851"><span class="linenos">2851</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.join-2852"><a href="#Select.join-2852"><span class="linenos">2852</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.join-2853"><a href="#Select.join-2853"><span class="linenos">2853</span></a> -</span><span id="Select.join-2854"><a href="#Select.join-2854"><span class="linenos">2854</span></a><span class="sd"> Returns:</span> -</span><span id="Select.join-2855"><a href="#Select.join-2855"><span class="linenos">2855</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.join-2856"><a href="#Select.join-2856"><span class="linenos">2856</span></a><span class="sd"> """</span> -</span><span id="Select.join-2857"><a href="#Select.join-2857"><span class="linenos">2857</span></a> <span class="n">parse_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 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-2858"><a href="#Select.join-2858"><span class="linenos">2858</span></a> -</span><span id="Select.join-2859"><a href="#Select.join-2859"><span class="linenos">2859</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="Select.join-2860"><a href="#Select.join-2860"><span class="linenos">2860</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-2861"><a href="#Select.join-2861"><span class="linenos">2861</span></a> <span class="k">except</span> <span class="n">ParseError</span><span class="p">:</span> -</span><span id="Select.join-2862"><a href="#Select.join-2862"><span class="linenos">2862</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-2844"><a href="#Select.join-2844"><span class="linenos">2844</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select.join-2845"><a href="#Select.join-2845"><span class="linenos">2845</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Select.join-2846"><a href="#Select.join-2846"><span class="linenos">2846</span></a><span class="sd"> join_type: if set, alter the parsed join type.</span> +</span><span id="Select.join-2847"><a href="#Select.join-2847"><span class="linenos">2847</span></a><span class="sd"> join_alias: an optional alias for the joined source.</span> +</span><span id="Select.join-2848"><a href="#Select.join-2848"><span class="linenos">2848</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Select.join-2849"><a href="#Select.join-2849"><span class="linenos">2849</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.join-2850"><a href="#Select.join-2850"><span class="linenos">2850</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.join-2851"><a href="#Select.join-2851"><span class="linenos">2851</span></a> +</span><span id="Select.join-2852"><a href="#Select.join-2852"><span class="linenos">2852</span></a><span class="sd"> Returns:</span> +</span><span id="Select.join-2853"><a href="#Select.join-2853"><span class="linenos">2853</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.join-2854"><a href="#Select.join-2854"><span class="linenos">2854</span></a><span class="sd"> """</span> +</span><span id="Select.join-2855"><a href="#Select.join-2855"><span class="linenos">2855</span></a> <span class="n">parse_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 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-2856"><a href="#Select.join-2856"><span class="linenos">2856</span></a> +</span><span id="Select.join-2857"><a href="#Select.join-2857"><span class="linenos">2857</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="Select.join-2858"><a href="#Select.join-2858"><span class="linenos">2858</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-2859"><a href="#Select.join-2859"><span class="linenos">2859</span></a> <span class="k">except</span> <span class="n">ParseError</span><span class="p">:</span> +</span><span id="Select.join-2860"><a href="#Select.join-2860"><span class="linenos">2860</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-2861"><a href="#Select.join-2861"><span class="linenos">2861</span></a> +</span><span id="Select.join-2862"><a href="#Select.join-2862"><span class="linenos">2862</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-2863"><a href="#Select.join-2863"><span class="linenos">2863</span></a> -</span><span id="Select.join-2864"><a href="#Select.join-2864"><span class="linenos">2864</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-2865"><a href="#Select.join-2865"><span class="linenos">2865</span></a> -</span><span id="Select.join-2866"><a href="#Select.join-2866"><span class="linenos">2866</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-2867"><a href="#Select.join-2867"><span class="linenos">2867</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-2868"><a href="#Select.join-2868"><span class="linenos">2868</span></a> -</span><span id="Select.join-2869"><a href="#Select.join-2869"><span class="linenos">2869</span></a> <span class="k">if</span> <span class="n">join_type</span><span class="p">:</span> -</span><span id="Select.join-2870"><a href="#Select.join-2870"><span class="linenos">2870</span></a> <span class="n">method</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-2871"><a href="#Select.join-2871"><span class="linenos">2871</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-2872"><a href="#Select.join-2872"><span class="linenos">2872</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-2864"><a href="#Select.join-2864"><span class="linenos">2864</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-2865"><a href="#Select.join-2865"><span class="linenos">2865</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-2866"><a href="#Select.join-2866"><span class="linenos">2866</span></a> +</span><span id="Select.join-2867"><a href="#Select.join-2867"><span class="linenos">2867</span></a> <span class="k">if</span> <span class="n">join_type</span><span class="p">:</span> +</span><span id="Select.join-2868"><a href="#Select.join-2868"><span class="linenos">2868</span></a> <span class="n">method</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-2869"><a href="#Select.join-2869"><span class="linenos">2869</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-2870"><a href="#Select.join-2870"><span class="linenos">2870</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-2871"><a href="#Select.join-2871"><span class="linenos">2871</span></a> +</span><span id="Select.join-2872"><a href="#Select.join-2872"><span class="linenos">2872</span></a> <span class="n">method</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-2873"><a href="#Select.join-2873"><span class="linenos">2873</span></a> -</span><span id="Select.join-2874"><a href="#Select.join-2874"><span class="linenos">2874</span></a> <span class="n">method</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-2875"><a href="#Select.join-2875"><span class="linenos">2875</span></a> -</span><span id="Select.join-2876"><a href="#Select.join-2876"><span class="linenos">2876</span></a> <span class="k">if</span> <span class="n">method</span><span class="p">:</span> -</span><span id="Select.join-2877"><a href="#Select.join-2877"><span class="linenos">2877</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"method"</span><span class="p">,</span> <span class="n">method</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> -</span><span id="Select.join-2878"><a href="#Select.join-2878"><span class="linenos">2878</span></a> <span class="k">if</span> <span class="n">side</span><span class="p">:</span> -</span><span id="Select.join-2879"><a href="#Select.join-2879"><span class="linenos">2879</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-2880"><a href="#Select.join-2880"><span class="linenos">2880</span></a> <span class="k">if</span> <span class="n">kind</span><span class="p">:</span> -</span><span id="Select.join-2881"><a href="#Select.join-2881"><span class="linenos">2881</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-2882"><a href="#Select.join-2882"><span class="linenos">2882</span></a> -</span><span id="Select.join-2883"><a href="#Select.join-2883"><span class="linenos">2883</span></a> <span class="k">if</span> <span class="n">on</span><span class="p">:</span> -</span><span id="Select.join-2884"><a href="#Select.join-2884"><span class="linenos">2884</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_list</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Select.join-2885"><a href="#Select.join-2885"><span class="linenos">2885</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-2886"><a href="#Select.join-2886"><span class="linenos">2886</span></a> -</span><span id="Select.join-2887"><a href="#Select.join-2887"><span class="linenos">2887</span></a> <span class="k">if</span> <span class="n">using</span><span class="p">:</span> -</span><span id="Select.join-2888"><a href="#Select.join-2888"><span class="linenos">2888</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-2889"><a href="#Select.join-2889"><span class="linenos">2889</span></a> <span class="o">*</span><span class="n">ensure_list</span><span class="p">(</span><span class="n">using</span><span class="p">),</span> -</span><span id="Select.join-2890"><a href="#Select.join-2890"><span class="linenos">2890</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-2891"><a href="#Select.join-2891"><span class="linenos">2891</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-2892"><a href="#Select.join-2892"><span class="linenos">2892</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-2893"><a href="#Select.join-2893"><span class="linenos">2893</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-2894"><a href="#Select.join-2894"><span class="linenos">2894</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.join-2895"><a href="#Select.join-2895"><span class="linenos">2895</span></a> <span class="p">)</span> -</span><span id="Select.join-2896"><a href="#Select.join-2896"><span class="linenos">2896</span></a> -</span><span id="Select.join-2897"><a href="#Select.join-2897"><span class="linenos">2897</span></a> <span class="k">if</span> <span class="n">join_alias</span><span class="p">:</span> -</span><span id="Select.join-2898"><a href="#Select.join-2898"><span class="linenos">2898</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-2899"><a href="#Select.join-2899"><span class="linenos">2899</span></a> -</span><span id="Select.join-2900"><a href="#Select.join-2900"><span class="linenos">2900</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select.join-2901"><a href="#Select.join-2901"><span class="linenos">2901</span></a> <span class="n">join</span><span class="p">,</span> -</span><span id="Select.join-2902"><a href="#Select.join-2902"><span class="linenos">2902</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-2903"><a href="#Select.join-2903"><span class="linenos">2903</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-2904"><a href="#Select.join-2904"><span class="linenos">2904</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-2905"><a href="#Select.join-2905"><span class="linenos">2905</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-2906"><a href="#Select.join-2906"><span class="linenos">2906</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.join-2907"><a href="#Select.join-2907"><span class="linenos">2907</span></a> <span class="p">)</span> +</span><span id="Select.join-2874"><a href="#Select.join-2874"><span class="linenos">2874</span></a> <span class="k">if</span> <span class="n">method</span><span class="p">:</span> +</span><span id="Select.join-2875"><a href="#Select.join-2875"><span class="linenos">2875</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"method"</span><span class="p">,</span> <span class="n">method</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> +</span><span id="Select.join-2876"><a href="#Select.join-2876"><span class="linenos">2876</span></a> <span class="k">if</span> <span class="n">side</span><span class="p">:</span> +</span><span id="Select.join-2877"><a href="#Select.join-2877"><span class="linenos">2877</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-2878"><a href="#Select.join-2878"><span class="linenos">2878</span></a> <span class="k">if</span> <span class="n">kind</span><span class="p">:</span> +</span><span id="Select.join-2879"><a href="#Select.join-2879"><span class="linenos">2879</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-2880"><a href="#Select.join-2880"><span class="linenos">2880</span></a> +</span><span id="Select.join-2881"><a href="#Select.join-2881"><span class="linenos">2881</span></a> <span class="k">if</span> <span class="n">on</span><span class="p">:</span> +</span><span id="Select.join-2882"><a href="#Select.join-2882"><span class="linenos">2882</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_list</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Select.join-2883"><a href="#Select.join-2883"><span class="linenos">2883</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-2884"><a href="#Select.join-2884"><span class="linenos">2884</span></a> +</span><span id="Select.join-2885"><a href="#Select.join-2885"><span class="linenos">2885</span></a> <span class="k">if</span> <span class="n">using</span><span class="p">:</span> +</span><span id="Select.join-2886"><a href="#Select.join-2886"><span class="linenos">2886</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-2887"><a href="#Select.join-2887"><span class="linenos">2887</span></a> <span class="o">*</span><span class="n">ensure_list</span><span class="p">(</span><span class="n">using</span><span class="p">),</span> +</span><span id="Select.join-2888"><a href="#Select.join-2888"><span class="linenos">2888</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-2889"><a href="#Select.join-2889"><span class="linenos">2889</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-2890"><a href="#Select.join-2890"><span class="linenos">2890</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-2891"><a href="#Select.join-2891"><span class="linenos">2891</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-2892"><a href="#Select.join-2892"><span class="linenos">2892</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.join-2893"><a href="#Select.join-2893"><span class="linenos">2893</span></a> <span class="p">)</span> +</span><span id="Select.join-2894"><a href="#Select.join-2894"><span class="linenos">2894</span></a> +</span><span id="Select.join-2895"><a href="#Select.join-2895"><span class="linenos">2895</span></a> <span class="k">if</span> <span class="n">join_alias</span><span class="p">:</span> +</span><span id="Select.join-2896"><a href="#Select.join-2896"><span class="linenos">2896</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-2897"><a href="#Select.join-2897"><span class="linenos">2897</span></a> +</span><span id="Select.join-2898"><a href="#Select.join-2898"><span class="linenos">2898</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select.join-2899"><a href="#Select.join-2899"><span class="linenos">2899</span></a> <span class="n">join</span><span class="p">,</span> +</span><span id="Select.join-2900"><a href="#Select.join-2900"><span class="linenos">2900</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-2901"><a href="#Select.join-2901"><span class="linenos">2901</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-2902"><a href="#Select.join-2902"><span class="linenos">2902</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-2903"><a href="#Select.join-2903"><span class="linenos">2903</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-2904"><a href="#Select.join-2904"><span class="linenos">2904</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.join-2905"><a href="#Select.join-2905"><span class="linenos">2905</span></a> <span class="p">)</span> </span></pre></div> @@ -34212,44 +34224,44 @@ 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-2909"><a href="#Select.where-2909"><span class="linenos">2909</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span> -</span><span id="Select.where-2910"><a href="#Select.where-2910"><span class="linenos">2910</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.where-2911"><a href="#Select.where-2911"><span class="linenos">2911</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select.where-2912"><a href="#Select.where-2912"><span class="linenos">2912</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.where-2913"><a href="#Select.where-2913"><span class="linenos">2913</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.where-2914"><a href="#Select.where-2914"><span class="linenos">2914</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.where-2915"><a href="#Select.where-2915"><span class="linenos">2915</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.where-2916"><a href="#Select.where-2916"><span class="linenos">2916</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.where-2917"><a href="#Select.where-2917"><span class="linenos">2917</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.where-2918"><a href="#Select.where-2918"><span class="linenos">2918</span></a><span class="sd"> Append to or set the WHERE expressions.</span> -</span><span id="Select.where-2919"><a href="#Select.where-2919"><span class="linenos">2919</span></a> -</span><span id="Select.where-2920"><a href="#Select.where-2920"><span class="linenos">2920</span></a><span class="sd"> Example:</span> -</span><span id="Select.where-2921"><a href="#Select.where-2921"><span class="linenos">2921</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()</span> -</span><span id="Select.where-2922"><a href="#Select.where-2922"><span class="linenos">2922</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"</span> -</span><span id="Select.where-2923"><a href="#Select.where-2923"><span class="linenos">2923</span></a> -</span><span id="Select.where-2924"><a href="#Select.where-2924"><span class="linenos">2924</span></a><span class="sd"> Args:</span> -</span><span id="Select.where-2925"><a href="#Select.where-2925"><span class="linenos">2925</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select.where-2926"><a href="#Select.where-2926"><span class="linenos">2926</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.where-2927"><a href="#Select.where-2927"><span class="linenos">2927</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Select.where-2928"><a href="#Select.where-2928"><span class="linenos">2928</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Select.where-2929"><a href="#Select.where-2929"><span class="linenos">2929</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Select.where-2930"><a href="#Select.where-2930"><span class="linenos">2930</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Select.where-2931"><a href="#Select.where-2931"><span class="linenos">2931</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.where-2932"><a href="#Select.where-2932"><span class="linenos">2932</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.where-2933"><a href="#Select.where-2933"><span class="linenos">2933</span></a> -</span><span id="Select.where-2934"><a href="#Select.where-2934"><span class="linenos">2934</span></a><span class="sd"> Returns:</span> -</span><span id="Select.where-2935"><a href="#Select.where-2935"><span class="linenos">2935</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.where-2936"><a href="#Select.where-2936"><span class="linenos">2936</span></a><span class="sd"> """</span> -</span><span id="Select.where-2937"><a href="#Select.where-2937"><span class="linenos">2937</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Select.where-2938"><a href="#Select.where-2938"><span class="linenos">2938</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.where-2939"><a href="#Select.where-2939"><span class="linenos">2939</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-2940"><a href="#Select.where-2940"><span class="linenos">2940</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-2941"><a href="#Select.where-2941"><span class="linenos">2941</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-2942"><a href="#Select.where-2942"><span class="linenos">2942</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-2943"><a href="#Select.where-2943"><span class="linenos">2943</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-2944"><a href="#Select.where-2944"><span class="linenos">2944</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-2945"><a href="#Select.where-2945"><span class="linenos">2945</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.where-2946"><a href="#Select.where-2946"><span class="linenos">2946</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.where-2907"><a href="#Select.where-2907"><span class="linenos">2907</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span> +</span><span id="Select.where-2908"><a href="#Select.where-2908"><span class="linenos">2908</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.where-2909"><a href="#Select.where-2909"><span class="linenos">2909</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select.where-2910"><a href="#Select.where-2910"><span class="linenos">2910</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.where-2911"><a href="#Select.where-2911"><span class="linenos">2911</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.where-2912"><a href="#Select.where-2912"><span class="linenos">2912</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.where-2913"><a href="#Select.where-2913"><span class="linenos">2913</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.where-2914"><a href="#Select.where-2914"><span class="linenos">2914</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.where-2915"><a href="#Select.where-2915"><span class="linenos">2915</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.where-2916"><a href="#Select.where-2916"><span class="linenos">2916</span></a><span class="sd"> Append to or set the WHERE expressions.</span> +</span><span id="Select.where-2917"><a href="#Select.where-2917"><span class="linenos">2917</span></a> +</span><span id="Select.where-2918"><a href="#Select.where-2918"><span class="linenos">2918</span></a><span class="sd"> Example:</span> +</span><span id="Select.where-2919"><a href="#Select.where-2919"><span class="linenos">2919</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()</span> +</span><span id="Select.where-2920"><a href="#Select.where-2920"><span class="linenos">2920</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"</span> +</span><span id="Select.where-2921"><a href="#Select.where-2921"><span class="linenos">2921</span></a> +</span><span id="Select.where-2922"><a href="#Select.where-2922"><span class="linenos">2922</span></a><span class="sd"> Args:</span> +</span><span id="Select.where-2923"><a href="#Select.where-2923"><span class="linenos">2923</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select.where-2924"><a href="#Select.where-2924"><span class="linenos">2924</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.where-2925"><a href="#Select.where-2925"><span class="linenos">2925</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Select.where-2926"><a href="#Select.where-2926"><span class="linenos">2926</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Select.where-2927"><a href="#Select.where-2927"><span class="linenos">2927</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Select.where-2928"><a href="#Select.where-2928"><span class="linenos">2928</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Select.where-2929"><a href="#Select.where-2929"><span class="linenos">2929</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.where-2930"><a href="#Select.where-2930"><span class="linenos">2930</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.where-2931"><a href="#Select.where-2931"><span class="linenos">2931</span></a> +</span><span id="Select.where-2932"><a href="#Select.where-2932"><span class="linenos">2932</span></a><span class="sd"> Returns:</span> +</span><span id="Select.where-2933"><a href="#Select.where-2933"><span class="linenos">2933</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.where-2934"><a href="#Select.where-2934"><span class="linenos">2934</span></a><span class="sd"> """</span> +</span><span id="Select.where-2935"><a href="#Select.where-2935"><span class="linenos">2935</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Select.where-2936"><a href="#Select.where-2936"><span class="linenos">2936</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.where-2937"><a href="#Select.where-2937"><span class="linenos">2937</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-2938"><a href="#Select.where-2938"><span class="linenos">2938</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-2939"><a href="#Select.where-2939"><span class="linenos">2939</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-2940"><a href="#Select.where-2940"><span class="linenos">2940</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-2941"><a href="#Select.where-2941"><span class="linenos">2941</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-2942"><a href="#Select.where-2942"><span class="linenos">2942</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-2943"><a href="#Select.where-2943"><span class="linenos">2943</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.where-2944"><a href="#Select.where-2944"><span class="linenos">2944</span></a> <span class="p">)</span> </span></pre></div> @@ -34298,44 +34310,44 @@ 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-2948"><a href="#Select.having-2948"><span class="linenos">2948</span></a> <span class="k">def</span> <span class="nf">having</span><span class="p">(</span> -</span><span id="Select.having-2949"><a href="#Select.having-2949"><span class="linenos">2949</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.having-2950"><a href="#Select.having-2950"><span class="linenos">2950</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select.having-2951"><a href="#Select.having-2951"><span class="linenos">2951</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.having-2952"><a href="#Select.having-2952"><span class="linenos">2952</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.having-2953"><a href="#Select.having-2953"><span class="linenos">2953</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.having-2954"><a href="#Select.having-2954"><span class="linenos">2954</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.having-2955"><a href="#Select.having-2955"><span class="linenos">2955</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.having-2956"><a href="#Select.having-2956"><span class="linenos">2956</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.having-2957"><a href="#Select.having-2957"><span class="linenos">2957</span></a><span class="sd"> Append to or set the HAVING expressions.</span> -</span><span id="Select.having-2958"><a href="#Select.having-2958"><span class="linenos">2958</span></a> -</span><span id="Select.having-2959"><a href="#Select.having-2959"><span class="linenos">2959</span></a><span class="sd"> Example:</span> -</span><span id="Select.having-2960"><a href="#Select.having-2960"><span class="linenos">2960</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-2961"><a href="#Select.having-2961"><span class="linenos">2961</span></a><span class="sd"> 'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'</span> -</span><span id="Select.having-2962"><a href="#Select.having-2962"><span class="linenos">2962</span></a> -</span><span id="Select.having-2963"><a href="#Select.having-2963"><span class="linenos">2963</span></a><span class="sd"> Args:</span> -</span><span id="Select.having-2964"><a href="#Select.having-2964"><span class="linenos">2964</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select.having-2965"><a href="#Select.having-2965"><span class="linenos">2965</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.having-2966"><a href="#Select.having-2966"><span class="linenos">2966</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Select.having-2967"><a href="#Select.having-2967"><span class="linenos">2967</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Select.having-2968"><a href="#Select.having-2968"><span class="linenos">2968</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Select.having-2969"><a href="#Select.having-2969"><span class="linenos">2969</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Select.having-2970"><a href="#Select.having-2970"><span class="linenos">2970</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.having-2971"><a href="#Select.having-2971"><span class="linenos">2971</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.having-2972"><a href="#Select.having-2972"><span class="linenos">2972</span></a> -</span><span id="Select.having-2973"><a href="#Select.having-2973"><span class="linenos">2973</span></a><span class="sd"> Returns:</span> -</span><span id="Select.having-2974"><a href="#Select.having-2974"><span class="linenos">2974</span></a><span class="sd"> The modified Select expression.</span> -</span><span id="Select.having-2975"><a href="#Select.having-2975"><span class="linenos">2975</span></a><span class="sd"> """</span> -</span><span id="Select.having-2976"><a href="#Select.having-2976"><span class="linenos">2976</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Select.having-2977"><a href="#Select.having-2977"><span class="linenos">2977</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.having-2978"><a href="#Select.having-2978"><span class="linenos">2978</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-2979"><a href="#Select.having-2979"><span class="linenos">2979</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-2980"><a href="#Select.having-2980"><span class="linenos">2980</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-2981"><a href="#Select.having-2981"><span class="linenos">2981</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-2982"><a href="#Select.having-2982"><span class="linenos">2982</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-2983"><a href="#Select.having-2983"><span class="linenos">2983</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-2984"><a href="#Select.having-2984"><span class="linenos">2984</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.having-2985"><a href="#Select.having-2985"><span class="linenos">2985</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.having-2946"><a href="#Select.having-2946"><span class="linenos">2946</span></a> <span class="k">def</span> <span class="nf">having</span><span class="p">(</span> +</span><span id="Select.having-2947"><a href="#Select.having-2947"><span class="linenos">2947</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.having-2948"><a href="#Select.having-2948"><span class="linenos">2948</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select.having-2949"><a href="#Select.having-2949"><span class="linenos">2949</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.having-2950"><a href="#Select.having-2950"><span class="linenos">2950</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.having-2951"><a href="#Select.having-2951"><span class="linenos">2951</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.having-2952"><a href="#Select.having-2952"><span class="linenos">2952</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.having-2953"><a href="#Select.having-2953"><span class="linenos">2953</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.having-2954"><a href="#Select.having-2954"><span class="linenos">2954</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.having-2955"><a href="#Select.having-2955"><span class="linenos">2955</span></a><span class="sd"> Append to or set the HAVING expressions.</span> +</span><span id="Select.having-2956"><a href="#Select.having-2956"><span class="linenos">2956</span></a> +</span><span id="Select.having-2957"><a href="#Select.having-2957"><span class="linenos">2957</span></a><span class="sd"> Example:</span> +</span><span id="Select.having-2958"><a href="#Select.having-2958"><span class="linenos">2958</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-2959"><a href="#Select.having-2959"><span class="linenos">2959</span></a><span class="sd"> 'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'</span> +</span><span id="Select.having-2960"><a href="#Select.having-2960"><span class="linenos">2960</span></a> +</span><span id="Select.having-2961"><a href="#Select.having-2961"><span class="linenos">2961</span></a><span class="sd"> Args:</span> +</span><span id="Select.having-2962"><a href="#Select.having-2962"><span class="linenos">2962</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select.having-2963"><a href="#Select.having-2963"><span class="linenos">2963</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.having-2964"><a href="#Select.having-2964"><span class="linenos">2964</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Select.having-2965"><a href="#Select.having-2965"><span class="linenos">2965</span></a><span class="sd"> append: if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Select.having-2966"><a href="#Select.having-2966"><span class="linenos">2966</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Select.having-2967"><a href="#Select.having-2967"><span class="linenos">2967</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Select.having-2968"><a href="#Select.having-2968"><span class="linenos">2968</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.having-2969"><a href="#Select.having-2969"><span class="linenos">2969</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.having-2970"><a href="#Select.having-2970"><span class="linenos">2970</span></a> +</span><span id="Select.having-2971"><a href="#Select.having-2971"><span class="linenos">2971</span></a><span class="sd"> Returns:</span> +</span><span id="Select.having-2972"><a href="#Select.having-2972"><span class="linenos">2972</span></a><span class="sd"> The modified Select expression.</span> +</span><span id="Select.having-2973"><a href="#Select.having-2973"><span class="linenos">2973</span></a><span class="sd"> """</span> +</span><span id="Select.having-2974"><a href="#Select.having-2974"><span class="linenos">2974</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Select.having-2975"><a href="#Select.having-2975"><span class="linenos">2975</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.having-2976"><a href="#Select.having-2976"><span class="linenos">2976</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-2977"><a href="#Select.having-2977"><span class="linenos">2977</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-2978"><a href="#Select.having-2978"><span class="linenos">2978</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-2979"><a href="#Select.having-2979"><span class="linenos">2979</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-2980"><a href="#Select.having-2980"><span class="linenos">2980</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-2981"><a href="#Select.having-2981"><span class="linenos">2981</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-2982"><a href="#Select.having-2982"><span class="linenos">2982</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.having-2983"><a href="#Select.having-2983"><span class="linenos">2983</span></a> <span class="p">)</span> </span></pre></div> @@ -34384,24 +34396,24 @@ 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-2987"><a href="#Select.window-2987"><span class="linenos">2987</span></a> <span class="k">def</span> <span class="nf">window</span><span class="p">(</span> -</span><span id="Select.window-2988"><a href="#Select.window-2988"><span class="linenos">2988</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.window-2989"><a href="#Select.window-2989"><span class="linenos">2989</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select.window-2990"><a href="#Select.window-2990"><span class="linenos">2990</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.window-2991"><a href="#Select.window-2991"><span class="linenos">2991</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.window-2992"><a href="#Select.window-2992"><span class="linenos">2992</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.window-2993"><a href="#Select.window-2993"><span class="linenos">2993</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.window-2994"><a href="#Select.window-2994"><span class="linenos">2994</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.window-2995"><a href="#Select.window-2995"><span class="linenos">2995</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select.window-2996"><a href="#Select.window-2996"><span class="linenos">2996</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.window-2997"><a href="#Select.window-2997"><span class="linenos">2997</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-2998"><a href="#Select.window-2998"><span class="linenos">2998</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-2999"><a href="#Select.window-2999"><span class="linenos">2999</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-3000"><a href="#Select.window-3000"><span class="linenos">3000</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-3001"><a href="#Select.window-3001"><span class="linenos">3001</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-3002"><a href="#Select.window-3002"><span class="linenos">3002</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-3003"><a href="#Select.window-3003"><span class="linenos">3003</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.window-3004"><a href="#Select.window-3004"><span class="linenos">3004</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.window-2985"><a href="#Select.window-2985"><span class="linenos">2985</span></a> <span class="k">def</span> <span class="nf">window</span><span class="p">(</span> +</span><span id="Select.window-2986"><a href="#Select.window-2986"><span class="linenos">2986</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.window-2987"><a href="#Select.window-2987"><span class="linenos">2987</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select.window-2988"><a href="#Select.window-2988"><span class="linenos">2988</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.window-2989"><a href="#Select.window-2989"><span class="linenos">2989</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.window-2990"><a href="#Select.window-2990"><span class="linenos">2990</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.window-2991"><a href="#Select.window-2991"><span class="linenos">2991</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.window-2992"><a href="#Select.window-2992"><span class="linenos">2992</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.window-2993"><a href="#Select.window-2993"><span class="linenos">2993</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select.window-2994"><a href="#Select.window-2994"><span class="linenos">2994</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.window-2995"><a href="#Select.window-2995"><span class="linenos">2995</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-2996"><a href="#Select.window-2996"><span class="linenos">2996</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-2997"><a href="#Select.window-2997"><span class="linenos">2997</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-2998"><a href="#Select.window-2998"><span class="linenos">2998</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-2999"><a href="#Select.window-2999"><span class="linenos">2999</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-3000"><a href="#Select.window-3000"><span class="linenos">3000</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-3001"><a href="#Select.window-3001"><span class="linenos">3001</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.window-3002"><a href="#Select.window-3002"><span class="linenos">3002</span></a> <span class="p">)</span> </span></pre></div> @@ -34419,24 +34431,24 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Select.qualify"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.qualify-3006"><a href="#Select.qualify-3006"><span class="linenos">3006</span></a> <span class="k">def</span> <span class="nf">qualify</span><span class="p">(</span> -</span><span id="Select.qualify-3007"><a href="#Select.qualify-3007"><span class="linenos">3007</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.qualify-3008"><a href="#Select.qualify-3008"><span class="linenos">3008</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> -</span><span id="Select.qualify-3009"><a href="#Select.qualify-3009"><span class="linenos">3009</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.qualify-3010"><a href="#Select.qualify-3010"><span class="linenos">3010</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.qualify-3011"><a href="#Select.qualify-3011"><span class="linenos">3011</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.qualify-3012"><a href="#Select.qualify-3012"><span class="linenos">3012</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.qualify-3013"><a href="#Select.qualify-3013"><span class="linenos">3013</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.qualify-3014"><a href="#Select.qualify-3014"><span class="linenos">3014</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Select.qualify-3015"><a href="#Select.qualify-3015"><span class="linenos">3015</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.qualify-3016"><a href="#Select.qualify-3016"><span class="linenos">3016</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.qualify-3017"><a href="#Select.qualify-3017"><span class="linenos">3017</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"qualify"</span><span class="p">,</span> -</span><span id="Select.qualify-3018"><a href="#Select.qualify-3018"><span class="linenos">3018</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.qualify-3019"><a href="#Select.qualify-3019"><span class="linenos">3019</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Qualify</span><span class="p">,</span> -</span><span id="Select.qualify-3020"><a href="#Select.qualify-3020"><span class="linenos">3020</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.qualify-3021"><a href="#Select.qualify-3021"><span class="linenos">3021</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.qualify-3022"><a href="#Select.qualify-3022"><span class="linenos">3022</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.qualify-3023"><a href="#Select.qualify-3023"><span class="linenos">3023</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.qualify-3004"><a href="#Select.qualify-3004"><span class="linenos">3004</span></a> <span class="k">def</span> <span class="nf">qualify</span><span class="p">(</span> +</span><span id="Select.qualify-3005"><a href="#Select.qualify-3005"><span class="linenos">3005</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.qualify-3006"><a href="#Select.qualify-3006"><span class="linenos">3006</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</span><span class="p">],</span> +</span><span id="Select.qualify-3007"><a href="#Select.qualify-3007"><span class="linenos">3007</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.qualify-3008"><a href="#Select.qualify-3008"><span class="linenos">3008</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.qualify-3009"><a href="#Select.qualify-3009"><span class="linenos">3009</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.qualify-3010"><a href="#Select.qualify-3010"><span class="linenos">3010</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.qualify-3011"><a href="#Select.qualify-3011"><span class="linenos">3011</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.qualify-3012"><a href="#Select.qualify-3012"><span class="linenos">3012</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Select.qualify-3013"><a href="#Select.qualify-3013"><span class="linenos">3013</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.qualify-3014"><a href="#Select.qualify-3014"><span class="linenos">3014</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.qualify-3015"><a href="#Select.qualify-3015"><span class="linenos">3015</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"qualify"</span><span class="p">,</span> +</span><span id="Select.qualify-3016"><a href="#Select.qualify-3016"><span class="linenos">3016</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.qualify-3017"><a href="#Select.qualify-3017"><span class="linenos">3017</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Qualify</span><span class="p">,</span> +</span><span id="Select.qualify-3018"><a href="#Select.qualify-3018"><span class="linenos">3018</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.qualify-3019"><a href="#Select.qualify-3019"><span class="linenos">3019</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.qualify-3020"><a href="#Select.qualify-3020"><span class="linenos">3020</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.qualify-3021"><a href="#Select.qualify-3021"><span class="linenos">3021</span></a> <span class="p">)</span> </span></pre></div> @@ -34454,28 +34466,28 @@ 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-3025"><a href="#Select.distinct-3025"><span class="linenos">3025</span></a> <span class="k">def</span> <span class="nf">distinct</span><span class="p">(</span> -</span><span id="Select.distinct-3026"><a href="#Select.distinct-3026"><span class="linenos">3026</span></a> <span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">ons</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">ExpOrStr</span><span class="p">],</span> <span class="n">distinct</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><span id="Select.distinct-3027"><a href="#Select.distinct-3027"><span class="linenos">3027</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.distinct-3028"><a href="#Select.distinct-3028"><span class="linenos">3028</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.distinct-3029"><a href="#Select.distinct-3029"><span class="linenos">3029</span></a><span class="sd"> Set the OFFSET expression.</span> -</span><span id="Select.distinct-3030"><a href="#Select.distinct-3030"><span class="linenos">3030</span></a> -</span><span id="Select.distinct-3031"><a href="#Select.distinct-3031"><span class="linenos">3031</span></a><span class="sd"> Example:</span> -</span><span id="Select.distinct-3032"><a href="#Select.distinct-3032"><span class="linenos">3032</span></a><span class="sd"> >>> Select().from_("tbl").select("x").distinct().sql()</span> -</span><span id="Select.distinct-3033"><a href="#Select.distinct-3033"><span class="linenos">3033</span></a><span class="sd"> 'SELECT DISTINCT x FROM tbl'</span> -</span><span id="Select.distinct-3034"><a href="#Select.distinct-3034"><span class="linenos">3034</span></a> -</span><span id="Select.distinct-3035"><a href="#Select.distinct-3035"><span class="linenos">3035</span></a><span class="sd"> Args:</span> -</span><span id="Select.distinct-3036"><a href="#Select.distinct-3036"><span class="linenos">3036</span></a><span class="sd"> ons: the expressions to distinct on</span> -</span><span id="Select.distinct-3037"><a href="#Select.distinct-3037"><span class="linenos">3037</span></a><span class="sd"> distinct: whether the Select should be distinct</span> -</span><span id="Select.distinct-3038"><a href="#Select.distinct-3038"><span class="linenos">3038</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.distinct-3039"><a href="#Select.distinct-3039"><span class="linenos">3039</span></a> -</span><span id="Select.distinct-3040"><a href="#Select.distinct-3040"><span class="linenos">3040</span></a><span class="sd"> Returns:</span> -</span><span id="Select.distinct-3041"><a href="#Select.distinct-3041"><span class="linenos">3041</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.distinct-3042"><a href="#Select.distinct-3042"><span class="linenos">3042</span></a><span class="sd"> """</span> -</span><span id="Select.distinct-3043"><a href="#Select.distinct-3043"><span class="linenos">3043</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-3044"><a href="#Select.distinct-3044"><span class="linenos">3044</span></a> <span class="n">on</span> <span class="o">=</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">maybe_parse</span><span class="p">(</span><span class="n">on</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">on</span> <span class="ow">in</span> <span class="n">ons</span> <span class="k">if</span> <span class="n">on</span><span class="p">])</span> <span class="k">if</span> <span class="n">ons</span> <span class="k">else</span> <span class="kc">None</span> -</span><span id="Select.distinct-3045"><a href="#Select.distinct-3045"><span class="linenos">3045</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="n">on</span><span class="o">=</span><span class="n">on</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-3046"><a href="#Select.distinct-3046"><span class="linenos">3046</span></a> <span class="k">return</span> <span class="n">instance</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.distinct-3023"><a href="#Select.distinct-3023"><span class="linenos">3023</span></a> <span class="k">def</span> <span class="nf">distinct</span><span class="p">(</span> +</span><span id="Select.distinct-3024"><a href="#Select.distinct-3024"><span class="linenos">3024</span></a> <span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">ons</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">ExpOrStr</span><span class="p">],</span> <span class="n">distinct</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><span id="Select.distinct-3025"><a href="#Select.distinct-3025"><span class="linenos">3025</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.distinct-3026"><a href="#Select.distinct-3026"><span class="linenos">3026</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.distinct-3027"><a href="#Select.distinct-3027"><span class="linenos">3027</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="Select.distinct-3028"><a href="#Select.distinct-3028"><span class="linenos">3028</span></a> +</span><span id="Select.distinct-3029"><a href="#Select.distinct-3029"><span class="linenos">3029</span></a><span class="sd"> Example:</span> +</span><span id="Select.distinct-3030"><a href="#Select.distinct-3030"><span class="linenos">3030</span></a><span class="sd"> >>> Select().from_("tbl").select("x").distinct().sql()</span> +</span><span id="Select.distinct-3031"><a href="#Select.distinct-3031"><span class="linenos">3031</span></a><span class="sd"> 'SELECT DISTINCT x FROM tbl'</span> +</span><span id="Select.distinct-3032"><a href="#Select.distinct-3032"><span class="linenos">3032</span></a> +</span><span id="Select.distinct-3033"><a href="#Select.distinct-3033"><span class="linenos">3033</span></a><span class="sd"> Args:</span> +</span><span id="Select.distinct-3034"><a href="#Select.distinct-3034"><span class="linenos">3034</span></a><span class="sd"> ons: the expressions to distinct on</span> +</span><span id="Select.distinct-3035"><a href="#Select.distinct-3035"><span class="linenos">3035</span></a><span class="sd"> distinct: whether the Select should be distinct</span> +</span><span id="Select.distinct-3036"><a href="#Select.distinct-3036"><span class="linenos">3036</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.distinct-3037"><a href="#Select.distinct-3037"><span class="linenos">3037</span></a> +</span><span id="Select.distinct-3038"><a href="#Select.distinct-3038"><span class="linenos">3038</span></a><span class="sd"> Returns:</span> +</span><span id="Select.distinct-3039"><a href="#Select.distinct-3039"><span class="linenos">3039</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.distinct-3040"><a href="#Select.distinct-3040"><span class="linenos">3040</span></a><span class="sd"> """</span> +</span><span id="Select.distinct-3041"><a href="#Select.distinct-3041"><span class="linenos">3041</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-3042"><a href="#Select.distinct-3042"><span class="linenos">3042</span></a> <span class="n">on</span> <span class="o">=</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">maybe_parse</span><span class="p">(</span><span class="n">on</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> <span class="k">for</span> <span class="n">on</span> <span class="ow">in</span> <span class="n">ons</span> <span class="k">if</span> <span class="n">on</span><span class="p">])</span> <span class="k">if</span> <span class="n">ons</span> <span class="k">else</span> <span class="kc">None</span> +</span><span id="Select.distinct-3043"><a href="#Select.distinct-3043"><span class="linenos">3043</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="n">on</span><span class="o">=</span><span class="n">on</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-3044"><a href="#Select.distinct-3044"><span class="linenos">3044</span></a> <span class="k">return</span> <span class="n">instance</span> </span></pre></div> @@ -34519,49 +34531,49 @@ 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-3048"><a href="#Select.ctas-3048"><span class="linenos">3048</span></a> <span class="k">def</span> <span class="nf">ctas</span><span class="p">(</span> -</span><span id="Select.ctas-3049"><a href="#Select.ctas-3049"><span class="linenos">3049</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.ctas-3050"><a href="#Select.ctas-3050"><span class="linenos">3050</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="Select.ctas-3051"><a href="#Select.ctas-3051"><span class="linenos">3051</span></a> <span class="n">properties</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="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Select.ctas-3052"><a href="#Select.ctas-3052"><span class="linenos">3052</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.ctas-3053"><a href="#Select.ctas-3053"><span class="linenos">3053</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.ctas-3054"><a href="#Select.ctas-3054"><span class="linenos">3054</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.ctas-3055"><a href="#Select.ctas-3055"><span class="linenos">3055</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Create</span><span class="p">:</span> -</span><span id="Select.ctas-3056"><a href="#Select.ctas-3056"><span class="linenos">3056</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.ctas-3057"><a href="#Select.ctas-3057"><span class="linenos">3057</span></a><span class="sd"> Convert this expression to a CREATE TABLE AS statement.</span> -</span><span id="Select.ctas-3058"><a href="#Select.ctas-3058"><span class="linenos">3058</span></a> -</span><span id="Select.ctas-3059"><a href="#Select.ctas-3059"><span class="linenos">3059</span></a><span class="sd"> Example:</span> -</span><span id="Select.ctas-3060"><a href="#Select.ctas-3060"><span class="linenos">3060</span></a><span class="sd"> >>> Select().select("*").from_("tbl").ctas("x").sql()</span> -</span><span id="Select.ctas-3061"><a href="#Select.ctas-3061"><span class="linenos">3061</span></a><span class="sd"> 'CREATE TABLE x AS SELECT * FROM tbl'</span> -</span><span id="Select.ctas-3062"><a href="#Select.ctas-3062"><span class="linenos">3062</span></a> -</span><span id="Select.ctas-3063"><a href="#Select.ctas-3063"><span class="linenos">3063</span></a><span class="sd"> Args:</span> -</span><span id="Select.ctas-3064"><a href="#Select.ctas-3064"><span class="linenos">3064</span></a><span class="sd"> table: the SQL code string to parse as the table name.</span> -</span><span id="Select.ctas-3065"><a href="#Select.ctas-3065"><span class="linenos">3065</span></a><span class="sd"> If another `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.ctas-3066"><a href="#Select.ctas-3066"><span class="linenos">3066</span></a><span class="sd"> properties: an optional mapping of table properties</span> -</span><span id="Select.ctas-3067"><a href="#Select.ctas-3067"><span class="linenos">3067</span></a><span class="sd"> dialect: the dialect used to parse the input table.</span> -</span><span id="Select.ctas-3068"><a href="#Select.ctas-3068"><span class="linenos">3068</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.ctas-3069"><a href="#Select.ctas-3069"><span class="linenos">3069</span></a><span class="sd"> opts: other options to use to parse the input table.</span> -</span><span id="Select.ctas-3070"><a href="#Select.ctas-3070"><span class="linenos">3070</span></a> -</span><span id="Select.ctas-3071"><a href="#Select.ctas-3071"><span class="linenos">3071</span></a><span class="sd"> Returns:</span> -</span><span id="Select.ctas-3072"><a href="#Select.ctas-3072"><span class="linenos">3072</span></a><span class="sd"> The new Create expression.</span> -</span><span id="Select.ctas-3073"><a href="#Select.ctas-3073"><span class="linenos">3073</span></a><span class="sd"> """</span> -</span><span id="Select.ctas-3074"><a href="#Select.ctas-3074"><span class="linenos">3074</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-3075"><a href="#Select.ctas-3075"><span class="linenos">3075</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-3076"><a href="#Select.ctas-3076"><span class="linenos">3076</span></a> <span class="n">table</span><span class="p">,</span> -</span><span id="Select.ctas-3077"><a href="#Select.ctas-3077"><span class="linenos">3077</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-3078"><a href="#Select.ctas-3078"><span class="linenos">3078</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-3079"><a href="#Select.ctas-3079"><span class="linenos">3079</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.ctas-3080"><a href="#Select.ctas-3080"><span class="linenos">3080</span></a> <span class="p">)</span> -</span><span id="Select.ctas-3081"><a href="#Select.ctas-3081"><span class="linenos">3081</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="Select.ctas-3082"><a href="#Select.ctas-3082"><span class="linenos">3082</span></a> <span class="k">if</span> <span class="n">properties</span><span class="p">:</span> -</span><span id="Select.ctas-3083"><a href="#Select.ctas-3083"><span class="linenos">3083</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-3084"><a href="#Select.ctas-3084"><span class="linenos">3084</span></a> -</span><span id="Select.ctas-3085"><a href="#Select.ctas-3085"><span class="linenos">3085</span></a> <span class="k">return</span> <span class="n">Create</span><span class="p">(</span> -</span><span id="Select.ctas-3086"><a href="#Select.ctas-3086"><span class="linenos">3086</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-3087"><a href="#Select.ctas-3087"><span class="linenos">3087</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-3088"><a href="#Select.ctas-3088"><span class="linenos">3088</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-3089"><a href="#Select.ctas-3089"><span class="linenos">3089</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-3090"><a href="#Select.ctas-3090"><span class="linenos">3090</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.ctas-3046"><a href="#Select.ctas-3046"><span class="linenos">3046</span></a> <span class="k">def</span> <span class="nf">ctas</span><span class="p">(</span> +</span><span id="Select.ctas-3047"><a href="#Select.ctas-3047"><span class="linenos">3047</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.ctas-3048"><a href="#Select.ctas-3048"><span class="linenos">3048</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="Select.ctas-3049"><a href="#Select.ctas-3049"><span class="linenos">3049</span></a> <span class="n">properties</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="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Select.ctas-3050"><a href="#Select.ctas-3050"><span class="linenos">3050</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.ctas-3051"><a href="#Select.ctas-3051"><span class="linenos">3051</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.ctas-3052"><a href="#Select.ctas-3052"><span class="linenos">3052</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.ctas-3053"><a href="#Select.ctas-3053"><span class="linenos">3053</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Create</span><span class="p">:</span> +</span><span id="Select.ctas-3054"><a href="#Select.ctas-3054"><span class="linenos">3054</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.ctas-3055"><a href="#Select.ctas-3055"><span class="linenos">3055</span></a><span class="sd"> Convert this expression to a CREATE TABLE AS statement.</span> +</span><span id="Select.ctas-3056"><a href="#Select.ctas-3056"><span class="linenos">3056</span></a> +</span><span id="Select.ctas-3057"><a href="#Select.ctas-3057"><span class="linenos">3057</span></a><span class="sd"> Example:</span> +</span><span id="Select.ctas-3058"><a href="#Select.ctas-3058"><span class="linenos">3058</span></a><span class="sd"> >>> Select().select("*").from_("tbl").ctas("x").sql()</span> +</span><span id="Select.ctas-3059"><a href="#Select.ctas-3059"><span class="linenos">3059</span></a><span class="sd"> 'CREATE TABLE x AS SELECT * FROM tbl'</span> +</span><span id="Select.ctas-3060"><a href="#Select.ctas-3060"><span class="linenos">3060</span></a> +</span><span id="Select.ctas-3061"><a href="#Select.ctas-3061"><span class="linenos">3061</span></a><span class="sd"> Args:</span> +</span><span id="Select.ctas-3062"><a href="#Select.ctas-3062"><span class="linenos">3062</span></a><span class="sd"> table: the SQL code string to parse as the table name.</span> +</span><span id="Select.ctas-3063"><a href="#Select.ctas-3063"><span class="linenos">3063</span></a><span class="sd"> If another `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.ctas-3064"><a href="#Select.ctas-3064"><span class="linenos">3064</span></a><span class="sd"> properties: an optional mapping of table properties</span> +</span><span id="Select.ctas-3065"><a href="#Select.ctas-3065"><span class="linenos">3065</span></a><span class="sd"> dialect: the dialect used to parse the input table.</span> +</span><span id="Select.ctas-3066"><a href="#Select.ctas-3066"><span class="linenos">3066</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.ctas-3067"><a href="#Select.ctas-3067"><span class="linenos">3067</span></a><span class="sd"> opts: other options to use to parse the input table.</span> +</span><span id="Select.ctas-3068"><a href="#Select.ctas-3068"><span class="linenos">3068</span></a> +</span><span id="Select.ctas-3069"><a href="#Select.ctas-3069"><span class="linenos">3069</span></a><span class="sd"> Returns:</span> +</span><span id="Select.ctas-3070"><a href="#Select.ctas-3070"><span class="linenos">3070</span></a><span class="sd"> The new Create expression.</span> +</span><span id="Select.ctas-3071"><a href="#Select.ctas-3071"><span class="linenos">3071</span></a><span class="sd"> """</span> +</span><span id="Select.ctas-3072"><a href="#Select.ctas-3072"><span class="linenos">3072</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-3073"><a href="#Select.ctas-3073"><span class="linenos">3073</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-3074"><a href="#Select.ctas-3074"><span class="linenos">3074</span></a> <span class="n">table</span><span class="p">,</span> +</span><span id="Select.ctas-3075"><a href="#Select.ctas-3075"><span class="linenos">3075</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-3076"><a href="#Select.ctas-3076"><span class="linenos">3076</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-3077"><a href="#Select.ctas-3077"><span class="linenos">3077</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.ctas-3078"><a href="#Select.ctas-3078"><span class="linenos">3078</span></a> <span class="p">)</span> +</span><span id="Select.ctas-3079"><a href="#Select.ctas-3079"><span class="linenos">3079</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="Select.ctas-3080"><a href="#Select.ctas-3080"><span class="linenos">3080</span></a> <span class="k">if</span> <span class="n">properties</span><span class="p">:</span> +</span><span id="Select.ctas-3081"><a href="#Select.ctas-3081"><span class="linenos">3081</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-3082"><a href="#Select.ctas-3082"><span class="linenos">3082</span></a> +</span><span id="Select.ctas-3083"><a href="#Select.ctas-3083"><span class="linenos">3083</span></a> <span class="k">return</span> <span class="n">Create</span><span class="p">(</span> +</span><span id="Select.ctas-3084"><a href="#Select.ctas-3084"><span class="linenos">3084</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-3085"><a href="#Select.ctas-3085"><span class="linenos">3085</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-3086"><a href="#Select.ctas-3086"><span class="linenos">3086</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-3087"><a href="#Select.ctas-3087"><span class="linenos">3087</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-3088"><a href="#Select.ctas-3088"><span class="linenos">3088</span></a> <span class="p">)</span> </span></pre></div> @@ -34608,28 +34620,28 @@ 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-3092"><a href="#Select.lock-3092"><span class="linenos">3092</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-3093"><a href="#Select.lock-3093"><span class="linenos">3093</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.lock-3094"><a href="#Select.lock-3094"><span class="linenos">3094</span></a><span class="sd"> Set the locking read mode for this expression.</span> -</span><span id="Select.lock-3095"><a href="#Select.lock-3095"><span class="linenos">3095</span></a> -</span><span id="Select.lock-3096"><a href="#Select.lock-3096"><span class="linenos">3096</span></a><span class="sd"> Examples:</span> -</span><span id="Select.lock-3097"><a href="#Select.lock-3097"><span class="linenos">3097</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")</span> -</span><span id="Select.lock-3098"><a href="#Select.lock-3098"><span class="linenos">3098</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"</span> -</span><span id="Select.lock-3099"><a href="#Select.lock-3099"><span class="linenos">3099</span></a> -</span><span id="Select.lock-3100"><a href="#Select.lock-3100"><span class="linenos">3100</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")</span> -</span><span id="Select.lock-3101"><a href="#Select.lock-3101"><span class="linenos">3101</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"</span> -</span><span id="Select.lock-3102"><a href="#Select.lock-3102"><span class="linenos">3102</span></a> -</span><span id="Select.lock-3103"><a href="#Select.lock-3103"><span class="linenos">3103</span></a><span class="sd"> Args:</span> -</span><span id="Select.lock-3104"><a href="#Select.lock-3104"><span class="linenos">3104</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-3105"><a href="#Select.lock-3105"><span class="linenos">3105</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.lock-3106"><a href="#Select.lock-3106"><span class="linenos">3106</span></a> -</span><span id="Select.lock-3107"><a href="#Select.lock-3107"><span class="linenos">3107</span></a><span class="sd"> Returns:</span> -</span><span id="Select.lock-3108"><a href="#Select.lock-3108"><span class="linenos">3108</span></a><span class="sd"> The modified expression.</span> -</span><span id="Select.lock-3109"><a href="#Select.lock-3109"><span class="linenos">3109</span></a><span class="sd"> """</span> -</span><span id="Select.lock-3110"><a href="#Select.lock-3110"><span class="linenos">3110</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-3111"><a href="#Select.lock-3111"><span class="linenos">3111</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"locks"</span><span class="p">,</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-3112"><a href="#Select.lock-3112"><span class="linenos">3112</span></a> -</span><span id="Select.lock-3113"><a href="#Select.lock-3113"><span class="linenos">3113</span></a> <span class="k">return</span> <span class="n">inst</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.lock-3090"><a href="#Select.lock-3090"><span class="linenos">3090</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-3091"><a href="#Select.lock-3091"><span class="linenos">3091</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.lock-3092"><a href="#Select.lock-3092"><span class="linenos">3092</span></a><span class="sd"> Set the locking read mode for this expression.</span> +</span><span id="Select.lock-3093"><a href="#Select.lock-3093"><span class="linenos">3093</span></a> +</span><span id="Select.lock-3094"><a href="#Select.lock-3094"><span class="linenos">3094</span></a><span class="sd"> Examples:</span> +</span><span id="Select.lock-3095"><a href="#Select.lock-3095"><span class="linenos">3095</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")</span> +</span><span id="Select.lock-3096"><a href="#Select.lock-3096"><span class="linenos">3096</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"</span> +</span><span id="Select.lock-3097"><a href="#Select.lock-3097"><span class="linenos">3097</span></a> +</span><span id="Select.lock-3098"><a href="#Select.lock-3098"><span class="linenos">3098</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")</span> +</span><span id="Select.lock-3099"><a href="#Select.lock-3099"><span class="linenos">3099</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"</span> +</span><span id="Select.lock-3100"><a href="#Select.lock-3100"><span class="linenos">3100</span></a> +</span><span id="Select.lock-3101"><a href="#Select.lock-3101"><span class="linenos">3101</span></a><span class="sd"> Args:</span> +</span><span id="Select.lock-3102"><a href="#Select.lock-3102"><span class="linenos">3102</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-3103"><a href="#Select.lock-3103"><span class="linenos">3103</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.lock-3104"><a href="#Select.lock-3104"><span class="linenos">3104</span></a> +</span><span id="Select.lock-3105"><a href="#Select.lock-3105"><span class="linenos">3105</span></a><span class="sd"> Returns:</span> +</span><span id="Select.lock-3106"><a href="#Select.lock-3106"><span class="linenos">3106</span></a><span class="sd"> The modified expression.</span> +</span><span id="Select.lock-3107"><a href="#Select.lock-3107"><span class="linenos">3107</span></a><span class="sd"> """</span> +</span><span id="Select.lock-3108"><a href="#Select.lock-3108"><span class="linenos">3108</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-3109"><a href="#Select.lock-3109"><span class="linenos">3109</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"locks"</span><span class="p">,</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-3110"><a href="#Select.lock-3110"><span class="linenos">3110</span></a> +</span><span id="Select.lock-3111"><a href="#Select.lock-3111"><span class="linenos">3111</span></a> <span class="k">return</span> <span class="n">inst</span> </span></pre></div> @@ -34678,29 +34690,29 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Select.hint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.hint-3115"><a href="#Select.hint-3115"><span class="linenos">3115</span></a> <span class="k">def</span> <span class="nf">hint</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">hints</span><span class="p">:</span> <span class="n">ExpOrStr</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="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.hint-3116"><a href="#Select.hint-3116"><span class="linenos">3116</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.hint-3117"><a href="#Select.hint-3117"><span class="linenos">3117</span></a><span class="sd"> Set hints for this expression.</span> -</span><span id="Select.hint-3118"><a href="#Select.hint-3118"><span class="linenos">3118</span></a> -</span><span id="Select.hint-3119"><a href="#Select.hint-3119"><span class="linenos">3119</span></a><span class="sd"> Examples:</span> -</span><span id="Select.hint-3120"><a href="#Select.hint-3120"><span class="linenos">3120</span></a><span class="sd"> >>> Select().select("x").from_("tbl").hint("BROADCAST(y)").sql(dialect="spark")</span> -</span><span id="Select.hint-3121"><a href="#Select.hint-3121"><span class="linenos">3121</span></a><span class="sd"> 'SELECT /*+ BROADCAST(y) */ x FROM tbl'</span> -</span><span id="Select.hint-3122"><a href="#Select.hint-3122"><span class="linenos">3122</span></a> -</span><span id="Select.hint-3123"><a href="#Select.hint-3123"><span class="linenos">3123</span></a><span class="sd"> Args:</span> -</span><span id="Select.hint-3124"><a href="#Select.hint-3124"><span class="linenos">3124</span></a><span class="sd"> hints: The SQL code strings to parse as the hints.</span> -</span><span id="Select.hint-3125"><a href="#Select.hint-3125"><span class="linenos">3125</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.hint-3126"><a href="#Select.hint-3126"><span class="linenos">3126</span></a><span class="sd"> dialect: The dialect used to parse the hints.</span> -</span><span id="Select.hint-3127"><a href="#Select.hint-3127"><span class="linenos">3127</span></a><span class="sd"> copy: If `False`, modify this expression instance in-place.</span> -</span><span id="Select.hint-3128"><a href="#Select.hint-3128"><span class="linenos">3128</span></a> -</span><span id="Select.hint-3129"><a href="#Select.hint-3129"><span class="linenos">3129</span></a><span class="sd"> Returns:</span> -</span><span id="Select.hint-3130"><a href="#Select.hint-3130"><span class="linenos">3130</span></a><span class="sd"> The modified expression.</span> -</span><span id="Select.hint-3131"><a href="#Select.hint-3131"><span class="linenos">3131</span></a><span class="sd"> """</span> -</span><span id="Select.hint-3132"><a href="#Select.hint-3132"><span class="linenos">3132</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.hint-3133"><a href="#Select.hint-3133"><span class="linenos">3133</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="Select.hint-3134"><a href="#Select.hint-3134"><span class="linenos">3134</span></a> <span class="s2">"hint"</span><span class="p">,</span> <span class="n">Hint</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">h</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</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="k">for</span> <span class="n">h</span> <span class="ow">in</span> <span class="n">hints</span><span class="p">])</span> -</span><span id="Select.hint-3135"><a href="#Select.hint-3135"><span class="linenos">3135</span></a> <span class="p">)</span> -</span><span id="Select.hint-3136"><a href="#Select.hint-3136"><span class="linenos">3136</span></a> -</span><span id="Select.hint-3137"><a href="#Select.hint-3137"><span class="linenos">3137</span></a> <span class="k">return</span> <span class="n">inst</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.hint-3113"><a href="#Select.hint-3113"><span class="linenos">3113</span></a> <span class="k">def</span> <span class="nf">hint</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">hints</span><span class="p">:</span> <span class="n">ExpOrStr</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="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.hint-3114"><a href="#Select.hint-3114"><span class="linenos">3114</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.hint-3115"><a href="#Select.hint-3115"><span class="linenos">3115</span></a><span class="sd"> Set hints for this expression.</span> +</span><span id="Select.hint-3116"><a href="#Select.hint-3116"><span class="linenos">3116</span></a> +</span><span id="Select.hint-3117"><a href="#Select.hint-3117"><span class="linenos">3117</span></a><span class="sd"> Examples:</span> +</span><span id="Select.hint-3118"><a href="#Select.hint-3118"><span class="linenos">3118</span></a><span class="sd"> >>> Select().select("x").from_("tbl").hint("BROADCAST(y)").sql(dialect="spark")</span> +</span><span id="Select.hint-3119"><a href="#Select.hint-3119"><span class="linenos">3119</span></a><span class="sd"> 'SELECT /*+ BROADCAST(y) */ x FROM tbl'</span> +</span><span id="Select.hint-3120"><a href="#Select.hint-3120"><span class="linenos">3120</span></a> +</span><span id="Select.hint-3121"><a href="#Select.hint-3121"><span class="linenos">3121</span></a><span class="sd"> Args:</span> +</span><span id="Select.hint-3122"><a href="#Select.hint-3122"><span class="linenos">3122</span></a><span class="sd"> hints: The SQL code strings to parse as the hints.</span> +</span><span id="Select.hint-3123"><a href="#Select.hint-3123"><span class="linenos">3123</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.hint-3124"><a href="#Select.hint-3124"><span class="linenos">3124</span></a><span class="sd"> dialect: The dialect used to parse the hints.</span> +</span><span id="Select.hint-3125"><a href="#Select.hint-3125"><span class="linenos">3125</span></a><span class="sd"> copy: If `False`, modify this expression instance in-place.</span> +</span><span id="Select.hint-3126"><a href="#Select.hint-3126"><span class="linenos">3126</span></a> +</span><span id="Select.hint-3127"><a href="#Select.hint-3127"><span class="linenos">3127</span></a><span class="sd"> Returns:</span> +</span><span id="Select.hint-3128"><a href="#Select.hint-3128"><span class="linenos">3128</span></a><span class="sd"> The modified expression.</span> +</span><span id="Select.hint-3129"><a href="#Select.hint-3129"><span class="linenos">3129</span></a><span class="sd"> """</span> +</span><span id="Select.hint-3130"><a href="#Select.hint-3130"><span class="linenos">3130</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.hint-3131"><a href="#Select.hint-3131"><span class="linenos">3131</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="Select.hint-3132"><a href="#Select.hint-3132"><span class="linenos">3132</span></a> <span class="s2">"hint"</span><span class="p">,</span> <span class="n">Hint</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">h</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</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="k">for</span> <span class="n">h</span> <span class="ow">in</span> <span class="n">hints</span><span class="p">])</span> +</span><span id="Select.hint-3133"><a href="#Select.hint-3133"><span class="linenos">3133</span></a> <span class="p">)</span> +</span><span id="Select.hint-3134"><a href="#Select.hint-3134"><span class="linenos">3134</span></a> +</span><span id="Select.hint-3135"><a href="#Select.hint-3135"><span class="linenos">3135</span></a> <span class="k">return</span> <span class="n">inst</span> </span></pre></div> @@ -34859,30 +34871,30 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Subquery"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Subquery-3152"><a href="#Subquery-3152"><span class="linenos">3152</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-3153"><a href="#Subquery-3153"><span class="linenos">3153</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Subquery-3154"><a href="#Subquery-3154"><span class="linenos">3154</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Subquery-3155"><a href="#Subquery-3155"><span class="linenos">3155</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Subquery-3156"><a href="#Subquery-3156"><span class="linenos">3156</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Subquery-3157"><a href="#Subquery-3157"><span class="linenos">3157</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> -</span><span id="Subquery-3158"><a href="#Subquery-3158"><span class="linenos">3158</span></a> <span class="p">}</span> -</span><span id="Subquery-3159"><a href="#Subquery-3159"><span class="linenos">3159</span></a> -</span><span id="Subquery-3160"><a href="#Subquery-3160"><span class="linenos">3160</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-3161"><a href="#Subquery-3161"><span class="linenos">3161</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Subquery-3162"><a href="#Subquery-3162"><span class="linenos">3162</span></a><span class="sd"> Returns the first non subquery.</span> -</span><span id="Subquery-3163"><a href="#Subquery-3163"><span class="linenos">3163</span></a><span class="sd"> """</span> -</span><span id="Subquery-3164"><a href="#Subquery-3164"><span class="linenos">3164</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="Subquery-3165"><a href="#Subquery-3165"><span class="linenos">3165</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-3166"><a href="#Subquery-3166"><span class="linenos">3166</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-3167"><a href="#Subquery-3167"><span class="linenos">3167</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="Subquery-3168"><a href="#Subquery-3168"><span class="linenos">3168</span></a> -</span><span id="Subquery-3169"><a href="#Subquery-3169"><span class="linenos">3169</span></a> <span class="nd">@property</span> -</span><span id="Subquery-3170"><a href="#Subquery-3170"><span class="linenos">3170</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-3171"><a href="#Subquery-3171"><span class="linenos">3171</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-3172"><a href="#Subquery-3172"><span class="linenos">3172</span></a> -</span><span id="Subquery-3173"><a href="#Subquery-3173"><span class="linenos">3173</span></a> <span class="nd">@property</span> -</span><span id="Subquery-3174"><a href="#Subquery-3174"><span class="linenos">3174</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="Subquery-3175"><a href="#Subquery-3175"><span class="linenos">3175</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-3150"><a href="#Subquery-3150"><span class="linenos">3150</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-3151"><a href="#Subquery-3151"><span class="linenos">3151</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Subquery-3152"><a href="#Subquery-3152"><span class="linenos">3152</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Subquery-3153"><a href="#Subquery-3153"><span class="linenos">3153</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Subquery-3154"><a href="#Subquery-3154"><span class="linenos">3154</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Subquery-3155"><a href="#Subquery-3155"><span class="linenos">3155</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> +</span><span id="Subquery-3156"><a href="#Subquery-3156"><span class="linenos">3156</span></a> <span class="p">}</span> +</span><span id="Subquery-3157"><a href="#Subquery-3157"><span class="linenos">3157</span></a> +</span><span id="Subquery-3158"><a href="#Subquery-3158"><span class="linenos">3158</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-3159"><a href="#Subquery-3159"><span class="linenos">3159</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Subquery-3160"><a href="#Subquery-3160"><span class="linenos">3160</span></a><span class="sd"> Returns the first non subquery.</span> +</span><span id="Subquery-3161"><a href="#Subquery-3161"><span class="linenos">3161</span></a><span class="sd"> """</span> +</span><span id="Subquery-3162"><a href="#Subquery-3162"><span class="linenos">3162</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="Subquery-3163"><a href="#Subquery-3163"><span class="linenos">3163</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-3164"><a href="#Subquery-3164"><span class="linenos">3164</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-3165"><a href="#Subquery-3165"><span class="linenos">3165</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="Subquery-3166"><a href="#Subquery-3166"><span class="linenos">3166</span></a> +</span><span id="Subquery-3167"><a href="#Subquery-3167"><span class="linenos">3167</span></a> <span class="nd">@property</span> +</span><span id="Subquery-3168"><a href="#Subquery-3168"><span class="linenos">3168</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-3169"><a href="#Subquery-3169"><span class="linenos">3169</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-3170"><a href="#Subquery-3170"><span class="linenos">3170</span></a> +</span><span id="Subquery-3171"><a href="#Subquery-3171"><span class="linenos">3171</span></a> <span class="nd">@property</span> +</span><span id="Subquery-3172"><a href="#Subquery-3172"><span class="linenos">3172</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="Subquery-3173"><a href="#Subquery-3173"><span class="linenos">3173</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> </span></pre></div> @@ -34912,14 +34924,14 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Subquery.unnest"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Subquery.unnest-3160"><a href="#Subquery.unnest-3160"><span class="linenos">3160</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-3161"><a href="#Subquery.unnest-3161"><span class="linenos">3161</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Subquery.unnest-3162"><a href="#Subquery.unnest-3162"><span class="linenos">3162</span></a><span class="sd"> Returns the first non subquery.</span> -</span><span id="Subquery.unnest-3163"><a href="#Subquery.unnest-3163"><span class="linenos">3163</span></a><span class="sd"> """</span> -</span><span id="Subquery.unnest-3164"><a href="#Subquery.unnest-3164"><span class="linenos">3164</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="Subquery.unnest-3165"><a href="#Subquery.unnest-3165"><span class="linenos">3165</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-3166"><a href="#Subquery.unnest-3166"><span class="linenos">3166</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-3167"><a href="#Subquery.unnest-3167"><span class="linenos">3167</span></a> <span class="k">return</span> <span class="n">expression</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Subquery.unnest-3158"><a href="#Subquery.unnest-3158"><span class="linenos">3158</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-3159"><a href="#Subquery.unnest-3159"><span class="linenos">3159</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Subquery.unnest-3160"><a href="#Subquery.unnest-3160"><span class="linenos">3160</span></a><span class="sd"> Returns the first non subquery.</span> +</span><span id="Subquery.unnest-3161"><a href="#Subquery.unnest-3161"><span class="linenos">3161</span></a><span class="sd"> """</span> +</span><span id="Subquery.unnest-3162"><a href="#Subquery.unnest-3162"><span class="linenos">3162</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="Subquery.unnest-3163"><a href="#Subquery.unnest-3163"><span class="linenos">3163</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-3164"><a href="#Subquery.unnest-3164"><span class="linenos">3164</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-3165"><a href="#Subquery.unnest-3165"><span class="linenos">3165</span></a> <span class="k">return</span> <span class="n">expression</span> </span></pre></div> @@ -35059,19 +35071,19 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#TableSample"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TableSample-3178"><a href="#TableSample-3178"><span class="linenos">3178</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-3179"><a href="#TableSample-3179"><span class="linenos">3179</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="TableSample-3180"><a href="#TableSample-3180"><span class="linenos">3180</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-3181"><a href="#TableSample-3181"><span class="linenos">3181</span></a> <span class="s2">"method"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-3182"><a href="#TableSample-3182"><span class="linenos">3182</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-3183"><a href="#TableSample-3183"><span class="linenos">3183</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-3184"><a href="#TableSample-3184"><span class="linenos">3184</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-3185"><a href="#TableSample-3185"><span class="linenos">3185</span></a> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-3186"><a href="#TableSample-3186"><span class="linenos">3186</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-3187"><a href="#TableSample-3187"><span class="linenos">3187</span></a> <span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-3188"><a href="#TableSample-3188"><span class="linenos">3188</span></a> <span class="s2">"seed"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-3189"><a href="#TableSample-3189"><span class="linenos">3189</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-3190"><a href="#TableSample-3190"><span class="linenos">3190</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TableSample-3176"><a href="#TableSample-3176"><span class="linenos">3176</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-3177"><a href="#TableSample-3177"><span class="linenos">3177</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="TableSample-3178"><a href="#TableSample-3178"><span class="linenos">3178</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-3179"><a href="#TableSample-3179"><span class="linenos">3179</span></a> <span class="s2">"method"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-3180"><a href="#TableSample-3180"><span class="linenos">3180</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-3181"><a href="#TableSample-3181"><span class="linenos">3181</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-3182"><a href="#TableSample-3182"><span class="linenos">3182</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-3183"><a href="#TableSample-3183"><span class="linenos">3183</span></a> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-3184"><a href="#TableSample-3184"><span class="linenos">3184</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-3185"><a href="#TableSample-3185"><span class="linenos">3185</span></a> <span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-3186"><a href="#TableSample-3186"><span class="linenos">3186</span></a> <span class="s2">"seed"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-3187"><a href="#TableSample-3187"><span class="linenos">3187</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-3188"><a href="#TableSample-3188"><span class="linenos">3188</span></a> <span class="p">}</span> </span></pre></div> @@ -35169,14 +35181,14 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Tag"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Tag-3193"><a href="#Tag-3193"><span class="linenos">3193</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-3194"><a href="#Tag-3194"><span class="linenos">3194</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-3195"><a href="#Tag-3195"><span class="linenos">3195</span></a> -</span><span id="Tag-3196"><a href="#Tag-3196"><span class="linenos">3196</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Tag-3197"><a href="#Tag-3197"><span class="linenos">3197</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Tag-3198"><a href="#Tag-3198"><span class="linenos">3198</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Tag-3199"><a href="#Tag-3199"><span class="linenos">3199</span></a> <span class="s2">"postfix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Tag-3200"><a href="#Tag-3200"><span class="linenos">3200</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Tag-3191"><a href="#Tag-3191"><span class="linenos">3191</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-3192"><a href="#Tag-3192"><span class="linenos">3192</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-3193"><a href="#Tag-3193"><span class="linenos">3193</span></a> +</span><span id="Tag-3194"><a href="#Tag-3194"><span class="linenos">3194</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Tag-3195"><a href="#Tag-3195"><span class="linenos">3195</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Tag-3196"><a href="#Tag-3196"><span class="linenos">3196</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Tag-3197"><a href="#Tag-3197"><span class="linenos">3197</span></a> <span class="s2">"postfix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Tag-3198"><a href="#Tag-3198"><span class="linenos">3198</span></a> <span class="p">}</span> </span></pre></div> @@ -35275,17 +35287,17 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Pivot"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Pivot-3205"><a href="#Pivot-3205"><span class="linenos">3205</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-3206"><a href="#Pivot-3206"><span class="linenos">3206</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Pivot-3207"><a href="#Pivot-3207"><span class="linenos">3207</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Pivot-3208"><a href="#Pivot-3208"><span class="linenos">3208</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Pivot-3209"><a href="#Pivot-3209"><span class="linenos">3209</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Pivot-3210"><a href="#Pivot-3210"><span class="linenos">3210</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Pivot-3211"><a href="#Pivot-3211"><span class="linenos">3211</span></a> <span class="s2">"unpivot"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Pivot-3212"><a href="#Pivot-3212"><span class="linenos">3212</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Pivot-3213"><a href="#Pivot-3213"><span class="linenos">3213</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Pivot-3214"><a href="#Pivot-3214"><span class="linenos">3214</span></a> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Pivot-3215"><a href="#Pivot-3215"><span class="linenos">3215</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Pivot-3203"><a href="#Pivot-3203"><span class="linenos">3203</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-3204"><a href="#Pivot-3204"><span class="linenos">3204</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Pivot-3205"><a href="#Pivot-3205"><span class="linenos">3205</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Pivot-3206"><a href="#Pivot-3206"><span class="linenos">3206</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Pivot-3207"><a href="#Pivot-3207"><span class="linenos">3207</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Pivot-3208"><a href="#Pivot-3208"><span class="linenos">3208</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Pivot-3209"><a href="#Pivot-3209"><span class="linenos">3209</span></a> <span class="s2">"unpivot"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Pivot-3210"><a href="#Pivot-3210"><span class="linenos">3210</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Pivot-3211"><a href="#Pivot-3211"><span class="linenos">3211</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Pivot-3212"><a href="#Pivot-3212"><span class="linenos">3212</span></a> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Pivot-3213"><a href="#Pivot-3213"><span class="linenos">3213</span></a> <span class="p">}</span> </span></pre></div> @@ -35383,16 +35395,16 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Window"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Window-3218"><a href="#Window-3218"><span class="linenos">3218</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-3219"><a href="#Window-3219"><span class="linenos">3219</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Window-3220"><a href="#Window-3220"><span class="linenos">3220</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Window-3221"><a href="#Window-3221"><span class="linenos">3221</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-3222"><a href="#Window-3222"><span class="linenos">3222</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Window-3223"><a href="#Window-3223"><span class="linenos">3223</span></a> <span class="s2">"spec"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Window-3224"><a href="#Window-3224"><span class="linenos">3224</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Window-3225"><a href="#Window-3225"><span class="linenos">3225</span></a> <span class="s2">"over"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Window-3226"><a href="#Window-3226"><span class="linenos">3226</span></a> <span class="s2">"first"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Window-3227"><a href="#Window-3227"><span class="linenos">3227</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Window-3216"><a href="#Window-3216"><span class="linenos">3216</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-3217"><a href="#Window-3217"><span class="linenos">3217</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Window-3218"><a href="#Window-3218"><span class="linenos">3218</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Window-3219"><a href="#Window-3219"><span class="linenos">3219</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-3220"><a href="#Window-3220"><span class="linenos">3220</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Window-3221"><a href="#Window-3221"><span class="linenos">3221</span></a> <span class="s2">"spec"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Window-3222"><a href="#Window-3222"><span class="linenos">3222</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Window-3223"><a href="#Window-3223"><span class="linenos">3223</span></a> <span class="s2">"over"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Window-3224"><a href="#Window-3224"><span class="linenos">3224</span></a> <span class="s2">"first"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Window-3225"><a href="#Window-3225"><span class="linenos">3225</span></a> <span class="p">}</span> </span></pre></div> @@ -35490,14 +35502,14 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#WindowSpec"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="WindowSpec-3230"><a href="#WindowSpec-3230"><span class="linenos">3230</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-3231"><a href="#WindowSpec-3231"><span class="linenos">3231</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="WindowSpec-3232"><a href="#WindowSpec-3232"><span class="linenos">3232</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="WindowSpec-3233"><a href="#WindowSpec-3233"><span class="linenos">3233</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="WindowSpec-3234"><a href="#WindowSpec-3234"><span class="linenos">3234</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-3235"><a href="#WindowSpec-3235"><span class="linenos">3235</span></a> <span class="s2">"end"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="WindowSpec-3236"><a href="#WindowSpec-3236"><span class="linenos">3236</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-3237"><a href="#WindowSpec-3237"><span class="linenos">3237</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="WindowSpec-3228"><a href="#WindowSpec-3228"><span class="linenos">3228</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-3229"><a href="#WindowSpec-3229"><span class="linenos">3229</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="WindowSpec-3230"><a href="#WindowSpec-3230"><span class="linenos">3230</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="WindowSpec-3231"><a href="#WindowSpec-3231"><span class="linenos">3231</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="WindowSpec-3232"><a href="#WindowSpec-3232"><span class="linenos">3232</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-3233"><a href="#WindowSpec-3233"><span class="linenos">3233</span></a> <span class="s2">"end"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="WindowSpec-3234"><a href="#WindowSpec-3234"><span class="linenos">3234</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-3235"><a href="#WindowSpec-3235"><span class="linenos">3235</span></a> <span class="p">}</span> </span></pre></div> @@ -35594,8 +35606,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Where"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Where-3240"><a href="#Where-3240"><span class="linenos">3240</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-3241"><a href="#Where-3241"><span class="linenos">3241</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Where-3238"><a href="#Where-3238"><span class="linenos">3238</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-3239"><a href="#Where-3239"><span class="linenos">3239</span></a> <span class="k">pass</span> </span></pre></div> @@ -35681,16 +35693,16 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Star"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Star-3244"><a href="#Star-3244"><span class="linenos">3244</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-3245"><a href="#Star-3245"><span class="linenos">3245</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-3246"><a href="#Star-3246"><span class="linenos">3246</span></a> -</span><span id="Star-3247"><a href="#Star-3247"><span class="linenos">3247</span></a> <span class="nd">@property</span> -</span><span id="Star-3248"><a href="#Star-3248"><span class="linenos">3248</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-3249"><a href="#Star-3249"><span class="linenos">3249</span></a> <span class="k">return</span> <span class="s2">"*"</span> -</span><span id="Star-3250"><a href="#Star-3250"><span class="linenos">3250</span></a> -</span><span id="Star-3251"><a href="#Star-3251"><span class="linenos">3251</span></a> <span class="nd">@property</span> -</span><span id="Star-3252"><a href="#Star-3252"><span class="linenos">3252</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="Star-3253"><a href="#Star-3253"><span class="linenos">3253</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-3242"><a href="#Star-3242"><span class="linenos">3242</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-3243"><a href="#Star-3243"><span class="linenos">3243</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-3244"><a href="#Star-3244"><span class="linenos">3244</span></a> +</span><span id="Star-3245"><a href="#Star-3245"><span class="linenos">3245</span></a> <span class="nd">@property</span> +</span><span id="Star-3246"><a href="#Star-3246"><span class="linenos">3246</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-3247"><a href="#Star-3247"><span class="linenos">3247</span></a> <span class="k">return</span> <span class="s2">"*"</span> +</span><span id="Star-3248"><a href="#Star-3248"><span class="linenos">3248</span></a> +</span><span id="Star-3249"><a href="#Star-3249"><span class="linenos">3249</span></a> <span class="nd">@property</span> +</span><span id="Star-3250"><a href="#Star-3250"><span class="linenos">3250</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="Star-3251"><a href="#Star-3251"><span class="linenos">3251</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> </span></pre></div> @@ -35826,8 +35838,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Parameter"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Parameter-3256"><a href="#Parameter-3256"><span class="linenos">3256</span></a><span class="k">class</span> <span class="nc">Parameter</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="Parameter-3257"><a href="#Parameter-3257"><span class="linenos">3257</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3254"><a href="#Parameter-3254"><span class="linenos">3254</span></a><span class="k">class</span> <span class="nc">Parameter</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="Parameter-3255"><a href="#Parameter-3255"><span class="linenos">3255</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -35939,8 +35951,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#SessionParameter"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SessionParameter-3260"><a href="#SessionParameter-3260"><span class="linenos">3260</span></a><span class="k">class</span> <span class="nc">SessionParameter</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="SessionParameter-3261"><a href="#SessionParameter-3261"><span class="linenos">3261</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3258"><a href="#SessionParameter-3258"><span class="linenos">3258</span></a><span class="k">class</span> <span class="nc">SessionParameter</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="SessionParameter-3259"><a href="#SessionParameter-3259"><span class="linenos">3259</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -36052,8 +36064,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Placeholder"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Placeholder-3264"><a href="#Placeholder-3264"><span class="linenos">3264</span></a><span class="k">class</span> <span class="nc">Placeholder</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="Placeholder-3265"><a href="#Placeholder-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">False</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="Placeholder-3262"><a href="#Placeholder-3262"><span class="linenos">3262</span></a><span class="k">class</span> <span class="nc">Placeholder</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="Placeholder-3263"><a href="#Placeholder-3263"><span class="linenos">3263</span></a> <span class="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">False</span><span class="p">}</span> </span></pre></div> @@ -36165,12 +36177,12 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Null"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Null-3268"><a href="#Null-3268"><span class="linenos">3268</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-3269"><a href="#Null-3269"><span class="linenos">3269</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-3270"><a href="#Null-3270"><span class="linenos">3270</span></a> -</span><span id="Null-3271"><a href="#Null-3271"><span class="linenos">3271</span></a> <span class="nd">@property</span> -</span><span id="Null-3272"><a href="#Null-3272"><span class="linenos">3272</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-3273"><a href="#Null-3273"><span class="linenos">3273</span></a> <span class="k">return</span> <span class="s2">"NULL"</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Null-3266"><a href="#Null-3266"><span class="linenos">3266</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-3267"><a href="#Null-3267"><span class="linenos">3267</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-3268"><a href="#Null-3268"><span class="linenos">3268</span></a> +</span><span id="Null-3269"><a href="#Null-3269"><span class="linenos">3269</span></a> <span class="nd">@property</span> +</span><span id="Null-3270"><a href="#Null-3270"><span class="linenos">3270</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-3271"><a href="#Null-3271"><span class="linenos">3271</span></a> <span class="k">return</span> <span class="s2">"NULL"</span> </span></pre></div> @@ -36292,8 +36304,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Boolean"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Boolean-3276"><a href="#Boolean-3276"><span class="linenos">3276</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-3277"><a href="#Boolean-3277"><span class="linenos">3277</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Boolean-3274"><a href="#Boolean-3274"><span class="linenos">3274</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-3275"><a href="#Boolean-3275"><span class="linenos">3275</span></a> <span class="k">pass</span> </span></pre></div> @@ -36394,8 +36406,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#DataTypeSize"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DataTypeSize-3280"><a href="#DataTypeSize-3280"><span class="linenos">3280</span></a><span class="k">class</span> <span class="nc">DataTypeSize</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="DataTypeSize-3281"><a href="#DataTypeSize-3281"><span class="linenos">3281</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="DataTypeSize-3278"><a href="#DataTypeSize-3278"><span class="linenos">3278</span></a><span class="k">class</span> <span class="nc">DataTypeSize</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="DataTypeSize-3279"><a href="#DataTypeSize-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">False</span><span class="p">}</span> </span></pre></div> @@ -36492,157 +36504,157 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#DataType"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DataType-3284"><a href="#DataType-3284"><span class="linenos">3284</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-3285"><a href="#DataType-3285"><span class="linenos">3285</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="DataType-3286"><a href="#DataType-3286"><span class="linenos">3286</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="DataType-3287"><a href="#DataType-3287"><span class="linenos">3287</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataType-3288"><a href="#DataType-3288"><span class="linenos">3288</span></a> <span class="s2">"nested"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataType-3289"><a href="#DataType-3289"><span class="linenos">3289</span></a> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataType-3290"><a href="#DataType-3290"><span class="linenos">3290</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataType-3291"><a href="#DataType-3291"><span class="linenos">3291</span></a> <span class="p">}</span> -</span><span id="DataType-3292"><a href="#DataType-3292"><span class="linenos">3292</span></a> -</span><span id="DataType-3293"><a href="#DataType-3293"><span class="linenos">3293</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-3294"><a href="#DataType-3294"><span class="linenos">3294</span></a> <span class="n">ARRAY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3295"><a href="#DataType-3295"><span class="linenos">3295</span></a> <span class="n">BIGDECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3296"><a href="#DataType-3296"><span class="linenos">3296</span></a> <span class="n">BIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3297"><a href="#DataType-3297"><span class="linenos">3297</span></a> <span class="n">BIGSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3298"><a href="#DataType-3298"><span class="linenos">3298</span></a> <span class="n">BINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3299"><a href="#DataType-3299"><span class="linenos">3299</span></a> <span class="n">BIT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3300"><a href="#DataType-3300"><span class="linenos">3300</span></a> <span class="n">BOOLEAN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3301"><a href="#DataType-3301"><span class="linenos">3301</span></a> <span class="n">CHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3302"><a href="#DataType-3302"><span class="linenos">3302</span></a> <span class="n">DATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3303"><a href="#DataType-3303"><span class="linenos">3303</span></a> <span class="n">DATETIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3304"><a href="#DataType-3304"><span class="linenos">3304</span></a> <span class="n">DATETIME64</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3305"><a href="#DataType-3305"><span class="linenos">3305</span></a> <span class="n">ENUM</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3306"><a href="#DataType-3306"><span class="linenos">3306</span></a> <span class="n">INT4RANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3307"><a href="#DataType-3307"><span class="linenos">3307</span></a> <span class="n">INT4MULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3308"><a href="#DataType-3308"><span class="linenos">3308</span></a> <span class="n">INT8RANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3309"><a href="#DataType-3309"><span class="linenos">3309</span></a> <span class="n">INT8MULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3310"><a href="#DataType-3310"><span class="linenos">3310</span></a> <span class="n">NUMRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3311"><a href="#DataType-3311"><span class="linenos">3311</span></a> <span class="n">NUMMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3312"><a href="#DataType-3312"><span class="linenos">3312</span></a> <span class="n">TSRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3313"><a href="#DataType-3313"><span class="linenos">3313</span></a> <span class="n">TSMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3314"><a href="#DataType-3314"><span class="linenos">3314</span></a> <span class="n">TSTZRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3315"><a href="#DataType-3315"><span class="linenos">3315</span></a> <span class="n">TSTZMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3316"><a href="#DataType-3316"><span class="linenos">3316</span></a> <span class="n">DATERANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3317"><a href="#DataType-3317"><span class="linenos">3317</span></a> <span class="n">DATEMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3318"><a href="#DataType-3318"><span class="linenos">3318</span></a> <span class="n">DECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3319"><a href="#DataType-3319"><span class="linenos">3319</span></a> <span class="n">DOUBLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3320"><a href="#DataType-3320"><span class="linenos">3320</span></a> <span class="n">FLOAT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3321"><a href="#DataType-3321"><span class="linenos">3321</span></a> <span class="n">GEOGRAPHY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3322"><a href="#DataType-3322"><span class="linenos">3322</span></a> <span class="n">GEOMETRY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3323"><a href="#DataType-3323"><span class="linenos">3323</span></a> <span class="n">HLLSKETCH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3324"><a href="#DataType-3324"><span class="linenos">3324</span></a> <span class="n">HSTORE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3325"><a href="#DataType-3325"><span class="linenos">3325</span></a> <span class="n">IMAGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3326"><a href="#DataType-3326"><span class="linenos">3326</span></a> <span class="n">INET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3327"><a href="#DataType-3327"><span class="linenos">3327</span></a> <span class="n">INT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3328"><a href="#DataType-3328"><span class="linenos">3328</span></a> <span class="n">INT128</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3329"><a href="#DataType-3329"><span class="linenos">3329</span></a> <span class="n">INT256</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3330"><a href="#DataType-3330"><span class="linenos">3330</span></a> <span class="n">INTERVAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3331"><a href="#DataType-3331"><span class="linenos">3331</span></a> <span class="n">JSON</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3332"><a href="#DataType-3332"><span class="linenos">3332</span></a> <span class="n">JSONB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3333"><a href="#DataType-3333"><span class="linenos">3333</span></a> <span class="n">LONGBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3334"><a href="#DataType-3334"><span class="linenos">3334</span></a> <span class="n">LONGTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3335"><a href="#DataType-3335"><span class="linenos">3335</span></a> <span class="n">MAP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3336"><a href="#DataType-3336"><span class="linenos">3336</span></a> <span class="n">MEDIUMBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3337"><a href="#DataType-3337"><span class="linenos">3337</span></a> <span class="n">MEDIUMTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3338"><a href="#DataType-3338"><span class="linenos">3338</span></a> <span class="n">MONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3339"><a href="#DataType-3339"><span class="linenos">3339</span></a> <span class="n">NCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3340"><a href="#DataType-3340"><span class="linenos">3340</span></a> <span class="n">NULL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3341"><a href="#DataType-3341"><span class="linenos">3341</span></a> <span class="n">NULLABLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3342"><a href="#DataType-3342"><span class="linenos">3342</span></a> <span class="n">NVARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3343"><a href="#DataType-3343"><span class="linenos">3343</span></a> <span class="n">OBJECT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3344"><a href="#DataType-3344"><span class="linenos">3344</span></a> <span class="n">ROWVERSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3345"><a href="#DataType-3345"><span class="linenos">3345</span></a> <span class="n">SERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3346"><a href="#DataType-3346"><span class="linenos">3346</span></a> <span class="n">SET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3347"><a href="#DataType-3347"><span class="linenos">3347</span></a> <span class="n">SMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3348"><a href="#DataType-3348"><span class="linenos">3348</span></a> <span class="n">SMALLMONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3349"><a href="#DataType-3349"><span class="linenos">3349</span></a> <span class="n">SMALLSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3350"><a href="#DataType-3350"><span class="linenos">3350</span></a> <span class="n">STRUCT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3351"><a href="#DataType-3351"><span class="linenos">3351</span></a> <span class="n">SUPER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3352"><a href="#DataType-3352"><span class="linenos">3352</span></a> <span class="n">TEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3353"><a href="#DataType-3353"><span class="linenos">3353</span></a> <span class="n">TIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3354"><a href="#DataType-3354"><span class="linenos">3354</span></a> <span class="n">TIMESTAMP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3355"><a href="#DataType-3355"><span class="linenos">3355</span></a> <span class="n">TIMESTAMPTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3356"><a href="#DataType-3356"><span class="linenos">3356</span></a> <span class="n">TIMESTAMPLTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3357"><a href="#DataType-3357"><span class="linenos">3357</span></a> <span class="n">TINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3358"><a href="#DataType-3358"><span class="linenos">3358</span></a> <span class="n">UBIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3359"><a href="#DataType-3359"><span class="linenos">3359</span></a> <span class="n">UINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3360"><a href="#DataType-3360"><span class="linenos">3360</span></a> <span class="n">USMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3361"><a href="#DataType-3361"><span class="linenos">3361</span></a> <span class="n">UTINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3362"><a href="#DataType-3362"><span class="linenos">3362</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-3363"><a href="#DataType-3363"><span class="linenos">3363</span></a> <span class="n">UINT128</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3364"><a href="#DataType-3364"><span class="linenos">3364</span></a> <span class="n">UINT256</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3365"><a href="#DataType-3365"><span class="linenos">3365</span></a> <span class="n">UNIQUEIDENTIFIER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3366"><a href="#DataType-3366"><span class="linenos">3366</span></a> <span class="n">USERDEFINED</span> <span class="o">=</span> <span class="s2">"USER-DEFINED"</span> -</span><span id="DataType-3367"><a href="#DataType-3367"><span class="linenos">3367</span></a> <span class="n">UUID</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3368"><a href="#DataType-3368"><span class="linenos">3368</span></a> <span class="n">VARBINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3369"><a href="#DataType-3369"><span class="linenos">3369</span></a> <span class="n">VARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3370"><a href="#DataType-3370"><span class="linenos">3370</span></a> <span class="n">VARIANT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3371"><a href="#DataType-3371"><span class="linenos">3371</span></a> <span class="n">XML</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-3372"><a href="#DataType-3372"><span class="linenos">3372</span></a> -</span><span id="DataType-3373"><a href="#DataType-3373"><span class="linenos">3373</span></a> <span class="n">TEXT_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="DataType-3374"><a href="#DataType-3374"><span class="linenos">3374</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">,</span> -</span><span id="DataType-3375"><a href="#DataType-3375"><span class="linenos">3375</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">,</span> -</span><span id="DataType-3376"><a href="#DataType-3376"><span class="linenos">3376</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">,</span> -</span><span id="DataType-3377"><a href="#DataType-3377"><span class="linenos">3377</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">,</span> -</span><span id="DataType-3378"><a href="#DataType-3378"><span class="linenos">3378</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">,</span> -</span><span id="DataType-3379"><a href="#DataType-3379"><span class="linenos">3379</span></a> <span class="p">}</span> -</span><span id="DataType-3380"><a href="#DataType-3380"><span class="linenos">3380</span></a> -</span><span id="DataType-3381"><a href="#DataType-3381"><span class="linenos">3381</span></a> <span class="n">INTEGER_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="DataType-3382"><a href="#DataType-3382"><span class="linenos">3382</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">,</span> -</span><span id="DataType-3383"><a href="#DataType-3383"><span class="linenos">3383</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">,</span> -</span><span id="DataType-3384"><a href="#DataType-3384"><span class="linenos">3384</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">,</span> -</span><span id="DataType-3385"><a href="#DataType-3385"><span class="linenos">3385</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span> -</span><span id="DataType-3386"><a href="#DataType-3386"><span class="linenos">3386</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT128</span><span class="p">,</span> -</span><span id="DataType-3387"><a href="#DataType-3387"><span class="linenos">3387</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT256</span><span class="p">,</span> -</span><span id="DataType-3388"><a href="#DataType-3388"><span class="linenos">3388</span></a> <span class="p">}</span> -</span><span id="DataType-3389"><a href="#DataType-3389"><span class="linenos">3389</span></a> -</span><span id="DataType-3390"><a href="#DataType-3390"><span class="linenos">3390</span></a> <span class="n">FLOAT_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="DataType-3391"><a href="#DataType-3391"><span class="linenos">3391</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">,</span> -</span><span id="DataType-3392"><a href="#DataType-3392"><span class="linenos">3392</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span> -</span><span id="DataType-3393"><a href="#DataType-3393"><span class="linenos">3393</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DataType-3282"><a href="#DataType-3282"><span class="linenos">3282</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-3283"><a href="#DataType-3283"><span class="linenos">3283</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="DataType-3284"><a href="#DataType-3284"><span class="linenos">3284</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="DataType-3285"><a href="#DataType-3285"><span class="linenos">3285</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataType-3286"><a href="#DataType-3286"><span class="linenos">3286</span></a> <span class="s2">"nested"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataType-3287"><a href="#DataType-3287"><span class="linenos">3287</span></a> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataType-3288"><a href="#DataType-3288"><span class="linenos">3288</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataType-3289"><a href="#DataType-3289"><span class="linenos">3289</span></a> <span class="p">}</span> +</span><span id="DataType-3290"><a href="#DataType-3290"><span class="linenos">3290</span></a> +</span><span id="DataType-3291"><a href="#DataType-3291"><span class="linenos">3291</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-3292"><a href="#DataType-3292"><span class="linenos">3292</span></a> <span class="n">ARRAY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3293"><a href="#DataType-3293"><span class="linenos">3293</span></a> <span class="n">BIGDECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3294"><a href="#DataType-3294"><span class="linenos">3294</span></a> <span class="n">BIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3295"><a href="#DataType-3295"><span class="linenos">3295</span></a> <span class="n">BIGSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3296"><a href="#DataType-3296"><span class="linenos">3296</span></a> <span class="n">BINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3297"><a href="#DataType-3297"><span class="linenos">3297</span></a> <span class="n">BIT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3298"><a href="#DataType-3298"><span class="linenos">3298</span></a> <span class="n">BOOLEAN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3299"><a href="#DataType-3299"><span class="linenos">3299</span></a> <span class="n">CHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3300"><a href="#DataType-3300"><span class="linenos">3300</span></a> <span class="n">DATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3301"><a href="#DataType-3301"><span class="linenos">3301</span></a> <span class="n">DATETIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3302"><a href="#DataType-3302"><span class="linenos">3302</span></a> <span class="n">DATETIME64</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3303"><a href="#DataType-3303"><span class="linenos">3303</span></a> <span class="n">ENUM</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3304"><a href="#DataType-3304"><span class="linenos">3304</span></a> <span class="n">INT4RANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3305"><a href="#DataType-3305"><span class="linenos">3305</span></a> <span class="n">INT4MULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3306"><a href="#DataType-3306"><span class="linenos">3306</span></a> <span class="n">INT8RANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3307"><a href="#DataType-3307"><span class="linenos">3307</span></a> <span class="n">INT8MULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3308"><a href="#DataType-3308"><span class="linenos">3308</span></a> <span class="n">NUMRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3309"><a href="#DataType-3309"><span class="linenos">3309</span></a> <span class="n">NUMMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3310"><a href="#DataType-3310"><span class="linenos">3310</span></a> <span class="n">TSRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3311"><a href="#DataType-3311"><span class="linenos">3311</span></a> <span class="n">TSMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3312"><a href="#DataType-3312"><span class="linenos">3312</span></a> <span class="n">TSTZRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3313"><a href="#DataType-3313"><span class="linenos">3313</span></a> <span class="n">TSTZMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3314"><a href="#DataType-3314"><span class="linenos">3314</span></a> <span class="n">DATERANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3315"><a href="#DataType-3315"><span class="linenos">3315</span></a> <span class="n">DATEMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3316"><a href="#DataType-3316"><span class="linenos">3316</span></a> <span class="n">DECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3317"><a href="#DataType-3317"><span class="linenos">3317</span></a> <span class="n">DOUBLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3318"><a href="#DataType-3318"><span class="linenos">3318</span></a> <span class="n">FLOAT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3319"><a href="#DataType-3319"><span class="linenos">3319</span></a> <span class="n">GEOGRAPHY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3320"><a href="#DataType-3320"><span class="linenos">3320</span></a> <span class="n">GEOMETRY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3321"><a href="#DataType-3321"><span class="linenos">3321</span></a> <span class="n">HLLSKETCH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3322"><a href="#DataType-3322"><span class="linenos">3322</span></a> <span class="n">HSTORE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3323"><a href="#DataType-3323"><span class="linenos">3323</span></a> <span class="n">IMAGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3324"><a href="#DataType-3324"><span class="linenos">3324</span></a> <span class="n">INET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3325"><a href="#DataType-3325"><span class="linenos">3325</span></a> <span class="n">INT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3326"><a href="#DataType-3326"><span class="linenos">3326</span></a> <span class="n">INT128</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3327"><a href="#DataType-3327"><span class="linenos">3327</span></a> <span class="n">INT256</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3328"><a href="#DataType-3328"><span class="linenos">3328</span></a> <span class="n">INTERVAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3329"><a href="#DataType-3329"><span class="linenos">3329</span></a> <span class="n">JSON</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3330"><a href="#DataType-3330"><span class="linenos">3330</span></a> <span class="n">JSONB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3331"><a href="#DataType-3331"><span class="linenos">3331</span></a> <span class="n">LONGBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3332"><a href="#DataType-3332"><span class="linenos">3332</span></a> <span class="n">LONGTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3333"><a href="#DataType-3333"><span class="linenos">3333</span></a> <span class="n">MAP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3334"><a href="#DataType-3334"><span class="linenos">3334</span></a> <span class="n">MEDIUMBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3335"><a href="#DataType-3335"><span class="linenos">3335</span></a> <span class="n">MEDIUMTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3336"><a href="#DataType-3336"><span class="linenos">3336</span></a> <span class="n">MONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3337"><a href="#DataType-3337"><span class="linenos">3337</span></a> <span class="n">NCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3338"><a href="#DataType-3338"><span class="linenos">3338</span></a> <span class="n">NULL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3339"><a href="#DataType-3339"><span class="linenos">3339</span></a> <span class="n">NULLABLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3340"><a href="#DataType-3340"><span class="linenos">3340</span></a> <span class="n">NVARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3341"><a href="#DataType-3341"><span class="linenos">3341</span></a> <span class="n">OBJECT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3342"><a href="#DataType-3342"><span class="linenos">3342</span></a> <span class="n">ROWVERSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3343"><a href="#DataType-3343"><span class="linenos">3343</span></a> <span class="n">SERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3344"><a href="#DataType-3344"><span class="linenos">3344</span></a> <span class="n">SET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3345"><a href="#DataType-3345"><span class="linenos">3345</span></a> <span class="n">SMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3346"><a href="#DataType-3346"><span class="linenos">3346</span></a> <span class="n">SMALLMONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3347"><a href="#DataType-3347"><span class="linenos">3347</span></a> <span class="n">SMALLSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3348"><a href="#DataType-3348"><span class="linenos">3348</span></a> <span class="n">STRUCT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3349"><a href="#DataType-3349"><span class="linenos">3349</span></a> <span class="n">SUPER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3350"><a href="#DataType-3350"><span class="linenos">3350</span></a> <span class="n">TEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3351"><a href="#DataType-3351"><span class="linenos">3351</span></a> <span class="n">TIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3352"><a href="#DataType-3352"><span class="linenos">3352</span></a> <span class="n">TIMESTAMP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3353"><a href="#DataType-3353"><span class="linenos">3353</span></a> <span class="n">TIMESTAMPTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3354"><a href="#DataType-3354"><span class="linenos">3354</span></a> <span class="n">TIMESTAMPLTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3355"><a href="#DataType-3355"><span class="linenos">3355</span></a> <span class="n">TINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3356"><a href="#DataType-3356"><span class="linenos">3356</span></a> <span class="n">UBIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3357"><a href="#DataType-3357"><span class="linenos">3357</span></a> <span class="n">UINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3358"><a href="#DataType-3358"><span class="linenos">3358</span></a> <span class="n">USMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3359"><a href="#DataType-3359"><span class="linenos">3359</span></a> <span class="n">UTINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3360"><a href="#DataType-3360"><span class="linenos">3360</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-3361"><a href="#DataType-3361"><span class="linenos">3361</span></a> <span class="n">UINT128</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3362"><a href="#DataType-3362"><span class="linenos">3362</span></a> <span class="n">UINT256</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3363"><a href="#DataType-3363"><span class="linenos">3363</span></a> <span class="n">UNIQUEIDENTIFIER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3364"><a href="#DataType-3364"><span class="linenos">3364</span></a> <span class="n">USERDEFINED</span> <span class="o">=</span> <span class="s2">"USER-DEFINED"</span> +</span><span id="DataType-3365"><a href="#DataType-3365"><span class="linenos">3365</span></a> <span class="n">UUID</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3366"><a href="#DataType-3366"><span class="linenos">3366</span></a> <span class="n">VARBINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3367"><a href="#DataType-3367"><span class="linenos">3367</span></a> <span class="n">VARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3368"><a href="#DataType-3368"><span class="linenos">3368</span></a> <span class="n">VARIANT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3369"><a href="#DataType-3369"><span class="linenos">3369</span></a> <span class="n">XML</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-3370"><a href="#DataType-3370"><span class="linenos">3370</span></a> +</span><span id="DataType-3371"><a href="#DataType-3371"><span class="linenos">3371</span></a> <span class="n">TEXT_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="DataType-3372"><a href="#DataType-3372"><span class="linenos">3372</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">,</span> +</span><span id="DataType-3373"><a href="#DataType-3373"><span class="linenos">3373</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">,</span> +</span><span id="DataType-3374"><a href="#DataType-3374"><span class="linenos">3374</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">,</span> +</span><span id="DataType-3375"><a href="#DataType-3375"><span class="linenos">3375</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">,</span> +</span><span id="DataType-3376"><a href="#DataType-3376"><span class="linenos">3376</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">,</span> +</span><span id="DataType-3377"><a href="#DataType-3377"><span class="linenos">3377</span></a> <span class="p">}</span> +</span><span id="DataType-3378"><a href="#DataType-3378"><span class="linenos">3378</span></a> +</span><span id="DataType-3379"><a href="#DataType-3379"><span class="linenos">3379</span></a> <span class="n">INTEGER_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="DataType-3380"><a href="#DataType-3380"><span class="linenos">3380</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">,</span> +</span><span id="DataType-3381"><a href="#DataType-3381"><span class="linenos">3381</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">,</span> +</span><span id="DataType-3382"><a href="#DataType-3382"><span class="linenos">3382</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">,</span> +</span><span id="DataType-3383"><a href="#DataType-3383"><span class="linenos">3383</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span> +</span><span id="DataType-3384"><a href="#DataType-3384"><span class="linenos">3384</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT128</span><span class="p">,</span> +</span><span id="DataType-3385"><a href="#DataType-3385"><span class="linenos">3385</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT256</span><span class="p">,</span> +</span><span id="DataType-3386"><a href="#DataType-3386"><span class="linenos">3386</span></a> <span class="p">}</span> +</span><span id="DataType-3387"><a href="#DataType-3387"><span class="linenos">3387</span></a> +</span><span id="DataType-3388"><a href="#DataType-3388"><span class="linenos">3388</span></a> <span class="n">FLOAT_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="DataType-3389"><a href="#DataType-3389"><span class="linenos">3389</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">,</span> +</span><span id="DataType-3390"><a href="#DataType-3390"><span class="linenos">3390</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span> +</span><span id="DataType-3391"><a href="#DataType-3391"><span class="linenos">3391</span></a> <span class="p">}</span> +</span><span id="DataType-3392"><a href="#DataType-3392"><span class="linenos">3392</span></a> +</span><span id="DataType-3393"><a href="#DataType-3393"><span class="linenos">3393</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-3394"><a href="#DataType-3394"><span class="linenos">3394</span></a> -</span><span id="DataType-3395"><a href="#DataType-3395"><span class="linenos">3395</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-3396"><a href="#DataType-3396"><span class="linenos">3396</span></a> -</span><span id="DataType-3397"><a href="#DataType-3397"><span class="linenos">3397</span></a> <span class="n">TEMPORAL_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="DataType-3398"><a href="#DataType-3398"><span class="linenos">3398</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIME</span><span class="p">,</span> -</span><span id="DataType-3399"><a href="#DataType-3399"><span class="linenos">3399</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">,</span> -</span><span id="DataType-3400"><a href="#DataType-3400"><span class="linenos">3400</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">,</span> -</span><span id="DataType-3401"><a href="#DataType-3401"><span class="linenos">3401</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPLTZ</span><span class="p">,</span> -</span><span id="DataType-3402"><a href="#DataType-3402"><span class="linenos">3402</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATE</span><span class="p">,</span> -</span><span id="DataType-3403"><a href="#DataType-3403"><span class="linenos">3403</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATETIME</span><span class="p">,</span> -</span><span id="DataType-3404"><a href="#DataType-3404"><span class="linenos">3404</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATETIME64</span><span class="p">,</span> -</span><span id="DataType-3405"><a href="#DataType-3405"><span class="linenos">3405</span></a> <span class="p">}</span> +</span><span id="DataType-3395"><a href="#DataType-3395"><span class="linenos">3395</span></a> <span class="n">TEMPORAL_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="DataType-3396"><a href="#DataType-3396"><span class="linenos">3396</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIME</span><span class="p">,</span> +</span><span id="DataType-3397"><a href="#DataType-3397"><span class="linenos">3397</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">,</span> +</span><span id="DataType-3398"><a href="#DataType-3398"><span class="linenos">3398</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">,</span> +</span><span id="DataType-3399"><a href="#DataType-3399"><span class="linenos">3399</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPLTZ</span><span class="p">,</span> +</span><span id="DataType-3400"><a href="#DataType-3400"><span class="linenos">3400</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATE</span><span class="p">,</span> +</span><span id="DataType-3401"><a href="#DataType-3401"><span class="linenos">3401</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATETIME</span><span class="p">,</span> +</span><span id="DataType-3402"><a href="#DataType-3402"><span class="linenos">3402</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATETIME64</span><span class="p">,</span> +</span><span id="DataType-3403"><a href="#DataType-3403"><span class="linenos">3403</span></a> <span class="p">}</span> +</span><span id="DataType-3404"><a href="#DataType-3404"><span class="linenos">3404</span></a> +</span><span id="DataType-3405"><a href="#DataType-3405"><span class="linenos">3405</span></a> <span class="n">META_TYPES</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"UNKNOWN"</span><span class="p">,</span> <span class="s2">"NULL"</span><span class="p">}</span> </span><span id="DataType-3406"><a href="#DataType-3406"><span class="linenos">3406</span></a> -</span><span id="DataType-3407"><a href="#DataType-3407"><span class="linenos">3407</span></a> <span class="n">META_TYPES</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"UNKNOWN"</span><span class="p">,</span> <span class="s2">"NULL"</span><span class="p">}</span> -</span><span id="DataType-3408"><a href="#DataType-3408"><span class="linenos">3408</span></a> -</span><span id="DataType-3409"><a href="#DataType-3409"><span class="linenos">3409</span></a> <span class="nd">@classmethod</span> -</span><span id="DataType-3410"><a href="#DataType-3410"><span class="linenos">3410</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span> -</span><span id="DataType-3411"><a href="#DataType-3411"><span class="linenos">3411</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-3412"><a href="#DataType-3412"><span class="linenos">3412</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">DataType</span><span class="p">:</span> -</span><span id="DataType-3413"><a href="#DataType-3413"><span class="linenos">3413</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-3414"><a href="#DataType-3414"><span class="linenos">3414</span></a> -</span><span id="DataType-3415"><a href="#DataType-3415"><span class="linenos">3415</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-3416"><a href="#DataType-3416"><span class="linenos">3416</span></a> <span class="n">upper</span> <span class="o">=</span> <span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="DataType-3417"><a href="#DataType-3417"><span class="linenos">3417</span></a> <span class="k">if</span> <span class="n">upper</span> <span class="ow">in</span> <span class="n">DataType</span><span class="o">.</span><span class="n">META_TYPES</span><span class="p">:</span> -</span><span id="DataType-3418"><a href="#DataType-3418"><span class="linenos">3418</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">upper</span><span class="p">])</span> -</span><span id="DataType-3419"><a href="#DataType-3419"><span class="linenos">3419</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="DataType-3420"><a href="#DataType-3420"><span class="linenos">3420</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-3421"><a href="#DataType-3421"><span class="linenos">3421</span></a> -</span><span id="DataType-3422"><a href="#DataType-3422"><span class="linenos">3422</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-3423"><a href="#DataType-3423"><span class="linenos">3423</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-3424"><a href="#DataType-3424"><span class="linenos">3424</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-3425"><a href="#DataType-3425"><span class="linenos">3425</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-3426"><a href="#DataType-3426"><span class="linenos">3426</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-3427"><a href="#DataType-3427"><span class="linenos">3427</span></a> <span class="k">return</span> <span class="n">dtype</span> -</span><span id="DataType-3428"><a href="#DataType-3428"><span class="linenos">3428</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="DataType-3429"><a href="#DataType-3429"><span class="linenos">3429</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-3407"><a href="#DataType-3407"><span class="linenos">3407</span></a> <span class="nd">@classmethod</span> +</span><span id="DataType-3408"><a href="#DataType-3408"><span class="linenos">3408</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span> +</span><span id="DataType-3409"><a href="#DataType-3409"><span class="linenos">3409</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-3410"><a href="#DataType-3410"><span class="linenos">3410</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">DataType</span><span class="p">:</span> +</span><span id="DataType-3411"><a href="#DataType-3411"><span class="linenos">3411</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-3412"><a href="#DataType-3412"><span class="linenos">3412</span></a> +</span><span id="DataType-3413"><a href="#DataType-3413"><span class="linenos">3413</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-3414"><a href="#DataType-3414"><span class="linenos">3414</span></a> <span class="n">upper</span> <span class="o">=</span> <span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="DataType-3415"><a href="#DataType-3415"><span class="linenos">3415</span></a> <span class="k">if</span> <span class="n">upper</span> <span class="ow">in</span> <span class="n">DataType</span><span class="o">.</span><span class="n">META_TYPES</span><span class="p">:</span> +</span><span id="DataType-3416"><a href="#DataType-3416"><span class="linenos">3416</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">upper</span><span class="p">])</span> +</span><span id="DataType-3417"><a href="#DataType-3417"><span class="linenos">3417</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="DataType-3418"><a href="#DataType-3418"><span class="linenos">3418</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-3419"><a href="#DataType-3419"><span class="linenos">3419</span></a> +</span><span id="DataType-3420"><a href="#DataType-3420"><span class="linenos">3420</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-3421"><a href="#DataType-3421"><span class="linenos">3421</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-3422"><a href="#DataType-3422"><span class="linenos">3422</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-3423"><a href="#DataType-3423"><span class="linenos">3423</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-3424"><a href="#DataType-3424"><span class="linenos">3424</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-3425"><a href="#DataType-3425"><span class="linenos">3425</span></a> <span class="k">return</span> <span class="n">dtype</span> +</span><span id="DataType-3426"><a href="#DataType-3426"><span class="linenos">3426</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="DataType-3427"><a href="#DataType-3427"><span class="linenos">3427</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-3428"><a href="#DataType-3428"><span class="linenos">3428</span></a> +</span><span id="DataType-3429"><a href="#DataType-3429"><span class="linenos">3429</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-3430"><a href="#DataType-3430"><span class="linenos">3430</span></a> -</span><span id="DataType-3431"><a href="#DataType-3431"><span class="linenos">3431</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-3432"><a href="#DataType-3432"><span class="linenos">3432</span></a> -</span><span id="DataType-3433"><a href="#DataType-3433"><span class="linenos">3433</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="o">*</span><span class="n">dtypes</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="nb">bool</span><span class="p">:</span> -</span><span id="DataType-3434"><a href="#DataType-3434"><span class="linenos">3434</span></a> <span class="k">return</span> <span class="nb">any</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">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 class="o">.</span><span class="n">this</span> <span class="k">for</span> <span class="n">dtype</span> <span class="ow">in</span> <span class="n">dtypes</span><span class="p">)</span> +</span><span id="DataType-3431"><a href="#DataType-3431"><span class="linenos">3431</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="o">*</span><span class="n">dtypes</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="nb">bool</span><span class="p">:</span> +</span><span id="DataType-3432"><a href="#DataType-3432"><span class="linenos">3432</span></a> <span class="k">return</span> <span class="nb">any</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">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 class="o">.</span><span class="n">this</span> <span class="k">for</span> <span class="n">dtype</span> <span class="ow">in</span> <span class="n">dtypes</span><span class="p">)</span> </span></pre></div> @@ -36664,7 +36676,7 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w <div class="attr variable"> <span class="name">TEXT_TYPES</span> = <input id="DataType.TEXT_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> - <label class="view-value-button pdoc-button" for="DataType.TEXT_TYPES-view-value"></label><span class="default_value">{<Type.NVARCHAR: 'NVARCHAR'>, <Type.VARCHAR: 'VARCHAR'>, <Type.TEXT: 'TEXT'>, <Type.CHAR: 'CHAR'>, <Type.NCHAR: 'NCHAR'>}</span> + <label class="view-value-button pdoc-button" for="DataType.TEXT_TYPES-view-value"></label><span class="default_value">{<Type.TEXT: 'TEXT'>, <Type.NVARCHAR: 'NVARCHAR'>, <Type.CHAR: 'CHAR'>, <Type.NCHAR: 'NCHAR'>, <Type.VARCHAR: 'VARCHAR'>}</span> </div> @@ -36677,7 +36689,7 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w <div class="attr variable"> <span class="name">INTEGER_TYPES</span> = <input id="DataType.INTEGER_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> - <label class="view-value-button pdoc-button" for="DataType.INTEGER_TYPES-view-value"></label><span class="default_value">{<Type.INT: 'INT'>, <Type.SMALLINT: 'SMALLINT'>, <Type.INT128: 'INT128'>, <Type.TINYINT: 'TINYINT'>, <Type.INT256: 'INT256'>, <Type.BIGINT: 'BIGINT'>}</span> + <label class="view-value-button pdoc-button" for="DataType.INTEGER_TYPES-view-value"></label><span class="default_value">{<Type.INT256: 'INT256'>, <Type.TINYINT: 'TINYINT'>, <Type.BIGINT: 'BIGINT'>, <Type.INT: 'INT'>, <Type.INT128: 'INT128'>, <Type.SMALLINT: 'SMALLINT'>}</span> </div> @@ -36702,7 +36714,7 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w <div class="attr variable"> <span class="name">NUMERIC_TYPES</span> = <input id="DataType.NUMERIC_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> - <label class="view-value-button pdoc-button" for="DataType.NUMERIC_TYPES-view-value"></label><span class="default_value">{<Type.INT: 'INT'>, <Type.SMALLINT: 'SMALLINT'>, <Type.INT128: 'INT128'>, <Type.TINYINT: 'TINYINT'>, <Type.FLOAT: 'FLOAT'>, <Type.INT256: 'INT256'>, <Type.BIGINT: 'BIGINT'>, <Type.DOUBLE: 'DOUBLE'>}</span> + <label class="view-value-button pdoc-button" for="DataType.NUMERIC_TYPES-view-value"></label><span class="default_value">{<Type.SMALLINT: 'SMALLINT'>, <Type.FLOAT: 'FLOAT'>, <Type.DOUBLE: 'DOUBLE'>, <Type.INT256: 'INT256'>, <Type.INT: 'INT'>, <Type.INT128: 'INT128'>, <Type.BIGINT: 'BIGINT'>, <Type.TINYINT: 'TINYINT'>}</span> </div> @@ -36715,7 +36727,7 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w <div class="attr variable"> <span class="name">TEMPORAL_TYPES</span> = <input id="DataType.TEMPORAL_TYPES-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> - <label class="view-value-button pdoc-button" for="DataType.TEMPORAL_TYPES-view-value"></label><span class="default_value">{<Type.TIMESTAMP: 'TIMESTAMP'>, <Type.DATETIME64: 'DATETIME64'>, <Type.DATE: 'DATE'>, <Type.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <Type.TIME: 'TIME'>, <Type.DATETIME: 'DATETIME'>, <Type.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>}</span> + <label class="view-value-button pdoc-button" for="DataType.TEMPORAL_TYPES-view-value"></label><span class="default_value">{<Type.DATE: 'DATE'>, <Type.DATETIME64: 'DATETIME64'>, <Type.DATETIME: 'DATETIME'>, <Type.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <Type.TIME: 'TIME'>, <Type.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <Type.TIMESTAMP: 'TIMESTAMP'>}</span> </div> @@ -36748,29 +36760,29 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#DataType.build"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DataType.build-3409"><a href="#DataType.build-3409"><span class="linenos">3409</span></a> <span class="nd">@classmethod</span> -</span><span id="DataType.build-3410"><a href="#DataType.build-3410"><span class="linenos">3410</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span> -</span><span id="DataType.build-3411"><a href="#DataType.build-3411"><span class="linenos">3411</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-3412"><a href="#DataType.build-3412"><span class="linenos">3412</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">DataType</span><span class="p">:</span> -</span><span id="DataType.build-3413"><a href="#DataType.build-3413"><span class="linenos">3413</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-3414"><a href="#DataType.build-3414"><span class="linenos">3414</span></a> -</span><span id="DataType.build-3415"><a href="#DataType.build-3415"><span class="linenos">3415</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-3416"><a href="#DataType.build-3416"><span class="linenos">3416</span></a> <span class="n">upper</span> <span class="o">=</span> <span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="DataType.build-3417"><a href="#DataType.build-3417"><span class="linenos">3417</span></a> <span class="k">if</span> <span class="n">upper</span> <span class="ow">in</span> <span class="n">DataType</span><span class="o">.</span><span class="n">META_TYPES</span><span class="p">:</span> -</span><span id="DataType.build-3418"><a href="#DataType.build-3418"><span class="linenos">3418</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">upper</span><span class="p">])</span> -</span><span id="DataType.build-3419"><a href="#DataType.build-3419"><span class="linenos">3419</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="DataType.build-3420"><a href="#DataType.build-3420"><span class="linenos">3420</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-3421"><a href="#DataType.build-3421"><span class="linenos">3421</span></a> -</span><span id="DataType.build-3422"><a href="#DataType.build-3422"><span class="linenos">3422</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-3423"><a href="#DataType.build-3423"><span class="linenos">3423</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-3424"><a href="#DataType.build-3424"><span class="linenos">3424</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-3425"><a href="#DataType.build-3425"><span class="linenos">3425</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-3426"><a href="#DataType.build-3426"><span class="linenos">3426</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-3427"><a href="#DataType.build-3427"><span class="linenos">3427</span></a> <span class="k">return</span> <span class="n">dtype</span> -</span><span id="DataType.build-3428"><a href="#DataType.build-3428"><span class="linenos">3428</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="DataType.build-3429"><a href="#DataType.build-3429"><span class="linenos">3429</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-3430"><a href="#DataType.build-3430"><span class="linenos">3430</span></a> -</span><span id="DataType.build-3431"><a href="#DataType.build-3431"><span class="linenos">3431</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-3407"><a href="#DataType.build-3407"><span class="linenos">3407</span></a> <span class="nd">@classmethod</span> +</span><span id="DataType.build-3408"><a href="#DataType.build-3408"><span class="linenos">3408</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span> +</span><span id="DataType.build-3409"><a href="#DataType.build-3409"><span class="linenos">3409</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-3410"><a href="#DataType.build-3410"><span class="linenos">3410</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">DataType</span><span class="p">:</span> +</span><span id="DataType.build-3411"><a href="#DataType.build-3411"><span class="linenos">3411</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-3412"><a href="#DataType.build-3412"><span class="linenos">3412</span></a> +</span><span id="DataType.build-3413"><a href="#DataType.build-3413"><span class="linenos">3413</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-3414"><a href="#DataType.build-3414"><span class="linenos">3414</span></a> <span class="n">upper</span> <span class="o">=</span> <span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="DataType.build-3415"><a href="#DataType.build-3415"><span class="linenos">3415</span></a> <span class="k">if</span> <span class="n">upper</span> <span class="ow">in</span> <span class="n">DataType</span><span class="o">.</span><span class="n">META_TYPES</span><span class="p">:</span> +</span><span id="DataType.build-3416"><a href="#DataType.build-3416"><span class="linenos">3416</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">upper</span><span class="p">])</span> +</span><span id="DataType.build-3417"><a href="#DataType.build-3417"><span class="linenos">3417</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="DataType.build-3418"><a href="#DataType.build-3418"><span class="linenos">3418</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-3419"><a href="#DataType.build-3419"><span class="linenos">3419</span></a> +</span><span id="DataType.build-3420"><a href="#DataType.build-3420"><span class="linenos">3420</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-3421"><a href="#DataType.build-3421"><span class="linenos">3421</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-3422"><a href="#DataType.build-3422"><span class="linenos">3422</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-3423"><a href="#DataType.build-3423"><span class="linenos">3423</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-3424"><a href="#DataType.build-3424"><span class="linenos">3424</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-3425"><a href="#DataType.build-3425"><span class="linenos">3425</span></a> <span class="k">return</span> <span class="n">dtype</span> +</span><span id="DataType.build-3426"><a href="#DataType.build-3426"><span class="linenos">3426</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="DataType.build-3427"><a href="#DataType.build-3427"><span class="linenos">3427</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-3428"><a href="#DataType.build-3428"><span class="linenos">3428</span></a> +</span><span id="DataType.build-3429"><a href="#DataType.build-3429"><span class="linenos">3429</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> @@ -36788,8 +36800,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#DataType.is_type"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DataType.is_type-3433"><a href="#DataType.is_type-3433"><span class="linenos">3433</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="o">*</span><span class="n">dtypes</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="nb">bool</span><span class="p">:</span> -</span><span id="DataType.is_type-3434"><a href="#DataType.is_type-3434"><span class="linenos">3434</span></a> <span class="k">return</span> <span class="nb">any</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">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 class="o">.</span><span class="n">this</span> <span class="k">for</span> <span class="n">dtype</span> <span class="ow">in</span> <span class="n">dtypes</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DataType.is_type-3431"><a href="#DataType.is_type-3431"><span class="linenos">3431</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="o">*</span><span class="n">dtypes</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="nb">bool</span><span class="p">:</span> +</span><span id="DataType.is_type-3432"><a href="#DataType.is_type-3432"><span class="linenos">3432</span></a> <span class="k">return</span> <span class="nb">any</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">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 class="o">.</span><span class="n">this</span> <span class="k">for</span> <span class="n">dtype</span> <span class="ow">in</span> <span class="n">dtypes</span><span class="p">)</span> </span></pre></div> @@ -36875,85 +36887,85 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#DataType.Type"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DataType.Type-3293"><a href="#DataType.Type-3293"><span class="linenos">3293</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-3294"><a href="#DataType.Type-3294"><span class="linenos">3294</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-3295"><a href="#DataType.Type-3295"><span class="linenos">3295</span></a> <span class="n">BIGDECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3296"><a href="#DataType.Type-3296"><span class="linenos">3296</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-3297"><a href="#DataType.Type-3297"><span class="linenos">3297</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-3298"><a href="#DataType.Type-3298"><span class="linenos">3298</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-3299"><a href="#DataType.Type-3299"><span class="linenos">3299</span></a> <span class="n">BIT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3300"><a href="#DataType.Type-3300"><span class="linenos">3300</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-3301"><a href="#DataType.Type-3301"><span class="linenos">3301</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-3302"><a href="#DataType.Type-3302"><span class="linenos">3302</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-3303"><a href="#DataType.Type-3303"><span class="linenos">3303</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-3304"><a href="#DataType.Type-3304"><span class="linenos">3304</span></a> <span class="n">DATETIME64</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3305"><a href="#DataType.Type-3305"><span class="linenos">3305</span></a> <span class="n">ENUM</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3306"><a href="#DataType.Type-3306"><span class="linenos">3306</span></a> <span class="n">INT4RANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3307"><a href="#DataType.Type-3307"><span class="linenos">3307</span></a> <span class="n">INT4MULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3308"><a href="#DataType.Type-3308"><span class="linenos">3308</span></a> <span class="n">INT8RANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3309"><a href="#DataType.Type-3309"><span class="linenos">3309</span></a> <span class="n">INT8MULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3310"><a href="#DataType.Type-3310"><span class="linenos">3310</span></a> <span class="n">NUMRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3311"><a href="#DataType.Type-3311"><span class="linenos">3311</span></a> <span class="n">NUMMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3312"><a href="#DataType.Type-3312"><span class="linenos">3312</span></a> <span class="n">TSRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3313"><a href="#DataType.Type-3313"><span class="linenos">3313</span></a> <span class="n">TSMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3314"><a href="#DataType.Type-3314"><span class="linenos">3314</span></a> <span class="n">TSTZRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3315"><a href="#DataType.Type-3315"><span class="linenos">3315</span></a> <span class="n">TSTZMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3316"><a href="#DataType.Type-3316"><span class="linenos">3316</span></a> <span class="n">DATERANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3317"><a href="#DataType.Type-3317"><span class="linenos">3317</span></a> <span class="n">DATEMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3318"><a href="#DataType.Type-3318"><span class="linenos">3318</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-3319"><a href="#DataType.Type-3319"><span class="linenos">3319</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-3320"><a href="#DataType.Type-3320"><span class="linenos">3320</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-3321"><a href="#DataType.Type-3321"><span class="linenos">3321</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-3322"><a href="#DataType.Type-3322"><span class="linenos">3322</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-3323"><a href="#DataType.Type-3323"><span class="linenos">3323</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-3324"><a href="#DataType.Type-3324"><span class="linenos">3324</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-3325"><a href="#DataType.Type-3325"><span class="linenos">3325</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-3326"><a href="#DataType.Type-3326"><span class="linenos">3326</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-3327"><a href="#DataType.Type-3327"><span class="linenos">3327</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-3328"><a href="#DataType.Type-3328"><span class="linenos">3328</span></a> <span class="n">INT128</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3329"><a href="#DataType.Type-3329"><span class="linenos">3329</span></a> <span class="n">INT256</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3330"><a href="#DataType.Type-3330"><span class="linenos">3330</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-3331"><a href="#DataType.Type-3331"><span class="linenos">3331</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-3332"><a href="#DataType.Type-3332"><span class="linenos">3332</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-3333"><a href="#DataType.Type-3333"><span class="linenos">3333</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-3334"><a href="#DataType.Type-3334"><span class="linenos">3334</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-3335"><a href="#DataType.Type-3335"><span class="linenos">3335</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-3336"><a href="#DataType.Type-3336"><span class="linenos">3336</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-3337"><a href="#DataType.Type-3337"><span class="linenos">3337</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-3338"><a href="#DataType.Type-3338"><span class="linenos">3338</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-3339"><a href="#DataType.Type-3339"><span class="linenos">3339</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-3340"><a href="#DataType.Type-3340"><span class="linenos">3340</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-3341"><a href="#DataType.Type-3341"><span class="linenos">3341</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-3342"><a href="#DataType.Type-3342"><span class="linenos">3342</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-3343"><a href="#DataType.Type-3343"><span class="linenos">3343</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-3344"><a href="#DataType.Type-3344"><span class="linenos">3344</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-3345"><a href="#DataType.Type-3345"><span class="linenos">3345</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-3346"><a href="#DataType.Type-3346"><span class="linenos">3346</span></a> <span class="n">SET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3347"><a href="#DataType.Type-3347"><span class="linenos">3347</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-3348"><a href="#DataType.Type-3348"><span class="linenos">3348</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-3349"><a href="#DataType.Type-3349"><span class="linenos">3349</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-3350"><a href="#DataType.Type-3350"><span class="linenos">3350</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-3351"><a href="#DataType.Type-3351"><span class="linenos">3351</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-3352"><a href="#DataType.Type-3352"><span class="linenos">3352</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-3353"><a href="#DataType.Type-3353"><span class="linenos">3353</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-3354"><a href="#DataType.Type-3354"><span class="linenos">3354</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-3355"><a href="#DataType.Type-3355"><span class="linenos">3355</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-3356"><a href="#DataType.Type-3356"><span class="linenos">3356</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-3357"><a href="#DataType.Type-3357"><span class="linenos">3357</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-3358"><a href="#DataType.Type-3358"><span class="linenos">3358</span></a> <span class="n">UBIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3359"><a href="#DataType.Type-3359"><span class="linenos">3359</span></a> <span class="n">UINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3360"><a href="#DataType.Type-3360"><span class="linenos">3360</span></a> <span class="n">USMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3361"><a href="#DataType.Type-3361"><span class="linenos">3361</span></a> <span class="n">UTINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3362"><a href="#DataType.Type-3362"><span class="linenos">3362</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.Type-3363"><a href="#DataType.Type-3363"><span class="linenos">3363</span></a> <span class="n">UINT128</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3364"><a href="#DataType.Type-3364"><span class="linenos">3364</span></a> <span class="n">UINT256</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-3365"><a href="#DataType.Type-3365"><span class="linenos">3365</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-3366"><a href="#DataType.Type-3366"><span class="linenos">3366</span></a> <span class="n">USERDEFINED</span> <span class="o">=</span> <span class="s2">"USER-DEFINED"</span> -</span><span id="DataType.Type-3367"><a href="#DataType.Type-3367"><span class="linenos">3367</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-3368"><a href="#DataType.Type-3368"><span class="linenos">3368</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-3369"><a href="#DataType.Type-3369"><span class="linenos">3369</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-3370"><a href="#DataType.Type-3370"><span class="linenos">3370</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-3371"><a href="#DataType.Type-3371"><span class="linenos">3371</span></a> <span class="n">XML</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DataType.Type-3291"><a href="#DataType.Type-3291"><span class="linenos">3291</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-3292"><a href="#DataType.Type-3292"><span class="linenos">3292</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-3293"><a href="#DataType.Type-3293"><span class="linenos">3293</span></a> <span class="n">BIGDECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3294"><a href="#DataType.Type-3294"><span class="linenos">3294</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-3295"><a href="#DataType.Type-3295"><span class="linenos">3295</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-3296"><a href="#DataType.Type-3296"><span class="linenos">3296</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-3297"><a href="#DataType.Type-3297"><span class="linenos">3297</span></a> <span class="n">BIT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3298"><a href="#DataType.Type-3298"><span class="linenos">3298</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-3299"><a href="#DataType.Type-3299"><span class="linenos">3299</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-3300"><a href="#DataType.Type-3300"><span class="linenos">3300</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-3301"><a href="#DataType.Type-3301"><span class="linenos">3301</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-3302"><a href="#DataType.Type-3302"><span class="linenos">3302</span></a> <span class="n">DATETIME64</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3303"><a href="#DataType.Type-3303"><span class="linenos">3303</span></a> <span class="n">ENUM</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3304"><a href="#DataType.Type-3304"><span class="linenos">3304</span></a> <span class="n">INT4RANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3305"><a href="#DataType.Type-3305"><span class="linenos">3305</span></a> <span class="n">INT4MULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3306"><a href="#DataType.Type-3306"><span class="linenos">3306</span></a> <span class="n">INT8RANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3307"><a href="#DataType.Type-3307"><span class="linenos">3307</span></a> <span class="n">INT8MULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3308"><a href="#DataType.Type-3308"><span class="linenos">3308</span></a> <span class="n">NUMRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3309"><a href="#DataType.Type-3309"><span class="linenos">3309</span></a> <span class="n">NUMMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3310"><a href="#DataType.Type-3310"><span class="linenos">3310</span></a> <span class="n">TSRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3311"><a href="#DataType.Type-3311"><span class="linenos">3311</span></a> <span class="n">TSMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3312"><a href="#DataType.Type-3312"><span class="linenos">3312</span></a> <span class="n">TSTZRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3313"><a href="#DataType.Type-3313"><span class="linenos">3313</span></a> <span class="n">TSTZMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3314"><a href="#DataType.Type-3314"><span class="linenos">3314</span></a> <span class="n">DATERANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3315"><a href="#DataType.Type-3315"><span class="linenos">3315</span></a> <span class="n">DATEMULTIRANGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3316"><a href="#DataType.Type-3316"><span class="linenos">3316</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-3317"><a href="#DataType.Type-3317"><span class="linenos">3317</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-3318"><a href="#DataType.Type-3318"><span class="linenos">3318</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-3319"><a href="#DataType.Type-3319"><span class="linenos">3319</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-3320"><a href="#DataType.Type-3320"><span class="linenos">3320</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-3321"><a href="#DataType.Type-3321"><span class="linenos">3321</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-3322"><a href="#DataType.Type-3322"><span class="linenos">3322</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-3323"><a href="#DataType.Type-3323"><span class="linenos">3323</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-3324"><a href="#DataType.Type-3324"><span class="linenos">3324</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-3325"><a href="#DataType.Type-3325"><span class="linenos">3325</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-3326"><a href="#DataType.Type-3326"><span class="linenos">3326</span></a> <span class="n">INT128</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3327"><a href="#DataType.Type-3327"><span class="linenos">3327</span></a> <span class="n">INT256</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3328"><a href="#DataType.Type-3328"><span class="linenos">3328</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-3329"><a href="#DataType.Type-3329"><span class="linenos">3329</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-3330"><a href="#DataType.Type-3330"><span class="linenos">3330</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-3331"><a href="#DataType.Type-3331"><span class="linenos">3331</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-3332"><a href="#DataType.Type-3332"><span class="linenos">3332</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-3333"><a href="#DataType.Type-3333"><span class="linenos">3333</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-3334"><a href="#DataType.Type-3334"><span class="linenos">3334</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-3335"><a href="#DataType.Type-3335"><span class="linenos">3335</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-3336"><a href="#DataType.Type-3336"><span class="linenos">3336</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-3337"><a href="#DataType.Type-3337"><span class="linenos">3337</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-3338"><a href="#DataType.Type-3338"><span class="linenos">3338</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-3339"><a href="#DataType.Type-3339"><span class="linenos">3339</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-3340"><a href="#DataType.Type-3340"><span class="linenos">3340</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-3341"><a href="#DataType.Type-3341"><span class="linenos">3341</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-3342"><a href="#DataType.Type-3342"><span class="linenos">3342</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-3343"><a href="#DataType.Type-3343"><span class="linenos">3343</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-3344"><a href="#DataType.Type-3344"><span class="linenos">3344</span></a> <span class="n">SET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3345"><a href="#DataType.Type-3345"><span class="linenos">3345</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-3346"><a href="#DataType.Type-3346"><span class="linenos">3346</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-3347"><a href="#DataType.Type-3347"><span class="linenos">3347</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-3348"><a href="#DataType.Type-3348"><span class="linenos">3348</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-3349"><a href="#DataType.Type-3349"><span class="linenos">3349</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-3350"><a href="#DataType.Type-3350"><span class="linenos">3350</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-3351"><a href="#DataType.Type-3351"><span class="linenos">3351</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-3352"><a href="#DataType.Type-3352"><span class="linenos">3352</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-3353"><a href="#DataType.Type-3353"><span class="linenos">3353</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-3354"><a href="#DataType.Type-3354"><span class="linenos">3354</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-3355"><a href="#DataType.Type-3355"><span class="linenos">3355</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-3356"><a href="#DataType.Type-3356"><span class="linenos">3356</span></a> <span class="n">UBIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3357"><a href="#DataType.Type-3357"><span class="linenos">3357</span></a> <span class="n">UINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3358"><a href="#DataType.Type-3358"><span class="linenos">3358</span></a> <span class="n">USMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3359"><a href="#DataType.Type-3359"><span class="linenos">3359</span></a> <span class="n">UTINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3360"><a href="#DataType.Type-3360"><span class="linenos">3360</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.Type-3361"><a href="#DataType.Type-3361"><span class="linenos">3361</span></a> <span class="n">UINT128</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3362"><a href="#DataType.Type-3362"><span class="linenos">3362</span></a> <span class="n">UINT256</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-3363"><a href="#DataType.Type-3363"><span class="linenos">3363</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-3364"><a href="#DataType.Type-3364"><span class="linenos">3364</span></a> <span class="n">USERDEFINED</span> <span class="o">=</span> <span class="s2">"USER-DEFINED"</span> +</span><span id="DataType.Type-3365"><a href="#DataType.Type-3365"><span class="linenos">3365</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-3366"><a href="#DataType.Type-3366"><span class="linenos">3366</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-3367"><a href="#DataType.Type-3367"><span class="linenos">3367</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-3368"><a href="#DataType.Type-3368"><span class="linenos">3368</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-3369"><a href="#DataType.Type-3369"><span class="linenos">3369</span></a> <span class="n">XML</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> </span></pre></div> @@ -37919,8 +37931,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#PseudoType"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="PseudoType-3438"><a href="#PseudoType-3438"><span class="linenos">3438</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-3439"><a href="#PseudoType-3439"><span class="linenos">3439</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="PseudoType-3436"><a href="#PseudoType-3436"><span class="linenos">3436</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-3437"><a href="#PseudoType-3437"><span class="linenos">3437</span></a> <span class="k">pass</span> </span></pre></div> @@ -38006,8 +38018,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#SubqueryPredicate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SubqueryPredicate-3443"><a href="#SubqueryPredicate-3443"><span class="linenos">3443</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-3444"><a href="#SubqueryPredicate-3444"><span class="linenos">3444</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SubqueryPredicate-3441"><a href="#SubqueryPredicate-3441"><span class="linenos">3441</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-3442"><a href="#SubqueryPredicate-3442"><span class="linenos">3442</span></a> <span class="k">pass</span> </span></pre></div> @@ -38108,8 +38120,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#All"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="All-3447"><a href="#All-3447"><span class="linenos">3447</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-3448"><a href="#All-3448"><span class="linenos">3448</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="All-3445"><a href="#All-3445"><span class="linenos">3445</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-3446"><a href="#All-3446"><span class="linenos">3446</span></a> <span class="k">pass</span> </span></pre></div> @@ -38210,8 +38222,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Any"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Any-3451"><a href="#Any-3451"><span class="linenos">3451</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-3452"><a href="#Any-3452"><span class="linenos">3452</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Any-3449"><a href="#Any-3449"><span class="linenos">3449</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-3450"><a href="#Any-3450"><span class="linenos">3450</span></a> <span class="k">pass</span> </span></pre></div> @@ -38312,8 +38324,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Exists"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Exists-3455"><a href="#Exists-3455"><span class="linenos">3455</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-3456"><a href="#Exists-3456"><span class="linenos">3456</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Exists-3453"><a href="#Exists-3453"><span class="linenos">3453</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-3454"><a href="#Exists-3454"><span class="linenos">3454</span></a> <span class="k">pass</span> </span></pre></div> @@ -38414,8 +38426,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Command"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Command-3461"><a href="#Command-3461"><span class="linenos">3461</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-3462"><a href="#Command-3462"><span class="linenos">3462</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3459"><a href="#Command-3459"><span class="linenos">3459</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-3460"><a href="#Command-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> @@ -38512,8 +38524,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Transaction"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Transaction-3465"><a href="#Transaction-3465"><span class="linenos">3465</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-3466"><a href="#Transaction-3466"><span class="linenos">3466</span></a> <span class="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-3463"><a href="#Transaction-3463"><span class="linenos">3463</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-3464"><a href="#Transaction-3464"><span class="linenos">3464</span></a> <span class="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> @@ -38610,8 +38622,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Commit"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Commit-3469"><a href="#Commit-3469"><span class="linenos">3469</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-3470"><a href="#Commit-3470"><span class="linenos">3470</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-3467"><a href="#Commit-3467"><span class="linenos">3467</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-3468"><a href="#Commit-3468"><span class="linenos">3468</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> @@ -38708,8 +38720,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Rollback"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Rollback-3473"><a href="#Rollback-3473"><span class="linenos">3473</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-3474"><a href="#Rollback-3474"><span class="linenos">3474</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-3471"><a href="#Rollback-3471"><span class="linenos">3471</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-3472"><a href="#Rollback-3472"><span class="linenos">3472</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> @@ -38806,8 +38818,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#AlterTable"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AlterTable-3477"><a href="#AlterTable-3477"><span class="linenos">3477</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-3478"><a href="#AlterTable-3478"><span class="linenos">3478</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3475"><a href="#AlterTable-3475"><span class="linenos">3475</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-3476"><a href="#AlterTable-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">"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> @@ -38904,8 +38916,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#AddConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AddConstraint-3481"><a href="#AddConstraint-3481"><span class="linenos">3481</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-3482"><a href="#AddConstraint-3482"><span class="linenos">3482</span></a> <span class="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-3479"><a href="#AddConstraint-3479"><span class="linenos">3479</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-3480"><a href="#AddConstraint-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">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> @@ -39002,8 +39014,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#DropPartition"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DropPartition-3485"><a href="#DropPartition-3485"><span class="linenos">3485</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-3486"><a href="#DropPartition-3486"><span class="linenos">3486</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-3483"><a href="#DropPartition-3483"><span class="linenos">3483</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-3484"><a href="#DropPartition-3484"><span class="linenos">3484</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> @@ -39100,16 +39112,16 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Binary"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Binary-3490"><a href="#Binary-3490"><span class="linenos">3490</span></a><span class="k">class</span> <span class="nc">Binary</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="Binary-3491"><a href="#Binary-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="Binary-3492"><a href="#Binary-3492"><span class="linenos">3492</span></a> -</span><span id="Binary-3493"><a href="#Binary-3493"><span class="linenos">3493</span></a> <span class="nd">@property</span> -</span><span id="Binary-3494"><a href="#Binary-3494"><span class="linenos">3494</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-3495"><a href="#Binary-3495"><span class="linenos">3495</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-3496"><a href="#Binary-3496"><span class="linenos">3496</span></a> -</span><span id="Binary-3497"><a href="#Binary-3497"><span class="linenos">3497</span></a> <span class="nd">@property</span> -</span><span id="Binary-3498"><a href="#Binary-3498"><span class="linenos">3498</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-3499"><a href="#Binary-3499"><span class="linenos">3499</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-3488"><a href="#Binary-3488"><span class="linenos">3488</span></a><span class="k">class</span> <span class="nc">Binary</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="Binary-3489"><a href="#Binary-3489"><span class="linenos">3489</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3490"><a href="#Binary-3490"><span class="linenos">3490</span></a> +</span><span id="Binary-3491"><a href="#Binary-3491"><span class="linenos">3491</span></a> <span class="nd">@property</span> +</span><span id="Binary-3492"><a href="#Binary-3492"><span class="linenos">3492</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-3493"><a href="#Binary-3493"><span class="linenos">3493</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-3494"><a href="#Binary-3494"><span class="linenos">3494</span></a> +</span><span id="Binary-3495"><a href="#Binary-3495"><span class="linenos">3495</span></a> <span class="nd">@property</span> +</span><span id="Binary-3496"><a href="#Binary-3496"><span class="linenos">3496</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-3497"><a href="#Binary-3497"><span class="linenos">3497</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span> </span></pre></div> @@ -39243,8 +39255,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Add"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Add-3502"><a href="#Add-3502"><span class="linenos">3502</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-3503"><a href="#Add-3503"><span class="linenos">3503</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Add-3500"><a href="#Add-3500"><span class="linenos">3500</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-3501"><a href="#Add-3501"><span class="linenos">3501</span></a> <span class="k">pass</span> </span></pre></div> @@ -39350,8 +39362,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Connector"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Connector-3506"><a href="#Connector-3506"><span class="linenos">3506</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><span id="Connector-3507"><a href="#Connector-3507"><span class="linenos">3507</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Connector-3504"><a href="#Connector-3504"><span class="linenos">3504</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><span id="Connector-3505"><a href="#Connector-3505"><span class="linenos">3505</span></a> <span class="k">pass</span> </span></pre></div> @@ -39457,8 +39469,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#And"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="And-3510"><a href="#And-3510"><span class="linenos">3510</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-3511"><a href="#And-3511"><span class="linenos">3511</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="And-3508"><a href="#And-3508"><span class="linenos">3508</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-3509"><a href="#And-3509"><span class="linenos">3509</span></a> <span class="k">pass</span> </span></pre></div> @@ -39564,8 +39576,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Or"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Or-3514"><a href="#Or-3514"><span class="linenos">3514</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-3515"><a href="#Or-3515"><span class="linenos">3515</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Or-3512"><a href="#Or-3512"><span class="linenos">3512</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-3513"><a href="#Or-3513"><span class="linenos">3513</span></a> <span class="k">pass</span> </span></pre></div> @@ -39671,8 +39683,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#BitwiseAnd"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseAnd-3518"><a href="#BitwiseAnd-3518"><span class="linenos">3518</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-3519"><a href="#BitwiseAnd-3519"><span class="linenos">3519</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseAnd-3516"><a href="#BitwiseAnd-3516"><span class="linenos">3516</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-3517"><a href="#BitwiseAnd-3517"><span class="linenos">3517</span></a> <span class="k">pass</span> </span></pre></div> @@ -39778,8 +39790,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#BitwiseLeftShift"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseLeftShift-3522"><a href="#BitwiseLeftShift-3522"><span class="linenos">3522</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-3523"><a href="#BitwiseLeftShift-3523"><span class="linenos">3523</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseLeftShift-3520"><a href="#BitwiseLeftShift-3520"><span class="linenos">3520</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-3521"><a href="#BitwiseLeftShift-3521"><span class="linenos">3521</span></a> <span class="k">pass</span> </span></pre></div> @@ -39885,8 +39897,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#BitwiseOr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseOr-3526"><a href="#BitwiseOr-3526"><span class="linenos">3526</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-3527"><a href="#BitwiseOr-3527"><span class="linenos">3527</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseOr-3524"><a href="#BitwiseOr-3524"><span class="linenos">3524</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-3525"><a href="#BitwiseOr-3525"><span class="linenos">3525</span></a> <span class="k">pass</span> </span></pre></div> @@ -39992,8 +40004,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#BitwiseRightShift"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseRightShift-3530"><a href="#BitwiseRightShift-3530"><span class="linenos">3530</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-3531"><a href="#BitwiseRightShift-3531"><span class="linenos">3531</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseRightShift-3528"><a href="#BitwiseRightShift-3528"><span class="linenos">3528</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-3529"><a href="#BitwiseRightShift-3529"><span class="linenos">3529</span></a> <span class="k">pass</span> </span></pre></div> @@ -40099,8 +40111,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#BitwiseXor"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseXor-3534"><a href="#BitwiseXor-3534"><span class="linenos">3534</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-3535"><a href="#BitwiseXor-3535"><span class="linenos">3535</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseXor-3532"><a href="#BitwiseXor-3532"><span class="linenos">3532</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-3533"><a href="#BitwiseXor-3533"><span class="linenos">3533</span></a> <span class="k">pass</span> </span></pre></div> @@ -40206,8 +40218,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Div"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Div-3538"><a href="#Div-3538"><span class="linenos">3538</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-3539"><a href="#Div-3539"><span class="linenos">3539</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Div-3536"><a href="#Div-3536"><span class="linenos">3536</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-3537"><a href="#Div-3537"><span class="linenos">3537</span></a> <span class="k">pass</span> </span></pre></div> @@ -40313,8 +40325,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Overlaps"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Overlaps-3542"><a href="#Overlaps-3542"><span class="linenos">3542</span></a><span class="k">class</span> <span class="nc">Overlaps</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="Overlaps-3543"><a href="#Overlaps-3543"><span class="linenos">3543</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Overlaps-3540"><a href="#Overlaps-3540"><span class="linenos">3540</span></a><span class="k">class</span> <span class="nc">Overlaps</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="Overlaps-3541"><a href="#Overlaps-3541"><span class="linenos">3541</span></a> <span class="k">pass</span> </span></pre></div> @@ -40420,28 +40432,28 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Dot"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Dot-3546"><a href="#Dot-3546"><span class="linenos">3546</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-3547"><a href="#Dot-3547"><span class="linenos">3547</span></a> <span class="nd">@property</span> -</span><span id="Dot-3548"><a href="#Dot-3548"><span class="linenos">3548</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-3549"><a href="#Dot-3549"><span class="linenos">3549</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="Dot-3550"><a href="#Dot-3550"><span class="linenos">3550</span></a> -</span><span id="Dot-3551"><a href="#Dot-3551"><span class="linenos">3551</span></a> <span class="nd">@property</span> -</span><span id="Dot-3552"><a href="#Dot-3552"><span class="linenos">3552</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="Dot-3553"><a href="#Dot-3553"><span class="linenos">3553</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> -</span><span id="Dot-3554"><a href="#Dot-3554"><span class="linenos">3554</span></a> -</span><span id="Dot-3555"><a href="#Dot-3555"><span class="linenos">3555</span></a> <span class="nd">@classmethod</span> -</span><span id="Dot-3556"><a href="#Dot-3556"><span class="linenos">3556</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expressions</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="n">Expression</span><span class="p">])</span> <span class="o">-></span> <span class="n">Dot</span><span class="p">:</span> -</span><span id="Dot-3557"><a href="#Dot-3557"><span class="linenos">3557</span></a><span class="w"> </span><span class="sd">"""Build a Dot object with a sequence of expressions."""</span> -</span><span id="Dot-3558"><a href="#Dot-3558"><span class="linenos">3558</span></a> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">expressions</span><span class="p">)</span> <span class="o"><</span> <span class="mi">2</span><span class="p">:</span> -</span><span id="Dot-3559"><a href="#Dot-3559"><span class="linenos">3559</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Dot requires >= 2 expressions."</span><span class="p">)</span> -</span><span id="Dot-3560"><a href="#Dot-3560"><span class="linenos">3560</span></a> -</span><span id="Dot-3561"><a href="#Dot-3561"><span class="linenos">3561</span></a> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span> <span class="o">=</span> <span class="n">expressions</span> -</span><span id="Dot-3562"><a href="#Dot-3562"><span class="linenos">3562</span></a> <span class="n">dot</span> <span class="o">=</span> <span class="n">Dot</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">a</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">b</span><span class="p">)</span> -</span><span id="Dot-3563"><a href="#Dot-3563"><span class="linenos">3563</span></a> -</span><span id="Dot-3564"><a href="#Dot-3564"><span class="linenos">3564</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="Dot-3565"><a href="#Dot-3565"><span class="linenos">3565</span></a> <span class="n">dot</span> <span class="o">=</span> <span class="n">Dot</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">dot</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> -</span><span id="Dot-3566"><a href="#Dot-3566"><span class="linenos">3566</span></a> -</span><span id="Dot-3567"><a href="#Dot-3567"><span class="linenos">3567</span></a> <span class="k">return</span> <span class="n">dot</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Dot-3544"><a href="#Dot-3544"><span class="linenos">3544</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-3545"><a href="#Dot-3545"><span class="linenos">3545</span></a> <span class="nd">@property</span> +</span><span id="Dot-3546"><a href="#Dot-3546"><span class="linenos">3546</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-3547"><a href="#Dot-3547"><span class="linenos">3547</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="Dot-3548"><a href="#Dot-3548"><span class="linenos">3548</span></a> +</span><span id="Dot-3549"><a href="#Dot-3549"><span class="linenos">3549</span></a> <span class="nd">@property</span> +</span><span id="Dot-3550"><a href="#Dot-3550"><span class="linenos">3550</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="Dot-3551"><a href="#Dot-3551"><span class="linenos">3551</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> +</span><span id="Dot-3552"><a href="#Dot-3552"><span class="linenos">3552</span></a> +</span><span id="Dot-3553"><a href="#Dot-3553"><span class="linenos">3553</span></a> <span class="nd">@classmethod</span> +</span><span id="Dot-3554"><a href="#Dot-3554"><span class="linenos">3554</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expressions</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="n">Expression</span><span class="p">])</span> <span class="o">-></span> <span class="n">Dot</span><span class="p">:</span> +</span><span id="Dot-3555"><a href="#Dot-3555"><span class="linenos">3555</span></a><span class="w"> </span><span class="sd">"""Build a Dot object with a sequence of expressions."""</span> +</span><span id="Dot-3556"><a href="#Dot-3556"><span class="linenos">3556</span></a> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">expressions</span><span class="p">)</span> <span class="o"><</span> <span class="mi">2</span><span class="p">:</span> +</span><span id="Dot-3557"><a href="#Dot-3557"><span class="linenos">3557</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Dot requires >= 2 expressions."</span><span class="p">)</span> +</span><span id="Dot-3558"><a href="#Dot-3558"><span class="linenos">3558</span></a> +</span><span id="Dot-3559"><a href="#Dot-3559"><span class="linenos">3559</span></a> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span> <span class="o">=</span> <span class="n">expressions</span> +</span><span id="Dot-3560"><a href="#Dot-3560"><span class="linenos">3560</span></a> <span class="n">dot</span> <span class="o">=</span> <span class="n">Dot</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">a</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">b</span><span class="p">)</span> +</span><span id="Dot-3561"><a href="#Dot-3561"><span class="linenos">3561</span></a> +</span><span id="Dot-3562"><a href="#Dot-3562"><span class="linenos">3562</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="Dot-3563"><a href="#Dot-3563"><span class="linenos">3563</span></a> <span class="n">dot</span> <span class="o">=</span> <span class="n">Dot</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">dot</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> +</span><span id="Dot-3564"><a href="#Dot-3564"><span class="linenos">3564</span></a> +</span><span id="Dot-3565"><a href="#Dot-3565"><span class="linenos">3565</span></a> <span class="k">return</span> <span class="n">dot</span> </span></pre></div> @@ -40500,19 +40512,19 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Dot.build"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Dot.build-3555"><a href="#Dot.build-3555"><span class="linenos">3555</span></a> <span class="nd">@classmethod</span> -</span><span id="Dot.build-3556"><a href="#Dot.build-3556"><span class="linenos">3556</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expressions</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="n">Expression</span><span class="p">])</span> <span class="o">-></span> <span class="n">Dot</span><span class="p">:</span> -</span><span id="Dot.build-3557"><a href="#Dot.build-3557"><span class="linenos">3557</span></a><span class="w"> </span><span class="sd">"""Build a Dot object with a sequence of expressions."""</span> -</span><span id="Dot.build-3558"><a href="#Dot.build-3558"><span class="linenos">3558</span></a> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">expressions</span><span class="p">)</span> <span class="o"><</span> <span class="mi">2</span><span class="p">:</span> -</span><span id="Dot.build-3559"><a href="#Dot.build-3559"><span class="linenos">3559</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Dot requires >= 2 expressions."</span><span class="p">)</span> -</span><span id="Dot.build-3560"><a href="#Dot.build-3560"><span class="linenos">3560</span></a> -</span><span id="Dot.build-3561"><a href="#Dot.build-3561"><span class="linenos">3561</span></a> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span> <span class="o">=</span> <span class="n">expressions</span> -</span><span id="Dot.build-3562"><a href="#Dot.build-3562"><span class="linenos">3562</span></a> <span class="n">dot</span> <span class="o">=</span> <span class="n">Dot</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">a</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">b</span><span class="p">)</span> -</span><span id="Dot.build-3563"><a href="#Dot.build-3563"><span class="linenos">3563</span></a> -</span><span id="Dot.build-3564"><a href="#Dot.build-3564"><span class="linenos">3564</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="Dot.build-3565"><a href="#Dot.build-3565"><span class="linenos">3565</span></a> <span class="n">dot</span> <span class="o">=</span> <span class="n">Dot</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">dot</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> -</span><span id="Dot.build-3566"><a href="#Dot.build-3566"><span class="linenos">3566</span></a> -</span><span id="Dot.build-3567"><a href="#Dot.build-3567"><span class="linenos">3567</span></a> <span class="k">return</span> <span class="n">dot</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Dot.build-3553"><a href="#Dot.build-3553"><span class="linenos">3553</span></a> <span class="nd">@classmethod</span> +</span><span id="Dot.build-3554"><a href="#Dot.build-3554"><span class="linenos">3554</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expressions</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="n">Expression</span><span class="p">])</span> <span class="o">-></span> <span class="n">Dot</span><span class="p">:</span> +</span><span id="Dot.build-3555"><a href="#Dot.build-3555"><span class="linenos">3555</span></a><span class="w"> </span><span class="sd">"""Build a Dot object with a sequence of expressions."""</span> +</span><span id="Dot.build-3556"><a href="#Dot.build-3556"><span class="linenos">3556</span></a> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">expressions</span><span class="p">)</span> <span class="o"><</span> <span class="mi">2</span><span class="p">:</span> +</span><span id="Dot.build-3557"><a href="#Dot.build-3557"><span class="linenos">3557</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Dot requires >= 2 expressions."</span><span class="p">)</span> +</span><span id="Dot.build-3558"><a href="#Dot.build-3558"><span class="linenos">3558</span></a> +</span><span id="Dot.build-3559"><a href="#Dot.build-3559"><span class="linenos">3559</span></a> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span> <span class="o">=</span> <span class="n">expressions</span> +</span><span id="Dot.build-3560"><a href="#Dot.build-3560"><span class="linenos">3560</span></a> <span class="n">dot</span> <span class="o">=</span> <span class="n">Dot</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">a</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">b</span><span class="p">)</span> +</span><span id="Dot.build-3561"><a href="#Dot.build-3561"><span class="linenos">3561</span></a> +</span><span id="Dot.build-3562"><a href="#Dot.build-3562"><span class="linenos">3562</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="Dot.build-3563"><a href="#Dot.build-3563"><span class="linenos">3563</span></a> <span class="n">dot</span> <span class="o">=</span> <span class="n">Dot</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">dot</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> +</span><span id="Dot.build-3564"><a href="#Dot.build-3564"><span class="linenos">3564</span></a> +</span><span id="Dot.build-3565"><a href="#Dot.build-3565"><span class="linenos">3565</span></a> <span class="k">return</span> <span class="n">dot</span> </span></pre></div> @@ -40619,8 +40631,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#DPipe"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DPipe-3570"><a href="#DPipe-3570"><span class="linenos">3570</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-3571"><a href="#DPipe-3571"><span class="linenos">3571</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DPipe-3568"><a href="#DPipe-3568"><span class="linenos">3568</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-3569"><a href="#DPipe-3569"><span class="linenos">3569</span></a> <span class="k">pass</span> </span></pre></div> @@ -40726,8 +40738,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#SafeDPipe"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SafeDPipe-3574"><a href="#SafeDPipe-3574"><span class="linenos">3574</span></a><span class="k">class</span> <span class="nc">SafeDPipe</span><span class="p">(</span><span class="n">DPipe</span><span class="p">):</span> -</span><span id="SafeDPipe-3575"><a href="#SafeDPipe-3575"><span class="linenos">3575</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SafeDPipe-3572"><a href="#SafeDPipe-3572"><span class="linenos">3572</span></a><span class="k">class</span> <span class="nc">SafeDPipe</span><span class="p">(</span><span class="n">DPipe</span><span class="p">):</span> +</span><span id="SafeDPipe-3573"><a href="#SafeDPipe-3573"><span class="linenos">3573</span></a> <span class="k">pass</span> </span></pre></div> @@ -40833,8 +40845,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#EQ"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="EQ-3578"><a href="#EQ-3578"><span class="linenos">3578</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-3579"><a href="#EQ-3579"><span class="linenos">3579</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="EQ-3576"><a href="#EQ-3576"><span class="linenos">3576</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-3577"><a href="#EQ-3577"><span class="linenos">3577</span></a> <span class="k">pass</span> </span></pre></div> @@ -40940,8 +40952,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#NullSafeEQ"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="NullSafeEQ-3582"><a href="#NullSafeEQ-3582"><span class="linenos">3582</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-3583"><a href="#NullSafeEQ-3583"><span class="linenos">3583</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="NullSafeEQ-3580"><a href="#NullSafeEQ-3580"><span class="linenos">3580</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-3581"><a href="#NullSafeEQ-3581"><span class="linenos">3581</span></a> <span class="k">pass</span> </span></pre></div> @@ -41047,8 +41059,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#NullSafeNEQ"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="NullSafeNEQ-3586"><a href="#NullSafeNEQ-3586"><span class="linenos">3586</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-3587"><a href="#NullSafeNEQ-3587"><span class="linenos">3587</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="NullSafeNEQ-3584"><a href="#NullSafeNEQ-3584"><span class="linenos">3584</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-3585"><a href="#NullSafeNEQ-3585"><span class="linenos">3585</span></a> <span class="k">pass</span> </span></pre></div> @@ -41154,8 +41166,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Distance"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Distance-3590"><a href="#Distance-3590"><span class="linenos">3590</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-3591"><a href="#Distance-3591"><span class="linenos">3591</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Distance-3588"><a href="#Distance-3588"><span class="linenos">3588</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-3589"><a href="#Distance-3589"><span class="linenos">3589</span></a> <span class="k">pass</span> </span></pre></div> @@ -41261,8 +41273,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Escape"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Escape-3594"><a href="#Escape-3594"><span class="linenos">3594</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-3595"><a href="#Escape-3595"><span class="linenos">3595</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Escape-3592"><a href="#Escape-3592"><span class="linenos">3592</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-3593"><a href="#Escape-3593"><span class="linenos">3593</span></a> <span class="k">pass</span> </span></pre></div> @@ -41368,8 +41380,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Glob"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Glob-3598"><a href="#Glob-3598"><span class="linenos">3598</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-3599"><a href="#Glob-3599"><span class="linenos">3599</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Glob-3596"><a href="#Glob-3596"><span class="linenos">3596</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-3597"><a href="#Glob-3597"><span class="linenos">3597</span></a> <span class="k">pass</span> </span></pre></div> @@ -41475,8 +41487,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#GT"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="GT-3602"><a href="#GT-3602"><span class="linenos">3602</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-3603"><a href="#GT-3603"><span class="linenos">3603</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="GT-3600"><a href="#GT-3600"><span class="linenos">3600</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-3601"><a href="#GT-3601"><span class="linenos">3601</span></a> <span class="k">pass</span> </span></pre></div> @@ -41582,8 +41594,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#GTE"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="GTE-3606"><a href="#GTE-3606"><span class="linenos">3606</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-3607"><a href="#GTE-3607"><span class="linenos">3607</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="GTE-3604"><a href="#GTE-3604"><span class="linenos">3604</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-3605"><a href="#GTE-3605"><span class="linenos">3605</span></a> <span class="k">pass</span> </span></pre></div> @@ -41689,8 +41701,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#ILike"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ILike-3610"><a href="#ILike-3610"><span class="linenos">3610</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-3611"><a href="#ILike-3611"><span class="linenos">3611</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ILike-3608"><a href="#ILike-3608"><span class="linenos">3608</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-3609"><a href="#ILike-3609"><span class="linenos">3609</span></a> <span class="k">pass</span> </span></pre></div> @@ -41796,8 +41808,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#ILikeAny"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ILikeAny-3614"><a href="#ILikeAny-3614"><span class="linenos">3614</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-3615"><a href="#ILikeAny-3615"><span class="linenos">3615</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ILikeAny-3612"><a href="#ILikeAny-3612"><span class="linenos">3612</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-3613"><a href="#ILikeAny-3613"><span class="linenos">3613</span></a> <span class="k">pass</span> </span></pre></div> @@ -41903,8 +41915,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#IntDiv"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="IntDiv-3618"><a href="#IntDiv-3618"><span class="linenos">3618</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-3619"><a href="#IntDiv-3619"><span class="linenos">3619</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="IntDiv-3616"><a href="#IntDiv-3616"><span class="linenos">3616</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-3617"><a href="#IntDiv-3617"><span class="linenos">3617</span></a> <span class="k">pass</span> </span></pre></div> @@ -42010,8 +42022,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Is"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Is-3622"><a href="#Is-3622"><span class="linenos">3622</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-3623"><a href="#Is-3623"><span class="linenos">3623</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Is-3620"><a href="#Is-3620"><span class="linenos">3620</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-3621"><a href="#Is-3621"><span class="linenos">3621</span></a> <span class="k">pass</span> </span></pre></div> @@ -42117,8 +42129,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Kwarg"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Kwarg-3626"><a href="#Kwarg-3626"><span class="linenos">3626</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-3627"><a href="#Kwarg-3627"><span class="linenos">3627</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-3624"><a href="#Kwarg-3624"><span class="linenos">3624</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-3625"><a href="#Kwarg-3625"><span class="linenos">3625</span></a><span class="w"> </span><span class="sd">"""Kwarg in special functions like func(kwarg => y)."""</span> </span></pre></div> @@ -42226,8 +42238,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Like"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Like-3630"><a href="#Like-3630"><span class="linenos">3630</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-3631"><a href="#Like-3631"><span class="linenos">3631</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Like-3628"><a href="#Like-3628"><span class="linenos">3628</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-3629"><a href="#Like-3629"><span class="linenos">3629</span></a> <span class="k">pass</span> </span></pre></div> @@ -42333,8 +42345,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#LikeAny"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LikeAny-3634"><a href="#LikeAny-3634"><span class="linenos">3634</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-3635"><a href="#LikeAny-3635"><span class="linenos">3635</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LikeAny-3632"><a href="#LikeAny-3632"><span class="linenos">3632</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-3633"><a href="#LikeAny-3633"><span class="linenos">3633</span></a> <span class="k">pass</span> </span></pre></div> @@ -42440,8 +42452,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#LT"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LT-3638"><a href="#LT-3638"><span class="linenos">3638</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-3639"><a href="#LT-3639"><span class="linenos">3639</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LT-3636"><a href="#LT-3636"><span class="linenos">3636</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-3637"><a href="#LT-3637"><span class="linenos">3637</span></a> <span class="k">pass</span> </span></pre></div> @@ -42547,8 +42559,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#LTE"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LTE-3642"><a href="#LTE-3642"><span class="linenos">3642</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-3643"><a href="#LTE-3643"><span class="linenos">3643</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LTE-3640"><a href="#LTE-3640"><span class="linenos">3640</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-3641"><a href="#LTE-3641"><span class="linenos">3641</span></a> <span class="k">pass</span> </span></pre></div> @@ -42654,8 +42666,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Mod"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Mod-3646"><a href="#Mod-3646"><span class="linenos">3646</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-3647"><a href="#Mod-3647"><span class="linenos">3647</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Mod-3644"><a href="#Mod-3644"><span class="linenos">3644</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-3645"><a href="#Mod-3645"><span class="linenos">3645</span></a> <span class="k">pass</span> </span></pre></div> @@ -42761,8 +42773,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Mul"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Mul-3650"><a href="#Mul-3650"><span class="linenos">3650</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-3651"><a href="#Mul-3651"><span class="linenos">3651</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Mul-3648"><a href="#Mul-3648"><span class="linenos">3648</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-3649"><a href="#Mul-3649"><span class="linenos">3649</span></a> <span class="k">pass</span> </span></pre></div> @@ -42868,8 +42880,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#NEQ"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="NEQ-3654"><a href="#NEQ-3654"><span class="linenos">3654</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-3655"><a href="#NEQ-3655"><span class="linenos">3655</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="NEQ-3652"><a href="#NEQ-3652"><span class="linenos">3652</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-3653"><a href="#NEQ-3653"><span class="linenos">3653</span></a> <span class="k">pass</span> </span></pre></div> @@ -42975,8 +42987,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#SimilarTo"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SimilarTo-3658"><a href="#SimilarTo-3658"><span class="linenos">3658</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-3659"><a href="#SimilarTo-3659"><span class="linenos">3659</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SimilarTo-3656"><a href="#SimilarTo-3656"><span class="linenos">3656</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-3657"><a href="#SimilarTo-3657"><span class="linenos">3657</span></a> <span class="k">pass</span> </span></pre></div> @@ -43082,8 +43094,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Slice"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Slice-3662"><a href="#Slice-3662"><span class="linenos">3662</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-3663"><a href="#Slice-3663"><span class="linenos">3663</span></a> <span class="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-3660"><a href="#Slice-3660"><span class="linenos">3660</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-3661"><a href="#Slice-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">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> @@ -43200,8 +43212,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Sub"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Sub-3666"><a href="#Sub-3666"><span class="linenos">3666</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-3667"><a href="#Sub-3667"><span class="linenos">3667</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Sub-3664"><a href="#Sub-3664"><span class="linenos">3664</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-3665"><a href="#Sub-3665"><span class="linenos">3665</span></a> <span class="k">pass</span> </span></pre></div> @@ -43307,8 +43319,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#ArrayOverlaps"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayOverlaps-3670"><a href="#ArrayOverlaps-3670"><span class="linenos">3670</span></a><span class="k">class</span> <span class="nc">ArrayOverlaps</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="ArrayOverlaps-3671"><a href="#ArrayOverlaps-3671"><span class="linenos">3671</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayOverlaps-3668"><a href="#ArrayOverlaps-3668"><span class="linenos">3668</span></a><span class="k">class</span> <span class="nc">ArrayOverlaps</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="ArrayOverlaps-3669"><a href="#ArrayOverlaps-3669"><span class="linenos">3669</span></a> <span class="k">pass</span> </span></pre></div> @@ -43414,8 +43426,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Unary"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Unary-3676"><a href="#Unary-3676"><span class="linenos">3676</span></a><span class="k">class</span> <span class="nc">Unary</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="Unary-3677"><a href="#Unary-3677"><span class="linenos">3677</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Unary-3674"><a href="#Unary-3674"><span class="linenos">3674</span></a><span class="k">class</span> <span class="nc">Unary</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="Unary-3675"><a href="#Unary-3675"><span class="linenos">3675</span></a> <span class="k">pass</span> </span></pre></div> @@ -43516,8 +43528,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#BitwiseNot"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseNot-3680"><a href="#BitwiseNot-3680"><span class="linenos">3680</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-3681"><a href="#BitwiseNot-3681"><span class="linenos">3681</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseNot-3678"><a href="#BitwiseNot-3678"><span class="linenos">3678</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-3679"><a href="#BitwiseNot-3679"><span class="linenos">3679</span></a> <span class="k">pass</span> </span></pre></div> @@ -43618,8 +43630,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Not"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Not-3684"><a href="#Not-3684"><span class="linenos">3684</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><span id="Not-3685"><a href="#Not-3685"><span class="linenos">3685</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Not-3682"><a href="#Not-3682"><span class="linenos">3682</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><span id="Not-3683"><a href="#Not-3683"><span class="linenos">3683</span></a> <span class="k">pass</span> </span></pre></div> @@ -43720,12 +43732,12 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Paren"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Paren-3688"><a href="#Paren-3688"><span class="linenos">3688</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><span id="Paren-3689"><a href="#Paren-3689"><span class="linenos">3689</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="Paren-3690"><a href="#Paren-3690"><span class="linenos">3690</span></a> -</span><span id="Paren-3691"><a href="#Paren-3691"><span class="linenos">3691</span></a> <span class="nd">@property</span> -</span><span id="Paren-3692"><a href="#Paren-3692"><span class="linenos">3692</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="Paren-3693"><a href="#Paren-3693"><span class="linenos">3693</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="Paren-3686"><a href="#Paren-3686"><span class="linenos">3686</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><span id="Paren-3687"><a href="#Paren-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">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Paren-3688"><a href="#Paren-3688"><span class="linenos">3688</span></a> +</span><span id="Paren-3689"><a href="#Paren-3689"><span class="linenos">3689</span></a> <span class="nd">@property</span> +</span><span id="Paren-3690"><a href="#Paren-3690"><span class="linenos">3690</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="Paren-3691"><a href="#Paren-3691"><span class="linenos">3691</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></pre></div> @@ -43866,8 +43878,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Neg"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Neg-3696"><a href="#Neg-3696"><span class="linenos">3696</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-3697"><a href="#Neg-3697"><span class="linenos">3697</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Neg-3694"><a href="#Neg-3694"><span class="linenos">3694</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-3695"><a href="#Neg-3695"><span class="linenos">3695</span></a> <span class="k">pass</span> </span></pre></div> @@ -43968,12 +43980,12 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Alias"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Alias-3700"><a href="#Alias-3700"><span class="linenos">3700</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-3701"><a href="#Alias-3701"><span class="linenos">3701</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3702"><a href="#Alias-3702"><span class="linenos">3702</span></a> -</span><span id="Alias-3703"><a href="#Alias-3703"><span class="linenos">3703</span></a> <span class="nd">@property</span> -</span><span id="Alias-3704"><a href="#Alias-3704"><span class="linenos">3704</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="Alias-3705"><a href="#Alias-3705"><span class="linenos">3705</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-3698"><a href="#Alias-3698"><span class="linenos">3698</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-3699"><a href="#Alias-3699"><span class="linenos">3699</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3700"><a href="#Alias-3700"><span class="linenos">3700</span></a> +</span><span id="Alias-3701"><a href="#Alias-3701"><span class="linenos">3701</span></a> <span class="nd">@property</span> +</span><span id="Alias-3702"><a href="#Alias-3702"><span class="linenos">3702</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="Alias-3703"><a href="#Alias-3703"><span class="linenos">3703</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> </span></pre></div> @@ -44099,12 +44111,12 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Aliases"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Aliases-3708"><a href="#Aliases-3708"><span class="linenos">3708</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-3709"><a href="#Aliases-3709"><span class="linenos">3709</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3710"><a href="#Aliases-3710"><span class="linenos">3710</span></a> -</span><span id="Aliases-3711"><a href="#Aliases-3711"><span class="linenos">3711</span></a> <span class="nd">@property</span> -</span><span id="Aliases-3712"><a href="#Aliases-3712"><span class="linenos">3712</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-3713"><a href="#Aliases-3713"><span class="linenos">3713</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-3706"><a href="#Aliases-3706"><span class="linenos">3706</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-3707"><a href="#Aliases-3707"><span class="linenos">3707</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3708"><a href="#Aliases-3708"><span class="linenos">3708</span></a> +</span><span id="Aliases-3709"><a href="#Aliases-3709"><span class="linenos">3709</span></a> <span class="nd">@property</span> +</span><span id="Aliases-3710"><a href="#Aliases-3710"><span class="linenos">3710</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-3711"><a href="#Aliases-3711"><span class="linenos">3711</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> </span></pre></div> @@ -44212,8 +44224,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#AtTimeZone"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AtTimeZone-3716"><a href="#AtTimeZone-3716"><span class="linenos">3716</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-3717"><a href="#AtTimeZone-3717"><span class="linenos">3717</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3714"><a href="#AtTimeZone-3714"><span class="linenos">3714</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-3715"><a href="#AtTimeZone-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">"zone"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -44310,8 +44322,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Between"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Between-3720"><a href="#Between-3720"><span class="linenos">3720</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-3721"><a href="#Between-3721"><span class="linenos">3721</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3718"><a href="#Between-3718"><span class="linenos">3718</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-3719"><a href="#Between-3719"><span class="linenos">3719</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -44423,8 +44435,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Bracket"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Bracket-3724"><a href="#Bracket-3724"><span class="linenos">3724</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-3725"><a href="#Bracket-3725"><span class="linenos">3725</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3722"><a href="#Bracket-3722"><span class="linenos">3722</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-3723"><a href="#Bracket-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">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -44536,8 +44548,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#SafeBracket"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SafeBracket-3728"><a href="#SafeBracket-3728"><span class="linenos">3728</span></a><span class="k">class</span> <span class="nc">SafeBracket</span><span class="p">(</span><span class="n">Bracket</span><span class="p">):</span> -</span><span id="SafeBracket-3729"><a href="#SafeBracket-3729"><span class="linenos">3729</span></a><span class="w"> </span><span class="sd">"""Represents array lookup where OOB index yields NULL instead of causing a failure."""</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SafeBracket-3726"><a href="#SafeBracket-3726"><span class="linenos">3726</span></a><span class="k">class</span> <span class="nc">SafeBracket</span><span class="p">(</span><span class="n">Bracket</span><span class="p">):</span> +</span><span id="SafeBracket-3727"><a href="#SafeBracket-3727"><span class="linenos">3727</span></a><span class="w"> </span><span class="sd">"""Represents array lookup where OOB index yields NULL instead of causing a failure."""</span> </span></pre></div> @@ -44643,8 +44655,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Distinct"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Distinct-3732"><a href="#Distinct-3732"><span class="linenos">3732</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-3733"><a href="#Distinct-3733"><span class="linenos">3733</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-3730"><a href="#Distinct-3730"><span class="linenos">3730</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-3731"><a href="#Distinct-3731"><span class="linenos">3731</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> @@ -44741,15 +44753,15 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#In"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="In-3736"><a href="#In-3736"><span class="linenos">3736</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-3737"><a href="#In-3737"><span class="linenos">3737</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="In-3738"><a href="#In-3738"><span class="linenos">3738</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="In-3739"><a href="#In-3739"><span class="linenos">3739</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="In-3740"><a href="#In-3740"><span class="linenos">3740</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="In-3741"><a href="#In-3741"><span class="linenos">3741</span></a> <span class="s2">"unnest"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="In-3742"><a href="#In-3742"><span class="linenos">3742</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="In-3743"><a href="#In-3743"><span class="linenos">3743</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-3744"><a href="#In-3744"><span class="linenos">3744</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="In-3734"><a href="#In-3734"><span class="linenos">3734</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-3735"><a href="#In-3735"><span class="linenos">3735</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="In-3736"><a href="#In-3736"><span class="linenos">3736</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="In-3737"><a href="#In-3737"><span class="linenos">3737</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="In-3738"><a href="#In-3738"><span class="linenos">3738</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="In-3739"><a href="#In-3739"><span class="linenos">3739</span></a> <span class="s2">"unnest"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="In-3740"><a href="#In-3740"><span class="linenos">3740</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="In-3741"><a href="#In-3741"><span class="linenos">3741</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-3742"><a href="#In-3742"><span class="linenos">3742</span></a> <span class="p">}</span> </span></pre></div> @@ -44862,19 +44874,19 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#TimeUnit"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeUnit-3747"><a href="#TimeUnit-3747"><span class="linenos">3747</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-3748"><a href="#TimeUnit-3748"><span class="linenos">3748</span></a><span class="w"> </span><span class="sd">"""Automatically converts unit arg into a var."""</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeUnit-3745"><a href="#TimeUnit-3745"><span class="linenos">3745</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-3746"><a href="#TimeUnit-3746"><span class="linenos">3746</span></a><span class="w"> </span><span class="sd">"""Automatically converts unit arg into a var."""</span> +</span><span id="TimeUnit-3747"><a href="#TimeUnit-3747"><span class="linenos">3747</span></a> +</span><span id="TimeUnit-3748"><a href="#TimeUnit-3748"><span class="linenos">3748</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-3749"><a href="#TimeUnit-3749"><span class="linenos">3749</span></a> -</span><span id="TimeUnit-3750"><a href="#TimeUnit-3750"><span class="linenos">3750</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-3751"><a href="#TimeUnit-3751"><span class="linenos">3751</span></a> -</span><span id="TimeUnit-3752"><a href="#TimeUnit-3752"><span class="linenos">3752</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-3753"><a href="#TimeUnit-3753"><span class="linenos">3753</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-3754"><a href="#TimeUnit-3754"><span class="linenos">3754</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="p">(</span><span class="n">Column</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)):</span> -</span><span id="TimeUnit-3755"><a href="#TimeUnit-3755"><span class="linenos">3755</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-3756"><a href="#TimeUnit-3756"><span class="linenos">3756</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-3757"><a href="#TimeUnit-3757"><span class="linenos">3757</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-3758"><a href="#TimeUnit-3758"><span class="linenos">3758</span></a> -</span><span id="TimeUnit-3759"><a href="#TimeUnit-3759"><span class="linenos">3759</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="TimeUnit-3750"><a href="#TimeUnit-3750"><span class="linenos">3750</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-3751"><a href="#TimeUnit-3751"><span class="linenos">3751</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-3752"><a href="#TimeUnit-3752"><span class="linenos">3752</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="p">(</span><span class="n">Column</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)):</span> +</span><span id="TimeUnit-3753"><a href="#TimeUnit-3753"><span class="linenos">3753</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-3754"><a href="#TimeUnit-3754"><span class="linenos">3754</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-3755"><a href="#TimeUnit-3755"><span class="linenos">3755</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-3756"><a href="#TimeUnit-3756"><span class="linenos">3756</span></a> +</span><span id="TimeUnit-3757"><a href="#TimeUnit-3757"><span class="linenos">3757</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> @@ -44892,14 +44904,14 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#TimeUnit.__init__"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeUnit.__init__-3752"><a href="#TimeUnit.__init__-3752"><span class="linenos">3752</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__-3753"><a href="#TimeUnit.__init__-3753"><span class="linenos">3753</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__-3754"><a href="#TimeUnit.__init__-3754"><span class="linenos">3754</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="p">(</span><span class="n">Column</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)):</span> -</span><span id="TimeUnit.__init__-3755"><a href="#TimeUnit.__init__-3755"><span class="linenos">3755</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__-3756"><a href="#TimeUnit.__init__-3756"><span class="linenos">3756</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__-3757"><a href="#TimeUnit.__init__-3757"><span class="linenos">3757</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__-3758"><a href="#TimeUnit.__init__-3758"><span class="linenos">3758</span></a> -</span><span id="TimeUnit.__init__-3759"><a href="#TimeUnit.__init__-3759"><span class="linenos">3759</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__-3750"><a href="#TimeUnit.__init__-3750"><span class="linenos">3750</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__-3751"><a href="#TimeUnit.__init__-3751"><span class="linenos">3751</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__-3752"><a href="#TimeUnit.__init__-3752"><span class="linenos">3752</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="p">(</span><span class="n">Column</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)):</span> +</span><span id="TimeUnit.__init__-3753"><a href="#TimeUnit.__init__-3753"><span class="linenos">3753</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__-3754"><a href="#TimeUnit.__init__-3754"><span class="linenos">3754</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__-3755"><a href="#TimeUnit.__init__-3755"><span class="linenos">3755</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__-3756"><a href="#TimeUnit.__init__-3756"><span class="linenos">3756</span></a> +</span><span id="TimeUnit.__init__-3757"><a href="#TimeUnit.__init__-3757"><span class="linenos">3757</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> @@ -44996,12 +45008,12 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Interval"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Interval-3762"><a href="#Interval-3762"><span class="linenos">3762</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-3763"><a href="#Interval-3763"><span class="linenos">3763</span></a> <span class="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="Interval-3764"><a href="#Interval-3764"><span class="linenos">3764</span></a> -</span><span id="Interval-3765"><a href="#Interval-3765"><span class="linenos">3765</span></a> <span class="nd">@property</span> -</span><span id="Interval-3766"><a href="#Interval-3766"><span class="linenos">3766</span></a> <span class="k">def</span> <span class="nf">unit</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">Var</span><span class="p">]:</span> -</span><span id="Interval-3767"><a href="#Interval-3767"><span class="linenos">3767</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">"unit"</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Interval-3760"><a href="#Interval-3760"><span class="linenos">3760</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-3761"><a href="#Interval-3761"><span class="linenos">3761</span></a> <span class="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="Interval-3762"><a href="#Interval-3762"><span class="linenos">3762</span></a> +</span><span id="Interval-3763"><a href="#Interval-3763"><span class="linenos">3763</span></a> <span class="nd">@property</span> +</span><span id="Interval-3764"><a href="#Interval-3764"><span class="linenos">3764</span></a> <span class="k">def</span> <span class="nf">unit</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">Var</span><span class="p">]:</span> +</span><span id="Interval-3765"><a href="#Interval-3765"><span class="linenos">3765</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">"unit"</span><span class="p">)</span> </span></pre></div> @@ -45112,8 +45124,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#IgnoreNulls"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="IgnoreNulls-3770"><a href="#IgnoreNulls-3770"><span class="linenos">3770</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-3771"><a href="#IgnoreNulls-3771"><span class="linenos">3771</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="IgnoreNulls-3768"><a href="#IgnoreNulls-3768"><span class="linenos">3768</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-3769"><a href="#IgnoreNulls-3769"><span class="linenos">3769</span></a> <span class="k">pass</span> </span></pre></div> @@ -45199,8 +45211,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#RespectNulls"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RespectNulls-3774"><a href="#RespectNulls-3774"><span class="linenos">3774</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-3775"><a href="#RespectNulls-3775"><span class="linenos">3775</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RespectNulls-3772"><a href="#RespectNulls-3772"><span class="linenos">3772</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-3773"><a href="#RespectNulls-3773"><span class="linenos">3773</span></a> <span class="k">pass</span> </span></pre></div> @@ -45286,53 +45298,53 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Func"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Func-3779"><a href="#Func-3779"><span class="linenos">3779</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-3780"><a href="#Func-3780"><span class="linenos">3780</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Func-3781"><a href="#Func-3781"><span class="linenos">3781</span></a><span class="sd"> The base class for all function expressions.</span> -</span><span id="Func-3782"><a href="#Func-3782"><span class="linenos">3782</span></a> -</span><span id="Func-3783"><a href="#Func-3783"><span class="linenos">3783</span></a><span class="sd"> Attributes:</span> -</span><span id="Func-3784"><a href="#Func-3784"><span class="linenos">3784</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-3785"><a href="#Func-3785"><span class="linenos">3785</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-3786"><a href="#Func-3786"><span class="linenos">3786</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-3787"><a href="#Func-3787"><span class="linenos">3787</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-3788"><a href="#Func-3788"><span class="linenos">3788</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-3789"><a href="#Func-3789"><span class="linenos">3789</span></a><span class="sd"> name is set to the expression's class name transformed to snake case.</span> -</span><span id="Func-3790"><a href="#Func-3790"><span class="linenos">3790</span></a><span class="sd"> """</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Func-3777"><a href="#Func-3777"><span class="linenos">3777</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-3778"><a href="#Func-3778"><span class="linenos">3778</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Func-3779"><a href="#Func-3779"><span class="linenos">3779</span></a><span class="sd"> The base class for all function expressions.</span> +</span><span id="Func-3780"><a href="#Func-3780"><span class="linenos">3780</span></a> +</span><span id="Func-3781"><a href="#Func-3781"><span class="linenos">3781</span></a><span class="sd"> Attributes:</span> +</span><span id="Func-3782"><a href="#Func-3782"><span class="linenos">3782</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-3783"><a href="#Func-3783"><span class="linenos">3783</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-3784"><a href="#Func-3784"><span class="linenos">3784</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-3785"><a href="#Func-3785"><span class="linenos">3785</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-3786"><a href="#Func-3786"><span class="linenos">3786</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-3787"><a href="#Func-3787"><span class="linenos">3787</span></a><span class="sd"> name is set to the expression's class name transformed to snake case.</span> +</span><span id="Func-3788"><a href="#Func-3788"><span class="linenos">3788</span></a><span class="sd"> """</span> +</span><span id="Func-3789"><a href="#Func-3789"><span class="linenos">3789</span></a> +</span><span id="Func-3790"><a href="#Func-3790"><span class="linenos">3790</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">False</span> </span><span id="Func-3791"><a href="#Func-3791"><span class="linenos">3791</span></a> -</span><span id="Func-3792"><a href="#Func-3792"><span class="linenos">3792</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">False</span> -</span><span id="Func-3793"><a href="#Func-3793"><span class="linenos">3793</span></a> -</span><span id="Func-3794"><a href="#Func-3794"><span class="linenos">3794</span></a> <span class="nd">@classmethod</span> -</span><span id="Func-3795"><a href="#Func-3795"><span class="linenos">3795</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-3796"><a href="#Func-3796"><span class="linenos">3796</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-3797"><a href="#Func-3797"><span class="linenos">3797</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-3798"><a href="#Func-3798"><span class="linenos">3798</span></a> <span class="c1"># If this function supports variable length argument treat the last argument as such.</span> -</span><span id="Func-3799"><a href="#Func-3799"><span class="linenos">3799</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-3800"><a href="#Func-3800"><span class="linenos">3800</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-3801"><a href="#Func-3801"><span class="linenos">3801</span></a> -</span><span id="Func-3802"><a href="#Func-3802"><span class="linenos">3802</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-3803"><a href="#Func-3803"><span class="linenos">3803</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-3804"><a href="#Func-3804"><span class="linenos">3804</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Func-3805"><a href="#Func-3805"><span class="linenos">3805</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-3792"><a href="#Func-3792"><span class="linenos">3792</span></a> <span class="nd">@classmethod</span> +</span><span id="Func-3793"><a href="#Func-3793"><span class="linenos">3793</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-3794"><a href="#Func-3794"><span class="linenos">3794</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-3795"><a href="#Func-3795"><span class="linenos">3795</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-3796"><a href="#Func-3796"><span class="linenos">3796</span></a> <span class="c1"># If this function supports variable length argument treat the last argument as such.</span> +</span><span id="Func-3797"><a href="#Func-3797"><span class="linenos">3797</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-3798"><a href="#Func-3798"><span class="linenos">3798</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-3799"><a href="#Func-3799"><span class="linenos">3799</span></a> +</span><span id="Func-3800"><a href="#Func-3800"><span class="linenos">3800</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-3801"><a href="#Func-3801"><span class="linenos">3801</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-3802"><a href="#Func-3802"><span class="linenos">3802</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Func-3803"><a href="#Func-3803"><span class="linenos">3803</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-3804"><a href="#Func-3804"><span class="linenos">3804</span></a> +</span><span id="Func-3805"><a href="#Func-3805"><span class="linenos">3805</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-3806"><a href="#Func-3806"><span class="linenos">3806</span></a> -</span><span id="Func-3807"><a href="#Func-3807"><span class="linenos">3807</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-3808"><a href="#Func-3808"><span class="linenos">3808</span></a> -</span><span id="Func-3809"><a href="#Func-3809"><span class="linenos">3809</span></a> <span class="nd">@classmethod</span> -</span><span id="Func-3810"><a href="#Func-3810"><span class="linenos">3810</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-3811"><a href="#Func-3811"><span class="linenos">3811</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-3812"><a href="#Func-3812"><span class="linenos">3812</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span> -</span><span id="Func-3813"><a href="#Func-3813"><span class="linenos">3813</span></a> <span class="s2">"SQL name is only supported by concrete function implementations"</span> -</span><span id="Func-3814"><a href="#Func-3814"><span class="linenos">3814</span></a> <span class="p">)</span> -</span><span id="Func-3815"><a href="#Func-3815"><span class="linenos">3815</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-3816"><a href="#Func-3816"><span class="linenos">3816</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-3817"><a href="#Func-3817"><span class="linenos">3817</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-3818"><a href="#Func-3818"><span class="linenos">3818</span></a> -</span><span id="Func-3819"><a href="#Func-3819"><span class="linenos">3819</span></a> <span class="nd">@classmethod</span> -</span><span id="Func-3820"><a href="#Func-3820"><span class="linenos">3820</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-3821"><a href="#Func-3821"><span class="linenos">3821</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-3822"><a href="#Func-3822"><span class="linenos">3822</span></a> -</span><span id="Func-3823"><a href="#Func-3823"><span class="linenos">3823</span></a> <span class="nd">@classmethod</span> -</span><span id="Func-3824"><a href="#Func-3824"><span class="linenos">3824</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-3825"><a href="#Func-3825"><span class="linenos">3825</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="Func-3807"><a href="#Func-3807"><span class="linenos">3807</span></a> <span class="nd">@classmethod</span> +</span><span id="Func-3808"><a href="#Func-3808"><span class="linenos">3808</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-3809"><a href="#Func-3809"><span class="linenos">3809</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-3810"><a href="#Func-3810"><span class="linenos">3810</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span> +</span><span id="Func-3811"><a href="#Func-3811"><span class="linenos">3811</span></a> <span class="s2">"SQL name is only supported by concrete function implementations"</span> +</span><span id="Func-3812"><a href="#Func-3812"><span class="linenos">3812</span></a> <span class="p">)</span> +</span><span id="Func-3813"><a href="#Func-3813"><span class="linenos">3813</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-3814"><a href="#Func-3814"><span class="linenos">3814</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-3815"><a href="#Func-3815"><span class="linenos">3815</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-3816"><a href="#Func-3816"><span class="linenos">3816</span></a> +</span><span id="Func-3817"><a href="#Func-3817"><span class="linenos">3817</span></a> <span class="nd">@classmethod</span> +</span><span id="Func-3818"><a href="#Func-3818"><span class="linenos">3818</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-3819"><a href="#Func-3819"><span class="linenos">3819</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-3820"><a href="#Func-3820"><span class="linenos">3820</span></a> +</span><span id="Func-3821"><a href="#Func-3821"><span class="linenos">3821</span></a> <span class="nd">@classmethod</span> +</span><span id="Func-3822"><a href="#Func-3822"><span class="linenos">3822</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-3823"><a href="#Func-3823"><span class="linenos">3823</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> @@ -45375,20 +45387,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-3794"><a href="#Func.from_arg_list-3794"><span class="linenos">3794</span></a> <span class="nd">@classmethod</span> -</span><span id="Func.from_arg_list-3795"><a href="#Func.from_arg_list-3795"><span class="linenos">3795</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-3796"><a href="#Func.from_arg_list-3796"><span class="linenos">3796</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-3797"><a href="#Func.from_arg_list-3797"><span class="linenos">3797</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-3798"><a href="#Func.from_arg_list-3798"><span class="linenos">3798</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-3799"><a href="#Func.from_arg_list-3799"><span class="linenos">3799</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-3800"><a href="#Func.from_arg_list-3800"><span class="linenos">3800</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-3801"><a href="#Func.from_arg_list-3801"><span class="linenos">3801</span></a> -</span><span id="Func.from_arg_list-3802"><a href="#Func.from_arg_list-3802"><span class="linenos">3802</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-3803"><a href="#Func.from_arg_list-3803"><span class="linenos">3803</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-3804"><a href="#Func.from_arg_list-3804"><span class="linenos">3804</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Func.from_arg_list-3805"><a href="#Func.from_arg_list-3805"><span class="linenos">3805</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-3806"><a href="#Func.from_arg_list-3806"><span class="linenos">3806</span></a> -</span><span id="Func.from_arg_list-3807"><a href="#Func.from_arg_list-3807"><span class="linenos">3807</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-3792"><a href="#Func.from_arg_list-3792"><span class="linenos">3792</span></a> <span class="nd">@classmethod</span> +</span><span id="Func.from_arg_list-3793"><a href="#Func.from_arg_list-3793"><span class="linenos">3793</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-3794"><a href="#Func.from_arg_list-3794"><span class="linenos">3794</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-3795"><a href="#Func.from_arg_list-3795"><span class="linenos">3795</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-3796"><a href="#Func.from_arg_list-3796"><span class="linenos">3796</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-3797"><a href="#Func.from_arg_list-3797"><span class="linenos">3797</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-3798"><a href="#Func.from_arg_list-3798"><span class="linenos">3798</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-3799"><a href="#Func.from_arg_list-3799"><span class="linenos">3799</span></a> +</span><span id="Func.from_arg_list-3800"><a href="#Func.from_arg_list-3800"><span class="linenos">3800</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-3801"><a href="#Func.from_arg_list-3801"><span class="linenos">3801</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-3802"><a href="#Func.from_arg_list-3802"><span class="linenos">3802</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Func.from_arg_list-3803"><a href="#Func.from_arg_list-3803"><span class="linenos">3803</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-3804"><a href="#Func.from_arg_list-3804"><span class="linenos">3804</span></a> +</span><span id="Func.from_arg_list-3805"><a href="#Func.from_arg_list-3805"><span class="linenos">3805</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> @@ -45407,15 +45419,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-3809"><a href="#Func.sql_names-3809"><span class="linenos">3809</span></a> <span class="nd">@classmethod</span> -</span><span id="Func.sql_names-3810"><a href="#Func.sql_names-3810"><span class="linenos">3810</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-3811"><a href="#Func.sql_names-3811"><span class="linenos">3811</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-3812"><a href="#Func.sql_names-3812"><span class="linenos">3812</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span> -</span><span id="Func.sql_names-3813"><a href="#Func.sql_names-3813"><span class="linenos">3813</span></a> <span class="s2">"SQL name is only supported by concrete function implementations"</span> -</span><span id="Func.sql_names-3814"><a href="#Func.sql_names-3814"><span class="linenos">3814</span></a> <span class="p">)</span> -</span><span id="Func.sql_names-3815"><a href="#Func.sql_names-3815"><span class="linenos">3815</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-3816"><a href="#Func.sql_names-3816"><span class="linenos">3816</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-3817"><a href="#Func.sql_names-3817"><span class="linenos">3817</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-3807"><a href="#Func.sql_names-3807"><span class="linenos">3807</span></a> <span class="nd">@classmethod</span> +</span><span id="Func.sql_names-3808"><a href="#Func.sql_names-3808"><span class="linenos">3808</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-3809"><a href="#Func.sql_names-3809"><span class="linenos">3809</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-3810"><a href="#Func.sql_names-3810"><span class="linenos">3810</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span> +</span><span id="Func.sql_names-3811"><a href="#Func.sql_names-3811"><span class="linenos">3811</span></a> <span class="s2">"SQL name is only supported by concrete function implementations"</span> +</span><span id="Func.sql_names-3812"><a href="#Func.sql_names-3812"><span class="linenos">3812</span></a> <span class="p">)</span> +</span><span id="Func.sql_names-3813"><a href="#Func.sql_names-3813"><span class="linenos">3813</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-3814"><a href="#Func.sql_names-3814"><span class="linenos">3814</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-3815"><a href="#Func.sql_names-3815"><span class="linenos">3815</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> @@ -45434,9 +45446,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-3819"><a href="#Func.sql_name-3819"><span class="linenos">3819</span></a> <span class="nd">@classmethod</span> -</span><span id="Func.sql_name-3820"><a href="#Func.sql_name-3820"><span class="linenos">3820</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-3821"><a href="#Func.sql_name-3821"><span class="linenos">3821</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-3817"><a href="#Func.sql_name-3817"><span class="linenos">3817</span></a> <span class="nd">@classmethod</span> +</span><span id="Func.sql_name-3818"><a href="#Func.sql_name-3818"><span class="linenos">3818</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-3819"><a href="#Func.sql_name-3819"><span class="linenos">3819</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> @@ -45455,9 +45467,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-3823"><a href="#Func.default_parser_mappings-3823"><span class="linenos">3823</span></a> <span class="nd">@classmethod</span> -</span><span id="Func.default_parser_mappings-3824"><a href="#Func.default_parser_mappings-3824"><span class="linenos">3824</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-3825"><a href="#Func.default_parser_mappings-3825"><span class="linenos">3825</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-3821"><a href="#Func.default_parser_mappings-3821"><span class="linenos">3821</span></a> <span class="nd">@classmethod</span> +</span><span id="Func.default_parser_mappings-3822"><a href="#Func.default_parser_mappings-3822"><span class="linenos">3822</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-3823"><a href="#Func.default_parser_mappings-3823"><span class="linenos">3823</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> @@ -45559,8 +45571,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-3828"><a href="#AggFunc-3828"><span class="linenos">3828</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-3829"><a href="#AggFunc-3829"><span class="linenos">3829</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="AggFunc-3826"><a href="#AggFunc-3826"><span class="linenos">3826</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-3827"><a href="#AggFunc-3827"><span class="linenos">3827</span></a> <span class="k">pass</span> </span></pre></div> @@ -45669,8 +45681,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ParameterizedAgg"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ParameterizedAgg-3832"><a href="#ParameterizedAgg-3832"><span class="linenos">3832</span></a><span class="k">class</span> <span class="nc">ParameterizedAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="ParameterizedAgg-3833"><a href="#ParameterizedAgg-3833"><span class="linenos">3833</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"params"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ParameterizedAgg-3830"><a href="#ParameterizedAgg-3830"><span class="linenos">3830</span></a><span class="k">class</span> <span class="nc">ParameterizedAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="ParameterizedAgg-3831"><a href="#ParameterizedAgg-3831"><span class="linenos">3831</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"params"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -45790,8 +45802,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-3836"><a href="#Abs-3836"><span class="linenos">3836</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-3837"><a href="#Abs-3837"><span class="linenos">3837</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Abs-3834"><a href="#Abs-3834"><span class="linenos">3834</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-3835"><a href="#Abs-3835"><span class="linenos">3835</span></a> <span class="k">pass</span> </span></pre></div> @@ -45900,9 +45912,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-3840"><a href="#Anonymous-3840"><span class="linenos">3840</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-3841"><a href="#Anonymous-3841"><span class="linenos">3841</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3842"><a href="#Anonymous-3842"><span class="linenos">3842</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-3838"><a href="#Anonymous-3838"><span class="linenos">3838</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-3839"><a href="#Anonymous-3839"><span class="linenos">3839</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3840"><a href="#Anonymous-3840"><span class="linenos">3840</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -46033,9 +46045,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Hll"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Hll-3847"><a href="#Hll-3847"><span class="linenos">3847</span></a><span class="k">class</span> <span class="nc">Hll</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="Hll-3848"><a href="#Hll-3848"><span class="linenos">3848</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="Hll-3849"><a href="#Hll-3849"><span class="linenos">3849</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="Hll-3845"><a href="#Hll-3845"><span class="linenos">3845</span></a><span class="k">class</span> <span class="nc">Hll</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="Hll-3846"><a href="#Hll-3846"><span class="linenos">3846</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="Hll-3847"><a href="#Hll-3847"><span class="linenos">3847</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -46166,9 +46178,9 @@ 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-3852"><a href="#ApproxDistinct-3852"><span class="linenos">3852</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-3853"><a href="#ApproxDistinct-3853"><span class="linenos">3853</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="ApproxDistinct-3854"><a href="#ApproxDistinct-3854"><span class="linenos">3854</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"APPROX_DISTINCT"</span><span class="p">,</span> <span class="s2">"APPROX_COUNT_DISTINCT"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ApproxDistinct-3850"><a href="#ApproxDistinct-3850"><span class="linenos">3850</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-3851"><a href="#ApproxDistinct-3851"><span class="linenos">3851</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="ApproxDistinct-3852"><a href="#ApproxDistinct-3852"><span class="linenos">3852</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"APPROX_DISTINCT"</span><span class="p">,</span> <span class="s2">"APPROX_COUNT_DISTINCT"</span><span class="p">]</span> </span></pre></div> @@ -46288,9 +46300,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-3857"><a href="#Array-3857"><span class="linenos">3857</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-3858"><a href="#Array-3858"><span class="linenos">3858</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-3859"><a href="#Array-3859"><span class="linenos">3859</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-3855"><a href="#Array-3855"><span class="linenos">3855</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-3856"><a href="#Array-3856"><span class="linenos">3856</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-3857"><a href="#Array-3857"><span class="linenos">3857</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -46421,8 +46433,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ToChar"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ToChar-3863"><a href="#ToChar-3863"><span class="linenos">3863</span></a><span class="k">class</span> <span class="nc">ToChar</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="ToChar-3864"><a href="#ToChar-3864"><span class="linenos">3864</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="ToChar-3861"><a href="#ToChar-3861"><span class="linenos">3861</span></a><span class="k">class</span> <span class="nc">ToChar</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="ToChar-3862"><a href="#ToChar-3862"><span class="linenos">3862</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -46542,8 +46554,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-3867"><a href="#GenerateSeries-3867"><span class="linenos">3867</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-3868"><a href="#GenerateSeries-3868"><span class="linenos">3868</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-3865"><a href="#GenerateSeries-3865"><span class="linenos">3865</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-3866"><a href="#GenerateSeries-3866"><span class="linenos">3866</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> @@ -46663,8 +46675,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-3871"><a href="#ArrayAgg-3871"><span class="linenos">3871</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-3872"><a href="#ArrayAgg-3872"><span class="linenos">3872</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayAgg-3869"><a href="#ArrayAgg-3869"><span class="linenos">3869</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-3870"><a href="#ArrayAgg-3870"><span class="linenos">3870</span></a> <span class="k">pass</span> </span></pre></div> @@ -46773,8 +46785,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-3875"><a href="#ArrayAll-3875"><span class="linenos">3875</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-3876"><a href="#ArrayAll-3876"><span class="linenos">3876</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3873"><a href="#ArrayAll-3873"><span class="linenos">3873</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-3874"><a href="#ArrayAll-3874"><span class="linenos">3874</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -46894,8 +46906,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-3879"><a href="#ArrayAny-3879"><span class="linenos">3879</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-3880"><a href="#ArrayAny-3880"><span class="linenos">3880</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3877"><a href="#ArrayAny-3877"><span class="linenos">3877</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-3878"><a href="#ArrayAny-3878"><span class="linenos">3878</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -47015,9 +47027,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-3883"><a href="#ArrayConcat-3883"><span class="linenos">3883</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-3884"><a href="#ArrayConcat-3884"><span class="linenos">3884</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3885"><a href="#ArrayConcat-3885"><span class="linenos">3885</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-3881"><a href="#ArrayConcat-3881"><span class="linenos">3881</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-3882"><a href="#ArrayConcat-3882"><span class="linenos">3882</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3883"><a href="#ArrayConcat-3883"><span class="linenos">3883</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -47148,8 +47160,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-3888"><a href="#ArrayContains-3888"><span class="linenos">3888</span></a><span class="k">class</span> <span class="nc">ArrayContains</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="ArrayContains-3889"><a href="#ArrayContains-3889"><span class="linenos">3889</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayContains-3886"><a href="#ArrayContains-3886"><span class="linenos">3886</span></a><span class="k">class</span> <span class="nc">ArrayContains</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="ArrayContains-3887"><a href="#ArrayContains-3887"><span class="linenos">3887</span></a> <span class="k">pass</span> </span></pre></div> @@ -47263,8 +47275,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ArrayContained"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayContained-3892"><a href="#ArrayContained-3892"><span class="linenos">3892</span></a><span class="k">class</span> <span class="nc">ArrayContained</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="ArrayContained-3893"><a href="#ArrayContained-3893"><span class="linenos">3893</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayContained-3890"><a href="#ArrayContained-3890"><span class="linenos">3890</span></a><span class="k">class</span> <span class="nc">ArrayContained</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="ArrayContained-3891"><a href="#ArrayContained-3891"><span class="linenos">3891</span></a> <span class="k">pass</span> </span></pre></div> @@ -47370,9 +47382,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-3896"><a href="#ArrayFilter-3896"><span class="linenos">3896</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-3897"><a href="#ArrayFilter-3897"><span class="linenos">3897</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3898"><a href="#ArrayFilter-3898"><span class="linenos">3898</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-3894"><a href="#ArrayFilter-3894"><span class="linenos">3894</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-3895"><a href="#ArrayFilter-3895"><span class="linenos">3895</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3896"><a href="#ArrayFilter-3896"><span class="linenos">3896</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> @@ -47492,8 +47504,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ArrayJoin"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayJoin-3901"><a href="#ArrayJoin-3901"><span class="linenos">3901</span></a><span class="k">class</span> <span class="nc">ArrayJoin</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="ArrayJoin-3902"><a href="#ArrayJoin-3902"><span class="linenos">3902</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">"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="ArrayJoin-3899"><a href="#ArrayJoin-3899"><span class="linenos">3899</span></a><span class="k">class</span> <span class="nc">ArrayJoin</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="ArrayJoin-3900"><a href="#ArrayJoin-3900"><span class="linenos">3900</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">"null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -47613,8 +47625,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-3905"><a href="#ArraySize-3905"><span class="linenos">3905</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-3906"><a href="#ArraySize-3906"><span class="linenos">3906</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3903"><a href="#ArraySize-3903"><span class="linenos">3903</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-3904"><a href="#ArraySize-3904"><span class="linenos">3904</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -47734,8 +47746,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-3909"><a href="#ArraySort-3909"><span class="linenos">3909</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-3910"><a href="#ArraySort-3910"><span class="linenos">3910</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3907"><a href="#ArraySort-3907"><span class="linenos">3907</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-3908"><a href="#ArraySort-3908"><span class="linenos">3908</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -47855,8 +47867,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-3913"><a href="#ArraySum-3913"><span class="linenos">3913</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-3914"><a href="#ArraySum-3914"><span class="linenos">3914</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArraySum-3911"><a href="#ArraySum-3911"><span class="linenos">3911</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-3912"><a href="#ArraySum-3912"><span class="linenos">3912</span></a> <span class="k">pass</span> </span></pre></div> @@ -47965,8 +47977,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-3917"><a href="#ArrayUnionAgg-3917"><span class="linenos">3917</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-3918"><a href="#ArrayUnionAgg-3918"><span class="linenos">3918</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayUnionAgg-3915"><a href="#ArrayUnionAgg-3915"><span class="linenos">3915</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-3916"><a href="#ArrayUnionAgg-3916"><span class="linenos">3916</span></a> <span class="k">pass</span> </span></pre></div> @@ -48075,8 +48087,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-3921"><a href="#Avg-3921"><span class="linenos">3921</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-3922"><a href="#Avg-3922"><span class="linenos">3922</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Avg-3919"><a href="#Avg-3919"><span class="linenos">3919</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-3920"><a href="#Avg-3920"><span class="linenos">3920</span></a> <span class="k">pass</span> </span></pre></div> @@ -48185,8 +48197,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-3925"><a href="#AnyValue-3925"><span class="linenos">3925</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-3926"><a href="#AnyValue-3926"><span class="linenos">3926</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"having"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"max"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="AnyValue-3923"><a href="#AnyValue-3923"><span class="linenos">3923</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-3924"><a href="#AnyValue-3924"><span class="linenos">3924</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"having"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"max"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -48306,24 +48318,24 @@ 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-3929"><a href="#Case-3929"><span class="linenos">3929</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-3930"><a href="#Case-3930"><span class="linenos">3930</span></a> <span class="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="Case-3931"><a href="#Case-3931"><span class="linenos">3931</span></a> -</span><span id="Case-3932"><a href="#Case-3932"><span class="linenos">3932</span></a> <span class="k">def</span> <span class="nf">when</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condition</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">then</span><span class="p">:</span> <span class="n">ExpOrStr</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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Case</span><span class="p">:</span> -</span><span id="Case-3933"><a href="#Case-3933"><span class="linenos">3933</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="Case-3934"><a href="#Case-3934"><span class="linenos">3934</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> -</span><span id="Case-3935"><a href="#Case-3935"><span class="linenos">3935</span></a> <span class="s2">"ifs"</span><span class="p">,</span> -</span><span id="Case-3936"><a href="#Case-3936"><span class="linenos">3936</span></a> <span class="n">If</span><span class="p">(</span> -</span><span id="Case-3937"><a href="#Case-3937"><span class="linenos">3937</span></a> <span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">condition</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="Case-3938"><a href="#Case-3938"><span class="linenos">3938</span></a> <span class="n">true</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">then</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="Case-3939"><a href="#Case-3939"><span class="linenos">3939</span></a> <span class="p">),</span> -</span><span id="Case-3940"><a href="#Case-3940"><span class="linenos">3940</span></a> <span class="p">)</span> -</span><span id="Case-3941"><a href="#Case-3941"><span class="linenos">3941</span></a> <span class="k">return</span> <span class="n">instance</span> -</span><span id="Case-3942"><a href="#Case-3942"><span class="linenos">3942</span></a> -</span><span id="Case-3943"><a href="#Case-3943"><span class="linenos">3943</span></a> <span class="k">def</span> <span class="nf">else_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condition</span><span class="p">:</span> <span class="n">ExpOrStr</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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Case</span><span class="p">:</span> -</span><span id="Case-3944"><a href="#Case-3944"><span class="linenos">3944</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="Case-3945"><a href="#Case-3945"><span class="linenos">3945</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"default"</span><span class="p">,</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">condition</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> -</span><span id="Case-3946"><a href="#Case-3946"><span class="linenos">3946</span></a> <span class="k">return</span> <span class="n">instance</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Case-3927"><a href="#Case-3927"><span class="linenos">3927</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-3928"><a href="#Case-3928"><span class="linenos">3928</span></a> <span class="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="Case-3929"><a href="#Case-3929"><span class="linenos">3929</span></a> +</span><span id="Case-3930"><a href="#Case-3930"><span class="linenos">3930</span></a> <span class="k">def</span> <span class="nf">when</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condition</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">then</span><span class="p">:</span> <span class="n">ExpOrStr</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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Case</span><span class="p">:</span> +</span><span id="Case-3931"><a href="#Case-3931"><span class="linenos">3931</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="Case-3932"><a href="#Case-3932"><span class="linenos">3932</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> +</span><span id="Case-3933"><a href="#Case-3933"><span class="linenos">3933</span></a> <span class="s2">"ifs"</span><span class="p">,</span> +</span><span id="Case-3934"><a href="#Case-3934"><span class="linenos">3934</span></a> <span class="n">If</span><span class="p">(</span> +</span><span id="Case-3935"><a href="#Case-3935"><span class="linenos">3935</span></a> <span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">condition</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="Case-3936"><a href="#Case-3936"><span class="linenos">3936</span></a> <span class="n">true</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">then</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="Case-3937"><a href="#Case-3937"><span class="linenos">3937</span></a> <span class="p">),</span> +</span><span id="Case-3938"><a href="#Case-3938"><span class="linenos">3938</span></a> <span class="p">)</span> +</span><span id="Case-3939"><a href="#Case-3939"><span class="linenos">3939</span></a> <span class="k">return</span> <span class="n">instance</span> +</span><span id="Case-3940"><a href="#Case-3940"><span class="linenos">3940</span></a> +</span><span id="Case-3941"><a href="#Case-3941"><span class="linenos">3941</span></a> <span class="k">def</span> <span class="nf">else_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condition</span><span class="p">:</span> <span class="n">ExpOrStr</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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Case</span><span class="p">:</span> +</span><span id="Case-3942"><a href="#Case-3942"><span class="linenos">3942</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="Case-3943"><a href="#Case-3943"><span class="linenos">3943</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"default"</span><span class="p">,</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">condition</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> +</span><span id="Case-3944"><a href="#Case-3944"><span class="linenos">3944</span></a> <span class="k">return</span> <span class="n">instance</span> </span></pre></div> @@ -48352,16 +48364,16 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Case.when"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Case.when-3932"><a href="#Case.when-3932"><span class="linenos">3932</span></a> <span class="k">def</span> <span class="nf">when</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condition</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">then</span><span class="p">:</span> <span class="n">ExpOrStr</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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Case</span><span class="p">:</span> -</span><span id="Case.when-3933"><a href="#Case.when-3933"><span class="linenos">3933</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="Case.when-3934"><a href="#Case.when-3934"><span class="linenos">3934</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> -</span><span id="Case.when-3935"><a href="#Case.when-3935"><span class="linenos">3935</span></a> <span class="s2">"ifs"</span><span class="p">,</span> -</span><span id="Case.when-3936"><a href="#Case.when-3936"><span class="linenos">3936</span></a> <span class="n">If</span><span class="p">(</span> -</span><span id="Case.when-3937"><a href="#Case.when-3937"><span class="linenos">3937</span></a> <span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">condition</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="Case.when-3938"><a href="#Case.when-3938"><span class="linenos">3938</span></a> <span class="n">true</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">then</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="Case.when-3939"><a href="#Case.when-3939"><span class="linenos">3939</span></a> <span class="p">),</span> -</span><span id="Case.when-3940"><a href="#Case.when-3940"><span class="linenos">3940</span></a> <span class="p">)</span> -</span><span id="Case.when-3941"><a href="#Case.when-3941"><span class="linenos">3941</span></a> <span class="k">return</span> <span class="n">instance</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Case.when-3930"><a href="#Case.when-3930"><span class="linenos">3930</span></a> <span class="k">def</span> <span class="nf">when</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condition</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">then</span><span class="p">:</span> <span class="n">ExpOrStr</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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Case</span><span class="p">:</span> +</span><span id="Case.when-3931"><a href="#Case.when-3931"><span class="linenos">3931</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="Case.when-3932"><a href="#Case.when-3932"><span class="linenos">3932</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> +</span><span id="Case.when-3933"><a href="#Case.when-3933"><span class="linenos">3933</span></a> <span class="s2">"ifs"</span><span class="p">,</span> +</span><span id="Case.when-3934"><a href="#Case.when-3934"><span class="linenos">3934</span></a> <span class="n">If</span><span class="p">(</span> +</span><span id="Case.when-3935"><a href="#Case.when-3935"><span class="linenos">3935</span></a> <span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">condition</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="Case.when-3936"><a href="#Case.when-3936"><span class="linenos">3936</span></a> <span class="n">true</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">then</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="Case.when-3937"><a href="#Case.when-3937"><span class="linenos">3937</span></a> <span class="p">),</span> +</span><span id="Case.when-3938"><a href="#Case.when-3938"><span class="linenos">3938</span></a> <span class="p">)</span> +</span><span id="Case.when-3939"><a href="#Case.when-3939"><span class="linenos">3939</span></a> <span class="k">return</span> <span class="n">instance</span> </span></pre></div> @@ -48379,10 +48391,10 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Case.else_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Case.else_-3943"><a href="#Case.else_-3943"><span class="linenos">3943</span></a> <span class="k">def</span> <span class="nf">else_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condition</span><span class="p">:</span> <span class="n">ExpOrStr</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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Case</span><span class="p">:</span> -</span><span id="Case.else_-3944"><a href="#Case.else_-3944"><span class="linenos">3944</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="Case.else_-3945"><a href="#Case.else_-3945"><span class="linenos">3945</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"default"</span><span class="p">,</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">condition</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> -</span><span id="Case.else_-3946"><a href="#Case.else_-3946"><span class="linenos">3946</span></a> <span class="k">return</span> <span class="n">instance</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Case.else_-3941"><a href="#Case.else_-3941"><span class="linenos">3941</span></a> <span class="k">def</span> <span class="nf">else_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">condition</span><span class="p">:</span> <span class="n">ExpOrStr</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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Case</span><span class="p">:</span> +</span><span id="Case.else_-3942"><a href="#Case.else_-3942"><span class="linenos">3942</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="Case.else_-3943"><a href="#Case.else_-3943"><span class="linenos">3943</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"default"</span><span class="p">,</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">condition</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> +</span><span id="Case.else_-3944"><a href="#Case.else_-3944"><span class="linenos">3944</span></a> <span class="k">return</span> <span class="n">instance</span> </span></pre></div> @@ -48491,23 +48503,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-3949"><a href="#Cast-3949"><span class="linenos">3949</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-3950"><a href="#Cast-3950"><span class="linenos">3950</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="Cast-3951"><a href="#Cast-3951"><span class="linenos">3951</span></a> -</span><span id="Cast-3952"><a href="#Cast-3952"><span class="linenos">3952</span></a> <span class="nd">@property</span> -</span><span id="Cast-3953"><a href="#Cast-3953"><span class="linenos">3953</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-3954"><a href="#Cast-3954"><span class="linenos">3954</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-3955"><a href="#Cast-3955"><span class="linenos">3955</span></a> -</span><span id="Cast-3956"><a href="#Cast-3956"><span class="linenos">3956</span></a> <span class="nd">@property</span> -</span><span id="Cast-3957"><a href="#Cast-3957"><span class="linenos">3957</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 class="o">-></span> <span class="n">DataType</span><span class="p">:</span> -</span><span id="Cast-3958"><a href="#Cast-3958"><span class="linenos">3958</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-3959"><a href="#Cast-3959"><span class="linenos">3959</span></a> -</span><span id="Cast-3960"><a href="#Cast-3960"><span class="linenos">3960</span></a> <span class="nd">@property</span> -</span><span id="Cast-3961"><a href="#Cast-3961"><span class="linenos">3961</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="Cast-3962"><a href="#Cast-3962"><span class="linenos">3962</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-3963"><a href="#Cast-3963"><span class="linenos">3963</span></a> -</span><span id="Cast-3964"><a href="#Cast-3964"><span class="linenos">3964</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="o">*</span><span class="n">dtypes</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="nb">bool</span><span class="p">:</span> -</span><span id="Cast-3965"><a href="#Cast-3965"><span class="linenos">3965</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="o">*</span><span class="n">dtypes</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Cast-3947"><a href="#Cast-3947"><span class="linenos">3947</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-3948"><a href="#Cast-3948"><span class="linenos">3948</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Cast-3949"><a href="#Cast-3949"><span class="linenos">3949</span></a> +</span><span id="Cast-3950"><a href="#Cast-3950"><span class="linenos">3950</span></a> <span class="nd">@property</span> +</span><span id="Cast-3951"><a href="#Cast-3951"><span class="linenos">3951</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-3952"><a href="#Cast-3952"><span class="linenos">3952</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-3953"><a href="#Cast-3953"><span class="linenos">3953</span></a> +</span><span id="Cast-3954"><a href="#Cast-3954"><span class="linenos">3954</span></a> <span class="nd">@property</span> +</span><span id="Cast-3955"><a href="#Cast-3955"><span class="linenos">3955</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 class="o">-></span> <span class="n">DataType</span><span class="p">:</span> +</span><span id="Cast-3956"><a href="#Cast-3956"><span class="linenos">3956</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-3957"><a href="#Cast-3957"><span class="linenos">3957</span></a> +</span><span id="Cast-3958"><a href="#Cast-3958"><span class="linenos">3958</span></a> <span class="nd">@property</span> +</span><span id="Cast-3959"><a href="#Cast-3959"><span class="linenos">3959</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="Cast-3960"><a href="#Cast-3960"><span class="linenos">3960</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-3961"><a href="#Cast-3961"><span class="linenos">3961</span></a> +</span><span id="Cast-3962"><a href="#Cast-3962"><span class="linenos">3962</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="o">*</span><span class="n">dtypes</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="nb">bool</span><span class="p">:</span> +</span><span id="Cast-3963"><a href="#Cast-3963"><span class="linenos">3963</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="o">*</span><span class="n">dtypes</span><span class="p">)</span> </span></pre></div> @@ -48588,8 +48600,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-3964"><a href="#Cast.is_type-3964"><span class="linenos">3964</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="o">*</span><span class="n">dtypes</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="nb">bool</span><span class="p">:</span> -</span><span id="Cast.is_type-3965"><a href="#Cast.is_type-3965"><span class="linenos">3965</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="o">*</span><span class="n">dtypes</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Cast.is_type-3962"><a href="#Cast.is_type-3962"><span class="linenos">3962</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="o">*</span><span class="n">dtypes</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="nb">bool</span><span class="p">:</span> +</span><span id="Cast.is_type-3963"><a href="#Cast.is_type-3963"><span class="linenos">3963</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="o">*</span><span class="n">dtypes</span><span class="p">)</span> </span></pre></div> @@ -48696,8 +48708,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#CastToStrType"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CastToStrType-3968"><a href="#CastToStrType-3968"><span class="linenos">3968</span></a><span class="k">class</span> <span class="nc">CastToStrType</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="CastToStrType-3969"><a href="#CastToStrType-3969"><span class="linenos">3969</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="CastToStrType-3966"><a href="#CastToStrType-3966"><span class="linenos">3966</span></a><span class="k">class</span> <span class="nc">CastToStrType</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="CastToStrType-3967"><a href="#CastToStrType-3967"><span class="linenos">3967</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -48817,8 +48829,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-3972"><a href="#Collate-3972"><span class="linenos">3972</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-3973"><a href="#Collate-3973"><span class="linenos">3973</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Collate-3970"><a href="#Collate-3970"><span class="linenos">3970</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-3971"><a href="#Collate-3971"><span class="linenos">3971</span></a> <span class="k">pass</span> </span></pre></div> @@ -48924,8 +48936,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-3976"><a href="#TryCast-3976"><span class="linenos">3976</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-3977"><a href="#TryCast-3977"><span class="linenos">3977</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TryCast-3974"><a href="#TryCast-3974"><span class="linenos">3974</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-3975"><a href="#TryCast-3975"><span class="linenos">3975</span></a> <span class="k">pass</span> </span></pre></div> @@ -49039,9 +49051,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-3980"><a href="#Ceil-3980"><span class="linenos">3980</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-3981"><a href="#Ceil-3981"><span class="linenos">3981</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3982"><a href="#Ceil-3982"><span class="linenos">3982</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-3978"><a href="#Ceil-3978"><span class="linenos">3978</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-3979"><a href="#Ceil-3979"><span class="linenos">3979</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3980"><a href="#Ceil-3980"><span class="linenos">3980</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> @@ -49161,10 +49173,10 @@ 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-3985"><a href="#Coalesce-3985"><span class="linenos">3985</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-3986"><a href="#Coalesce-3986"><span class="linenos">3986</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3987"><a href="#Coalesce-3987"><span class="linenos">3987</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="Coalesce-3988"><a href="#Coalesce-3988"><span class="linenos">3988</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"COALESCE"</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="Coalesce-3983"><a href="#Coalesce-3983"><span class="linenos">3983</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-3984"><a href="#Coalesce-3984"><span class="linenos">3984</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-3985"><a href="#Coalesce-3985"><span class="linenos">3985</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="Coalesce-3986"><a href="#Coalesce-3986"><span class="linenos">3986</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"COALESCE"</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> @@ -49295,9 +49307,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-3991"><a href="#Concat-3991"><span class="linenos">3991</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-3992"><a href="#Concat-3992"><span class="linenos">3992</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-3993"><a href="#Concat-3993"><span class="linenos">3993</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-3989"><a href="#Concat-3989"><span class="linenos">3989</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-3990"><a href="#Concat-3990"><span class="linenos">3990</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-3991"><a href="#Concat-3991"><span class="linenos">3991</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -49428,8 +49440,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#SafeConcat"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SafeConcat-3996"><a href="#SafeConcat-3996"><span class="linenos">3996</span></a><span class="k">class</span> <span class="nc">SafeConcat</span><span class="p">(</span><span class="n">Concat</span><span class="p">):</span> -</span><span id="SafeConcat-3997"><a href="#SafeConcat-3997"><span class="linenos">3997</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SafeConcat-3994"><a href="#SafeConcat-3994"><span class="linenos">3994</span></a><span class="k">class</span> <span class="nc">SafeConcat</span><span class="p">(</span><span class="n">Concat</span><span class="p">):</span> +</span><span id="SafeConcat-3995"><a href="#SafeConcat-3995"><span class="linenos">3995</span></a> <span class="k">pass</span> </span></pre></div> @@ -49541,8 +49553,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-4000"><a href="#ConcatWs-4000"><span class="linenos">4000</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-4001"><a href="#ConcatWs-4001"><span class="linenos">4001</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-3998"><a href="#ConcatWs-3998"><span class="linenos">3998</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-3999"><a href="#ConcatWs-3999"><span class="linenos">3999</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> @@ -49654,9 +49666,9 @@ 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-4004"><a href="#Count-4004"><span class="linenos">4004</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-4005"><a href="#Count-4005"><span class="linenos">4005</span></a> <span class="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="Count-4006"><a href="#Count-4006"><span class="linenos">4006</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="Count-4002"><a href="#Count-4002"><span class="linenos">4002</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-4003"><a href="#Count-4003"><span class="linenos">4003</span></a> <span class="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="Count-4004"><a href="#Count-4004"><span class="linenos">4004</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -49787,8 +49799,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#CountIf"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CountIf-4009"><a href="#CountIf-4009"><span class="linenos">4009</span></a><span class="k">class</span> <span class="nc">CountIf</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="CountIf-4010"><a href="#CountIf-4010"><span class="linenos">4010</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CountIf-4007"><a href="#CountIf-4007"><span class="linenos">4007</span></a><span class="k">class</span> <span class="nc">CountIf</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="CountIf-4008"><a href="#CountIf-4008"><span class="linenos">4008</span></a> <span class="k">pass</span> </span></pre></div> @@ -49897,8 +49909,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-4013"><a href="#CurrentDate-4013"><span class="linenos">4013</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-4014"><a href="#CurrentDate-4014"><span class="linenos">4014</span></a> <span class="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-4011"><a href="#CurrentDate-4011"><span class="linenos">4011</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-4012"><a href="#CurrentDate-4012"><span class="linenos">4012</span></a> <span class="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> @@ -50018,8 +50030,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-4017"><a href="#CurrentDatetime-4017"><span class="linenos">4017</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-4018"><a href="#CurrentDatetime-4018"><span class="linenos">4018</span></a> <span class="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-4015"><a href="#CurrentDatetime-4015"><span class="linenos">4015</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-4016"><a href="#CurrentDatetime-4016"><span class="linenos">4016</span></a> <span class="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> @@ -50139,8 +50151,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-4021"><a href="#CurrentTime-4021"><span class="linenos">4021</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-4022"><a href="#CurrentTime-4022"><span class="linenos">4022</span></a> <span class="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-4019"><a href="#CurrentTime-4019"><span class="linenos">4019</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-4020"><a href="#CurrentTime-4020"><span class="linenos">4020</span></a> <span class="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> @@ -50260,8 +50272,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-4025"><a href="#CurrentTimestamp-4025"><span class="linenos">4025</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-4026"><a href="#CurrentTimestamp-4026"><span class="linenos">4026</span></a> <span class="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-4023"><a href="#CurrentTimestamp-4023"><span class="linenos">4023</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-4024"><a href="#CurrentTimestamp-4024"><span class="linenos">4024</span></a> <span class="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> @@ -50381,8 +50393,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#CurrentUser"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CurrentUser-4029"><a href="#CurrentUser-4029"><span class="linenos">4029</span></a><span class="k">class</span> <span class="nc">CurrentUser</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="CurrentUser-4030"><a href="#CurrentUser-4030"><span class="linenos">4030</span></a> <span class="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="CurrentUser-4027"><a href="#CurrentUser-4027"><span class="linenos">4027</span></a><span class="k">class</span> <span class="nc">CurrentUser</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="CurrentUser-4028"><a href="#CurrentUser-4028"><span class="linenos">4028</span></a> <span class="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> @@ -50502,8 +50514,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-4033"><a href="#DateAdd-4033"><span class="linenos">4033</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-4034"><a href="#DateAdd-4034"><span class="linenos">4034</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4031"><a href="#DateAdd-4031"><span class="linenos">4031</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-4032"><a href="#DateAdd-4032"><span class="linenos">4032</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -50626,8 +50638,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-4037"><a href="#DateSub-4037"><span class="linenos">4037</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-4038"><a href="#DateSub-4038"><span class="linenos">4038</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4035"><a href="#DateSub-4035"><span class="linenos">4035</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-4036"><a href="#DateSub-4036"><span class="linenos">4036</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -50750,9 +50762,9 @@ 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-4041"><a href="#DateDiff-4041"><span class="linenos">4041</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-4042"><a href="#DateDiff-4042"><span class="linenos">4042</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DATEDIFF"</span><span class="p">,</span> <span class="s2">"DATE_DIFF"</span><span class="p">]</span> -</span><span id="DateDiff-4043"><a href="#DateDiff-4043"><span class="linenos">4043</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4039"><a href="#DateDiff-4039"><span class="linenos">4039</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-4040"><a href="#DateDiff-4040"><span class="linenos">4040</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DATEDIFF"</span><span class="p">,</span> <span class="s2">"DATE_DIFF"</span><span class="p">]</span> +</span><span id="DateDiff-4041"><a href="#DateDiff-4041"><span class="linenos">4041</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -50875,8 +50887,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-4046"><a href="#DateTrunc-4046"><span class="linenos">4046</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-4047"><a href="#DateTrunc-4047"><span class="linenos">4047</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-4044"><a href="#DateTrunc-4044"><span class="linenos">4044</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-4045"><a href="#DateTrunc-4045"><span class="linenos">4045</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> @@ -50996,8 +51008,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-4050"><a href="#DatetimeAdd-4050"><span class="linenos">4050</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-4051"><a href="#DatetimeAdd-4051"><span class="linenos">4051</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4048"><a href="#DatetimeAdd-4048"><span class="linenos">4048</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-4049"><a href="#DatetimeAdd-4049"><span class="linenos">4049</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -51120,8 +51132,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-4054"><a href="#DatetimeSub-4054"><span class="linenos">4054</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-4055"><a href="#DatetimeSub-4055"><span class="linenos">4055</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4052"><a href="#DatetimeSub-4052"><span class="linenos">4052</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-4053"><a href="#DatetimeSub-4053"><span class="linenos">4053</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -51244,8 +51256,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-4058"><a href="#DatetimeDiff-4058"><span class="linenos">4058</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-4059"><a href="#DatetimeDiff-4059"><span class="linenos">4059</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4056"><a href="#DatetimeDiff-4056"><span class="linenos">4056</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-4057"><a href="#DatetimeDiff-4057"><span class="linenos">4057</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -51368,8 +51380,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-4062"><a href="#DatetimeTrunc-4062"><span class="linenos">4062</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-4063"><a href="#DatetimeTrunc-4063"><span class="linenos">4063</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4060"><a href="#DatetimeTrunc-4060"><span class="linenos">4060</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-4061"><a href="#DatetimeTrunc-4061"><span class="linenos">4061</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -51492,8 +51504,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-4066"><a href="#DayOfWeek-4066"><span class="linenos">4066</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-4067"><a href="#DayOfWeek-4067"><span class="linenos">4067</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-4064"><a href="#DayOfWeek-4064"><span class="linenos">4064</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-4065"><a href="#DayOfWeek-4065"><span class="linenos">4065</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> @@ -51602,8 +51614,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-4070"><a href="#DayOfMonth-4070"><span class="linenos">4070</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-4071"><a href="#DayOfMonth-4071"><span class="linenos">4071</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-4068"><a href="#DayOfMonth-4068"><span class="linenos">4068</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-4069"><a href="#DayOfMonth-4069"><span class="linenos">4069</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> @@ -51712,8 +51724,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-4074"><a href="#DayOfYear-4074"><span class="linenos">4074</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-4075"><a href="#DayOfYear-4075"><span class="linenos">4075</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-4072"><a href="#DayOfYear-4072"><span class="linenos">4072</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-4073"><a href="#DayOfYear-4073"><span class="linenos">4073</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> @@ -51822,8 +51834,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-4078"><a href="#WeekOfYear-4078"><span class="linenos">4078</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-4079"><a href="#WeekOfYear-4079"><span class="linenos">4079</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-4076"><a href="#WeekOfYear-4076"><span class="linenos">4076</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-4077"><a href="#WeekOfYear-4077"><span class="linenos">4077</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> @@ -51932,8 +51944,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-4082"><a href="#LastDateOfMonth-4082"><span class="linenos">4082</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-4083"><a href="#LastDateOfMonth-4083"><span class="linenos">4083</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LastDateOfMonth-4080"><a href="#LastDateOfMonth-4080"><span class="linenos">4080</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-4081"><a href="#LastDateOfMonth-4081"><span class="linenos">4081</span></a> <span class="k">pass</span> </span></pre></div> @@ -52042,8 +52054,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-4086"><a href="#Extract-4086"><span class="linenos">4086</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-4087"><a href="#Extract-4087"><span class="linenos">4087</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4084"><a href="#Extract-4084"><span class="linenos">4084</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-4085"><a href="#Extract-4085"><span class="linenos">4085</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -52163,8 +52175,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-4090"><a href="#TimestampAdd-4090"><span class="linenos">4090</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-4091"><a href="#TimestampAdd-4091"><span class="linenos">4091</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4088"><a href="#TimestampAdd-4088"><span class="linenos">4088</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-4089"><a href="#TimestampAdd-4089"><span class="linenos">4089</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -52287,8 +52299,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-4094"><a href="#TimestampSub-4094"><span class="linenos">4094</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-4095"><a href="#TimestampSub-4095"><span class="linenos">4095</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4092"><a href="#TimestampSub-4092"><span class="linenos">4092</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-4093"><a href="#TimestampSub-4093"><span class="linenos">4093</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -52411,8 +52423,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-4098"><a href="#TimestampDiff-4098"><span class="linenos">4098</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-4099"><a href="#TimestampDiff-4099"><span class="linenos">4099</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4096"><a href="#TimestampDiff-4096"><span class="linenos">4096</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-4097"><a href="#TimestampDiff-4097"><span class="linenos">4097</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -52535,8 +52547,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-4102"><a href="#TimestampTrunc-4102"><span class="linenos">4102</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-4103"><a href="#TimestampTrunc-4103"><span class="linenos">4103</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4100"><a href="#TimestampTrunc-4100"><span class="linenos">4100</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-4101"><a href="#TimestampTrunc-4101"><span class="linenos">4101</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -52659,8 +52671,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-4106"><a href="#TimeAdd-4106"><span class="linenos">4106</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-4107"><a href="#TimeAdd-4107"><span class="linenos">4107</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4104"><a href="#TimeAdd-4104"><span class="linenos">4104</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-4105"><a href="#TimeAdd-4105"><span class="linenos">4105</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -52783,8 +52795,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-4110"><a href="#TimeSub-4110"><span class="linenos">4110</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-4111"><a href="#TimeSub-4111"><span class="linenos">4111</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4108"><a href="#TimeSub-4108"><span class="linenos">4108</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-4109"><a href="#TimeSub-4109"><span class="linenos">4109</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -52907,8 +52919,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-4114"><a href="#TimeDiff-4114"><span class="linenos">4114</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-4115"><a href="#TimeDiff-4115"><span class="linenos">4115</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4112"><a href="#TimeDiff-4112"><span class="linenos">4112</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-4113"><a href="#TimeDiff-4113"><span class="linenos">4113</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -53031,8 +53043,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-4118"><a href="#TimeTrunc-4118"><span class="linenos">4118</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-4119"><a href="#TimeTrunc-4119"><span class="linenos">4119</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4116"><a href="#TimeTrunc-4116"><span class="linenos">4116</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-4117"><a href="#TimeTrunc-4117"><span class="linenos">4117</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -53155,9 +53167,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-4122"><a href="#DateFromParts-4122"><span class="linenos">4122</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-4123"><a href="#DateFromParts-4123"><span class="linenos">4123</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-4124"><a href="#DateFromParts-4124"><span class="linenos">4124</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-4120"><a href="#DateFromParts-4120"><span class="linenos">4120</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-4121"><a href="#DateFromParts-4121"><span class="linenos">4121</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-4122"><a href="#DateFromParts-4122"><span class="linenos">4122</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> @@ -53277,8 +53289,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-4127"><a href="#DateStrToDate-4127"><span class="linenos">4127</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-4128"><a href="#DateStrToDate-4128"><span class="linenos">4128</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DateStrToDate-4125"><a href="#DateStrToDate-4125"><span class="linenos">4125</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-4126"><a href="#DateStrToDate-4126"><span class="linenos">4126</span></a> <span class="k">pass</span> </span></pre></div> @@ -53387,8 +53399,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-4131"><a href="#DateToDateStr-4131"><span class="linenos">4131</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-4132"><a href="#DateToDateStr-4132"><span class="linenos">4132</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DateToDateStr-4129"><a href="#DateToDateStr-4129"><span class="linenos">4129</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-4130"><a href="#DateToDateStr-4130"><span class="linenos">4130</span></a> <span class="k">pass</span> </span></pre></div> @@ -53497,8 +53509,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-4135"><a href="#DateToDi-4135"><span class="linenos">4135</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-4136"><a href="#DateToDi-4136"><span class="linenos">4136</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DateToDi-4133"><a href="#DateToDi-4133"><span class="linenos">4133</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-4134"><a href="#DateToDi-4134"><span class="linenos">4134</span></a> <span class="k">pass</span> </span></pre></div> @@ -53607,9 +53619,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Date"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Date-4139"><a href="#Date-4139"><span class="linenos">4139</span></a><span class="k">class</span> <span class="nc">Date</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Date-4140"><a href="#Date-4140"><span class="linenos">4140</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="Date-4141"><a href="#Date-4141"><span class="linenos">4141</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="Date-4137"><a href="#Date-4137"><span class="linenos">4137</span></a><span class="k">class</span> <span class="nc">Date</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Date-4138"><a href="#Date-4138"><span class="linenos">4138</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="Date-4139"><a href="#Date-4139"><span class="linenos">4139</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -53740,8 +53752,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-4144"><a href="#Day-4144"><span class="linenos">4144</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-4145"><a href="#Day-4145"><span class="linenos">4145</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Day-4142"><a href="#Day-4142"><span class="linenos">4142</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-4143"><a href="#Day-4143"><span class="linenos">4143</span></a> <span class="k">pass</span> </span></pre></div> @@ -53850,8 +53862,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-4148"><a href="#Decode-4148"><span class="linenos">4148</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-4149"><a href="#Decode-4149"><span class="linenos">4149</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4146"><a href="#Decode-4146"><span class="linenos">4146</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-4147"><a href="#Decode-4147"><span class="linenos">4147</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -53971,8 +53983,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-4152"><a href="#DiToDate-4152"><span class="linenos">4152</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-4153"><a href="#DiToDate-4153"><span class="linenos">4153</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DiToDate-4150"><a href="#DiToDate-4150"><span class="linenos">4150</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-4151"><a href="#DiToDate-4151"><span class="linenos">4151</span></a> <span class="k">pass</span> </span></pre></div> @@ -54081,8 +54093,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-4156"><a href="#Encode-4156"><span class="linenos">4156</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-4157"><a href="#Encode-4157"><span class="linenos">4157</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4154"><a href="#Encode-4154"><span class="linenos">4154</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-4155"><a href="#Encode-4155"><span class="linenos">4155</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -54202,8 +54214,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-4160"><a href="#Exp-4160"><span class="linenos">4160</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-4161"><a href="#Exp-4161"><span class="linenos">4161</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Exp-4158"><a href="#Exp-4158"><span class="linenos">4158</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-4159"><a href="#Exp-4159"><span class="linenos">4159</span></a> <span class="k">pass</span> </span></pre></div> @@ -54312,8 +54324,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-4164"><a href="#Explode-4164"><span class="linenos">4164</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-4165"><a href="#Explode-4165"><span class="linenos">4165</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Explode-4162"><a href="#Explode-4162"><span class="linenos">4162</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-4163"><a href="#Explode-4163"><span class="linenos">4163</span></a> <span class="k">pass</span> </span></pre></div> @@ -54422,8 +54434,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-4168"><a href="#Floor-4168"><span class="linenos">4168</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-4169"><a href="#Floor-4169"><span class="linenos">4169</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4166"><a href="#Floor-4166"><span class="linenos">4166</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-4167"><a href="#Floor-4167"><span class="linenos">4167</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -54543,8 +54555,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#FromBase64"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="FromBase64-4172"><a href="#FromBase64-4172"><span class="linenos">4172</span></a><span class="k">class</span> <span class="nc">FromBase64</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="FromBase64-4173"><a href="#FromBase64-4173"><span class="linenos">4173</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="FromBase64-4170"><a href="#FromBase64-4170"><span class="linenos">4170</span></a><span class="k">class</span> <span class="nc">FromBase64</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="FromBase64-4171"><a href="#FromBase64-4171"><span class="linenos">4171</span></a> <span class="k">pass</span> </span></pre></div> @@ -54653,8 +54665,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ToBase64"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ToBase64-4176"><a href="#ToBase64-4176"><span class="linenos">4176</span></a><span class="k">class</span> <span class="nc">ToBase64</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="ToBase64-4177"><a href="#ToBase64-4177"><span class="linenos">4177</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ToBase64-4174"><a href="#ToBase64-4174"><span class="linenos">4174</span></a><span class="k">class</span> <span class="nc">ToBase64</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="ToBase64-4175"><a href="#ToBase64-4175"><span class="linenos">4175</span></a> <span class="k">pass</span> </span></pre></div> @@ -54763,9 +54775,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-4180"><a href="#Greatest-4180"><span class="linenos">4180</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-4181"><a href="#Greatest-4181"><span class="linenos">4181</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4182"><a href="#Greatest-4182"><span class="linenos">4182</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-4178"><a href="#Greatest-4178"><span class="linenos">4178</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-4179"><a href="#Greatest-4179"><span class="linenos">4179</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4180"><a href="#Greatest-4180"><span class="linenos">4180</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -54896,8 +54908,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-4185"><a href="#GroupConcat-4185"><span class="linenos">4185</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-4186"><a href="#GroupConcat-4186"><span class="linenos">4186</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4183"><a href="#GroupConcat-4183"><span class="linenos">4183</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-4184"><a href="#GroupConcat-4184"><span class="linenos">4184</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -55017,8 +55029,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-4189"><a href="#Hex-4189"><span class="linenos">4189</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-4190"><a href="#Hex-4190"><span class="linenos">4190</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Hex-4187"><a href="#Hex-4187"><span class="linenos">4187</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-4188"><a href="#Hex-4188"><span class="linenos">4188</span></a> <span class="k">pass</span> </span></pre></div> @@ -55127,8 +55139,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-4193"><a href="#If-4193"><span class="linenos">4193</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-4194"><a href="#If-4194"><span class="linenos">4194</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4191"><a href="#If-4191"><span class="linenos">4191</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-4192"><a href="#If-4192"><span class="linenos">4192</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -55248,8 +55260,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-4197"><a href="#Initcap-4197"><span class="linenos">4197</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-4198"><a href="#Initcap-4198"><span class="linenos">4198</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="Initcap-4195"><a href="#Initcap-4195"><span class="linenos">4195</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-4196"><a href="#Initcap-4196"><span class="linenos">4196</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -55369,8 +55381,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#JSONKeyValue"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="JSONKeyValue-4201"><a href="#JSONKeyValue-4201"><span class="linenos">4201</span></a><span class="k">class</span> <span class="nc">JSONKeyValue</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="JSONKeyValue-4202"><a href="#JSONKeyValue-4202"><span class="linenos">4202</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="JSONKeyValue-4199"><a href="#JSONKeyValue-4199"><span class="linenos">4199</span></a><span class="k">class</span> <span class="nc">JSONKeyValue</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="JSONKeyValue-4200"><a href="#JSONKeyValue-4200"><span class="linenos">4200</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -55467,15 +55479,15 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#JSONObject"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="JSONObject-4205"><a href="#JSONObject-4205"><span class="linenos">4205</span></a><span class="k">class</span> <span class="nc">JSONObject</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="JSONObject-4206"><a href="#JSONObject-4206"><span class="linenos">4206</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="JSONObject-4207"><a href="#JSONObject-4207"><span class="linenos">4207</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="JSONObject-4208"><a href="#JSONObject-4208"><span class="linenos">4208</span></a> <span class="s2">"null_handling"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="JSONObject-4209"><a href="#JSONObject-4209"><span class="linenos">4209</span></a> <span class="s2">"unique_keys"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="JSONObject-4210"><a href="#JSONObject-4210"><span class="linenos">4210</span></a> <span class="s2">"return_type"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="JSONObject-4211"><a href="#JSONObject-4211"><span class="linenos">4211</span></a> <span class="s2">"format_json"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="JSONObject-4212"><a href="#JSONObject-4212"><span class="linenos">4212</span></a> <span class="s2">"encoding"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="JSONObject-4213"><a href="#JSONObject-4213"><span class="linenos">4213</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="JSONObject-4203"><a href="#JSONObject-4203"><span class="linenos">4203</span></a><span class="k">class</span> <span class="nc">JSONObject</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="JSONObject-4204"><a href="#JSONObject-4204"><span class="linenos">4204</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="JSONObject-4205"><a href="#JSONObject-4205"><span class="linenos">4205</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="JSONObject-4206"><a href="#JSONObject-4206"><span class="linenos">4206</span></a> <span class="s2">"null_handling"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="JSONObject-4207"><a href="#JSONObject-4207"><span class="linenos">4207</span></a> <span class="s2">"unique_keys"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="JSONObject-4208"><a href="#JSONObject-4208"><span class="linenos">4208</span></a> <span class="s2">"return_type"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="JSONObject-4209"><a href="#JSONObject-4209"><span class="linenos">4209</span></a> <span class="s2">"format_json"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="JSONObject-4210"><a href="#JSONObject-4210"><span class="linenos">4210</span></a> <span class="s2">"encoding"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="JSONObject-4211"><a href="#JSONObject-4211"><span class="linenos">4211</span></a> <span class="p">}</span> </span></pre></div> @@ -55596,8 +55608,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#OpenJSONColumnDef"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="OpenJSONColumnDef-4216"><a href="#OpenJSONColumnDef-4216"><span class="linenos">4216</span></a><span class="k">class</span> <span class="nc">OpenJSONColumnDef</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="OpenJSONColumnDef-4217"><a href="#OpenJSONColumnDef-4217"><span class="linenos">4217</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">True</span><span class="p">,</span> <span class="s2">"path"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"as_json"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="OpenJSONColumnDef-4214"><a href="#OpenJSONColumnDef-4214"><span class="linenos">4214</span></a><span class="k">class</span> <span class="nc">OpenJSONColumnDef</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="OpenJSONColumnDef-4215"><a href="#OpenJSONColumnDef-4215"><span class="linenos">4215</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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">True</span><span class="p">,</span> <span class="s2">"path"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"as_json"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -55694,8 +55706,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#OpenJSON"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="OpenJSON-4220"><a href="#OpenJSON-4220"><span class="linenos">4220</span></a><span class="k">class</span> <span class="nc">OpenJSON</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="OpenJSON-4221"><a href="#OpenJSON-4221"><span class="linenos">4221</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"path"</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="OpenJSON-4218"><a href="#OpenJSON-4218"><span class="linenos">4218</span></a><span class="k">class</span> <span class="nc">OpenJSON</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="OpenJSON-4219"><a href="#OpenJSON-4219"><span class="linenos">4219</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"path"</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> @@ -55815,8 +55827,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-4224"><a href="#JSONBContains-4224"><span class="linenos">4224</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-4225"><a href="#JSONBContains-4225"><span class="linenos">4225</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-4222"><a href="#JSONBContains-4222"><span class="linenos">4222</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-4223"><a href="#JSONBContains-4223"><span class="linenos">4223</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> @@ -55922,8 +55934,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-4228"><a href="#JSONExtract-4228"><span class="linenos">4228</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-4229"><a href="#JSONExtract-4229"><span class="linenos">4229</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-4226"><a href="#JSONExtract-4226"><span class="linenos">4226</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-4227"><a href="#JSONExtract-4227"><span class="linenos">4227</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> @@ -56037,8 +56049,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-4232"><a href="#JSONExtractScalar-4232"><span class="linenos">4232</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-4233"><a href="#JSONExtractScalar-4233"><span class="linenos">4233</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-4230"><a href="#JSONExtractScalar-4230"><span class="linenos">4230</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-4231"><a href="#JSONExtractScalar-4231"><span class="linenos">4231</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> @@ -56152,8 +56164,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-4236"><a href="#JSONBExtract-4236"><span class="linenos">4236</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-4237"><a href="#JSONBExtract-4237"><span class="linenos">4237</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-4234"><a href="#JSONBExtract-4234"><span class="linenos">4234</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-4235"><a href="#JSONBExtract-4235"><span class="linenos">4235</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> @@ -56267,8 +56279,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-4240"><a href="#JSONBExtractScalar-4240"><span class="linenos">4240</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-4241"><a href="#JSONBExtractScalar-4241"><span class="linenos">4241</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-4238"><a href="#JSONBExtractScalar-4238"><span class="linenos">4238</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-4239"><a href="#JSONBExtractScalar-4239"><span class="linenos">4239</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> @@ -56382,9 +56394,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#JSONFormat"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="JSONFormat-4244"><a href="#JSONFormat-4244"><span class="linenos">4244</span></a><span class="k">class</span> <span class="nc">JSONFormat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="JSONFormat-4245"><a href="#JSONFormat-4245"><span class="linenos">4245</span></a> <span class="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">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="JSONFormat-4246"><a href="#JSONFormat-4246"><span class="linenos">4246</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_FORMAT"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="JSONFormat-4242"><a href="#JSONFormat-4242"><span class="linenos">4242</span></a><span class="k">class</span> <span class="nc">JSONFormat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="JSONFormat-4243"><a href="#JSONFormat-4243"><span class="linenos">4243</span></a> <span class="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">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="JSONFormat-4244"><a href="#JSONFormat-4244"><span class="linenos">4244</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_FORMAT"</span><span class="p">]</span> </span></pre></div> @@ -56493,6 +56505,121 @@ name is set to the expression's class name transformed to snake case.</li> </dl> </div> </section> + <section id="JSONArrayContains"> + <input id="JSONArrayContains-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">JSONArrayContains</span><wbr>(<span class="base"><a href="#Binary">Binary</a></span>, <span class="base"><a href="#Predicate">Predicate</a></span>, <span class="base"><a href="#Func">Func</a></span>): + + <label class="view-source-button" for="JSONArrayContains-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#JSONArrayContains"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="JSONArrayContains-4248"><a href="#JSONArrayContains-4248"><span class="linenos">4248</span></a><span class="k">class</span> <span class="nc">JSONArrayContains</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> +</span><span id="JSONArrayContains-4249"><a href="#JSONArrayContains-4249"><span class="linenos">4249</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_ARRAY_CONTAINS"</span><span class="p">]</span> +</span></pre></div> + + + + + <div id="JSONArrayContains.key" class="classattr"> + <div class="attr variable"> + <span class="name">key</span> = +<span class="default_value">'jsonarraycontains'</span> + + + </div> + <a class="headerlink" href="#JSONArrayContains.key"></a> + + + + </div> + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="JSONArrayContains.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="JSONArrayContains.args" class="variable"><a href="#Expression.args">args</a></dd> + <dd id="JSONArrayContains.parent" class="variable"><a href="#Expression.parent">parent</a></dd> + <dd id="JSONArrayContains.arg_key" class="variable"><a href="#Expression.arg_key">arg_key</a></dd> + <dd id="JSONArrayContains.comments" class="variable"><a href="#Expression.comments">comments</a></dd> + <dd id="JSONArrayContains.hashable_args" class="variable"><a href="#Expression.hashable_args">hashable_args</a></dd> + <dd id="JSONArrayContains.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="JSONArrayContains.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="JSONArrayContains.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="JSONArrayContains.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="JSONArrayContains.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="JSONArrayContains.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="JSONArrayContains.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="JSONArrayContains.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="JSONArrayContains.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="JSONArrayContains.name" class="variable"><a href="#Expression.name">name</a></dd> + <dd id="JSONArrayContains.alias_or_name" class="variable"><a href="#Expression.alias_or_name">alias_or_name</a></dd> + <dd id="JSONArrayContains.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="JSONArrayContains.type" class="variable"><a href="#Expression.type">type</a></dd> + <dd id="JSONArrayContains.meta" class="variable"><a href="#Expression.meta">meta</a></dd> + <dd id="JSONArrayContains.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="JSONArrayContains.add_comments" class="function"><a href="#Expression.add_comments">add_comments</a></dd> + <dd id="JSONArrayContains.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="JSONArrayContains.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="JSONArrayContains.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="JSONArrayContains.iter_expressions" class="function"><a href="#Expression.iter_expressions">iter_expressions</a></dd> + <dd id="JSONArrayContains.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="JSONArrayContains.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="JSONArrayContains.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="JSONArrayContains.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="JSONArrayContains.same_parent" class="variable"><a href="#Expression.same_parent">same_parent</a></dd> + <dd id="JSONArrayContains.root" class="function"><a href="#Expression.root">root</a></dd> + <dd id="JSONArrayContains.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="JSONArrayContains.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="JSONArrayContains.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="JSONArrayContains.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="JSONArrayContains.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="JSONArrayContains.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="JSONArrayContains.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="JSONArrayContains.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="JSONArrayContains.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="JSONArrayContains.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="JSONArrayContains.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="JSONArrayContains.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="JSONArrayContains.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="JSONArrayContains.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="JSONArrayContains.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + <div><dt><a href="#Binary">Binary</a></dt> + <dd id="JSONArrayContains.arg_types" class="variable"><a href="#Binary.arg_types">arg_types</a></dd> + <dd id="JSONArrayContains.left" class="variable"><a href="#Binary.left">left</a></dd> + <dd id="JSONArrayContains.right" class="variable"><a href="#Binary.right">right</a></dd> + + </div> + <div><dt><a href="#Func">Func</a></dt> + <dd id="JSONArrayContains.is_var_len_args" class="variable"><a href="#Func.is_var_len_args">is_var_len_args</a></dd> + <dd id="JSONArrayContains.from_arg_list" class="function"><a href="#Func.from_arg_list">from_arg_list</a></dd> + <dd id="JSONArrayContains.sql_names" class="function"><a href="#Func.sql_names">sql_names</a></dd> + <dd id="JSONArrayContains.sql_name" class="function"><a href="#Func.sql_name">sql_name</a></dd> + <dd id="JSONArrayContains.default_parser_mappings" class="function"><a href="#Func.default_parser_mappings">default_parser_mappings</a></dd> + + </div> + <div><dt><a href="#Condition">Condition</a></dt> + <dd id="JSONArrayContains.and_" class="function"><a href="#Condition.and_">and_</a></dd> + <dd id="JSONArrayContains.or_" class="function"><a href="#Condition.or_">or_</a></dd> + <dd id="JSONArrayContains.not_" class="function"><a href="#Condition.not_">not_</a></dd> + <dd id="JSONArrayContains.as_" class="function"><a href="#Condition.as_">as_</a></dd> + <dd id="JSONArrayContains.isin" class="function"><a href="#Condition.isin">isin</a></dd> + <dd id="JSONArrayContains.between" class="function"><a href="#Condition.between">between</a></dd> + <dd id="JSONArrayContains.is_" class="function"><a href="#Condition.is_">is_</a></dd> + <dd id="JSONArrayContains.like" class="function"><a href="#Condition.like">like</a></dd> + <dd id="JSONArrayContains.ilike" class="function"><a href="#Condition.ilike">ilike</a></dd> + <dd id="JSONArrayContains.eq" class="function"><a href="#Condition.eq">eq</a></dd> + <dd id="JSONArrayContains.neq" class="function"><a href="#Condition.neq">neq</a></dd> + <dd id="JSONArrayContains.rlike" class="function"><a href="#Condition.rlike">rlike</a></dd> + + </div> + </dl> + </div> + </section> <section id="Least"> <input id="Least-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> @@ -56504,9 +56631,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-4249"><a href="#Least-4249"><span class="linenos">4249</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-4250"><a href="#Least-4250"><span class="linenos">4250</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="Least-4251"><a href="#Least-4251"><span class="linenos">4251</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-4252"><a href="#Least-4252"><span class="linenos">4252</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-4253"><a href="#Least-4253"><span class="linenos">4253</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="Least-4254"><a href="#Least-4254"><span class="linenos">4254</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -56637,8 +56764,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Left"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Left-4254"><a href="#Left-4254"><span class="linenos">4254</span></a><span class="k">class</span> <span class="nc">Left</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Left-4255"><a href="#Left-4255"><span class="linenos">4255</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="Left-4257"><a href="#Left-4257"><span class="linenos">4257</span></a><span class="k">class</span> <span class="nc">Left</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Left-4258"><a href="#Left-4258"><span class="linenos">4258</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -56758,8 +56885,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Right"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Right-4258"><a href="#Right-4258"><span class="linenos">4258</span></a><span class="k">class</span> <span class="nc">Right</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Right-4259"><a href="#Right-4259"><span class="linenos">4259</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="Right-4261"><a href="#Right-4261"><span class="linenos">4261</span></a><span class="k">class</span> <span class="nc">Right</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Right-4262"><a href="#Right-4262"><span class="linenos">4262</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -56879,8 +57006,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-4262"><a href="#Length-4262"><span class="linenos">4262</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-4263"><a href="#Length-4263"><span class="linenos">4263</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LENGTH"</span><span class="p">,</span> <span class="s2">"LEN"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Length-4265"><a href="#Length-4265"><span class="linenos">4265</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-4266"><a href="#Length-4266"><span class="linenos">4266</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LENGTH"</span><span class="p">,</span> <span class="s2">"LEN"</span><span class="p">]</span> </span></pre></div> @@ -56989,14 +57116,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-4266"><a href="#Levenshtein-4266"><span class="linenos">4266</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-4267"><a href="#Levenshtein-4267"><span class="linenos">4267</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Levenshtein-4268"><a href="#Levenshtein-4268"><span class="linenos">4268</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Levenshtein-4269"><a href="#Levenshtein-4269"><span class="linenos">4269</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Levenshtein-4270"><a href="#Levenshtein-4270"><span class="linenos">4270</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-4271"><a href="#Levenshtein-4271"><span class="linenos">4271</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-4272"><a href="#Levenshtein-4272"><span class="linenos">4272</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-4273"><a href="#Levenshtein-4273"><span class="linenos">4273</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Levenshtein-4269"><a href="#Levenshtein-4269"><span class="linenos">4269</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-4270"><a href="#Levenshtein-4270"><span class="linenos">4270</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Levenshtein-4271"><a href="#Levenshtein-4271"><span class="linenos">4271</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Levenshtein-4272"><a href="#Levenshtein-4272"><span class="linenos">4272</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Levenshtein-4273"><a href="#Levenshtein-4273"><span class="linenos">4273</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-4274"><a href="#Levenshtein-4274"><span class="linenos">4274</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-4275"><a href="#Levenshtein-4275"><span class="linenos">4275</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-4276"><a href="#Levenshtein-4276"><span class="linenos">4276</span></a> <span class="p">}</span> </span></pre></div> @@ -57116,8 +57243,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-4276"><a href="#Ln-4276"><span class="linenos">4276</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-4277"><a href="#Ln-4277"><span class="linenos">4277</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Ln-4279"><a href="#Ln-4279"><span class="linenos">4279</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-4280"><a href="#Ln-4280"><span class="linenos">4280</span></a> <span class="k">pass</span> </span></pre></div> @@ -57226,8 +57353,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-4280"><a href="#Log-4280"><span class="linenos">4280</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-4281"><a href="#Log-4281"><span class="linenos">4281</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4283"><a href="#Log-4283"><span class="linenos">4283</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-4284"><a href="#Log-4284"><span class="linenos">4284</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -57347,8 +57474,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-4284"><a href="#Log2-4284"><span class="linenos">4284</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-4285"><a href="#Log2-4285"><span class="linenos">4285</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Log2-4287"><a href="#Log2-4287"><span class="linenos">4287</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-4288"><a href="#Log2-4288"><span class="linenos">4288</span></a> <span class="k">pass</span> </span></pre></div> @@ -57457,8 +57584,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-4288"><a href="#Log10-4288"><span class="linenos">4288</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-4289"><a href="#Log10-4289"><span class="linenos">4289</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Log10-4291"><a href="#Log10-4291"><span class="linenos">4291</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-4292"><a href="#Log10-4292"><span class="linenos">4292</span></a> <span class="k">pass</span> </span></pre></div> @@ -57567,8 +57694,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-4292"><a href="#LogicalOr-4292"><span class="linenos">4292</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-4293"><a href="#LogicalOr-4293"><span class="linenos">4293</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 class="s2">"BOOLOR_AGG"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LogicalOr-4295"><a href="#LogicalOr-4295"><span class="linenos">4295</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-4296"><a href="#LogicalOr-4296"><span class="linenos">4296</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 class="s2">"BOOLOR_AGG"</span><span class="p">]</span> </span></pre></div> @@ -57677,8 +57804,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#LogicalAnd"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LogicalAnd-4296"><a href="#LogicalAnd-4296"><span class="linenos">4296</span></a><span class="k">class</span> <span class="nc">LogicalAnd</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="LogicalAnd-4297"><a href="#LogicalAnd-4297"><span class="linenos">4297</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LOGICAL_AND"</span><span class="p">,</span> <span class="s2">"BOOL_AND"</span><span class="p">,</span> <span class="s2">"BOOLAND_AGG"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LogicalAnd-4299"><a href="#LogicalAnd-4299"><span class="linenos">4299</span></a><span class="k">class</span> <span class="nc">LogicalAnd</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="LogicalAnd-4300"><a href="#LogicalAnd-4300"><span class="linenos">4300</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LOGICAL_AND"</span><span class="p">,</span> <span class="s2">"BOOL_AND"</span><span class="p">,</span> <span class="s2">"BOOLAND_AGG"</span><span class="p">]</span> </span></pre></div> @@ -57787,8 +57914,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-4300"><a href="#Lower-4300"><span class="linenos">4300</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-4301"><a href="#Lower-4301"><span class="linenos">4301</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-4303"><a href="#Lower-4303"><span class="linenos">4303</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-4304"><a href="#Lower-4304"><span class="linenos">4304</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> @@ -57897,8 +58024,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-4304"><a href="#Map-4304"><span class="linenos">4304</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-4305"><a href="#Map-4305"><span class="linenos">4305</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-4307"><a href="#Map-4307"><span class="linenos">4307</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-4308"><a href="#Map-4308"><span class="linenos">4308</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> @@ -58018,8 +58145,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#MapFromEntries"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="MapFromEntries-4308"><a href="#MapFromEntries-4308"><span class="linenos">4308</span></a><span class="k">class</span> <span class="nc">MapFromEntries</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="MapFromEntries-4309"><a href="#MapFromEntries-4309"><span class="linenos">4309</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="MapFromEntries-4311"><a href="#MapFromEntries-4311"><span class="linenos">4311</span></a><span class="k">class</span> <span class="nc">MapFromEntries</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="MapFromEntries-4312"><a href="#MapFromEntries-4312"><span class="linenos">4312</span></a> <span class="k">pass</span> </span></pre></div> @@ -58128,8 +58255,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#StarMap"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StarMap-4312"><a href="#StarMap-4312"><span class="linenos">4312</span></a><span class="k">class</span> <span class="nc">StarMap</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="StarMap-4313"><a href="#StarMap-4313"><span class="linenos">4313</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="StarMap-4315"><a href="#StarMap-4315"><span class="linenos">4315</span></a><span class="k">class</span> <span class="nc">StarMap</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="StarMap-4316"><a href="#StarMap-4316"><span class="linenos">4316</span></a> <span class="k">pass</span> </span></pre></div> @@ -58238,17 +58365,17 @@ 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-4316"><a href="#VarMap-4316"><span class="linenos">4316</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-4317"><a href="#VarMap-4317"><span class="linenos">4317</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-4318"><a href="#VarMap-4318"><span class="linenos">4318</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="VarMap-4319"><a href="#VarMap-4319"><span class="linenos">4319</span></a> -</span><span id="VarMap-4320"><a href="#VarMap-4320"><span class="linenos">4320</span></a> <span class="nd">@property</span> -</span><span id="VarMap-4321"><a href="#VarMap-4321"><span class="linenos">4321</span></a> <span class="k">def</span> <span class="nf">keys</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="VarMap-4322"><a href="#VarMap-4322"><span class="linenos">4322</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">"keys"</span><span class="p">]</span><span class="o">.</span><span class="n">expressions</span> -</span><span id="VarMap-4323"><a href="#VarMap-4323"><span class="linenos">4323</span></a> -</span><span id="VarMap-4324"><a href="#VarMap-4324"><span class="linenos">4324</span></a> <span class="nd">@property</span> -</span><span id="VarMap-4325"><a href="#VarMap-4325"><span class="linenos">4325</span></a> <span class="k">def</span> <span class="nf">values</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="VarMap-4326"><a href="#VarMap-4326"><span class="linenos">4326</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">"values"</span><span class="p">]</span><span class="o">.</span><span class="n">expressions</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="VarMap-4319"><a href="#VarMap-4319"><span class="linenos">4319</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-4320"><a href="#VarMap-4320"><span class="linenos">4320</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-4321"><a href="#VarMap-4321"><span class="linenos">4321</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="VarMap-4322"><a href="#VarMap-4322"><span class="linenos">4322</span></a> +</span><span id="VarMap-4323"><a href="#VarMap-4323"><span class="linenos">4323</span></a> <span class="nd">@property</span> +</span><span id="VarMap-4324"><a href="#VarMap-4324"><span class="linenos">4324</span></a> <span class="k">def</span> <span class="nf">keys</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="VarMap-4325"><a href="#VarMap-4325"><span class="linenos">4325</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">"keys"</span><span class="p">]</span><span class="o">.</span><span class="n">expressions</span> +</span><span id="VarMap-4326"><a href="#VarMap-4326"><span class="linenos">4326</span></a> +</span><span id="VarMap-4327"><a href="#VarMap-4327"><span class="linenos">4327</span></a> <span class="nd">@property</span> +</span><span id="VarMap-4328"><a href="#VarMap-4328"><span class="linenos">4328</span></a> <span class="k">def</span> <span class="nf">values</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="VarMap-4329"><a href="#VarMap-4329"><span class="linenos">4329</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">"values"</span><span class="p">]</span><span class="o">.</span><span class="n">expressions</span> </span></pre></div> @@ -58401,8 +58528,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#MatchAgainst"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="MatchAgainst-4330"><a href="#MatchAgainst-4330"><span class="linenos">4330</span></a><span class="k">class</span> <span class="nc">MatchAgainst</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="MatchAgainst-4331"><a href="#MatchAgainst-4331"><span class="linenos">4331</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"modifier"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="MatchAgainst-4333"><a href="#MatchAgainst-4333"><span class="linenos">4333</span></a><span class="k">class</span> <span class="nc">MatchAgainst</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="MatchAgainst-4334"><a href="#MatchAgainst-4334"><span class="linenos">4334</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"modifier"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -58522,9 +58649,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Max"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Max-4334"><a href="#Max-4334"><span class="linenos">4334</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-4335"><a href="#Max-4335"><span class="linenos">4335</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="Max-4336"><a href="#Max-4336"><span class="linenos">4336</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="Max-4337"><a href="#Max-4337"><span class="linenos">4337</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-4338"><a href="#Max-4338"><span class="linenos">4338</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="Max-4339"><a href="#Max-4339"><span class="linenos">4339</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -58655,8 +58782,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#MD5"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="MD5-4339"><a href="#MD5-4339"><span class="linenos">4339</span></a><span class="k">class</span> <span class="nc">MD5</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="MD5-4340"><a href="#MD5-4340"><span class="linenos">4340</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"MD5"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="MD5-4342"><a href="#MD5-4342"><span class="linenos">4342</span></a><span class="k">class</span> <span class="nc">MD5</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="MD5-4343"><a href="#MD5-4343"><span class="linenos">4343</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"MD5"</span><span class="p">]</span> </span></pre></div> @@ -58765,9 +58892,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Min"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Min-4343"><a href="#Min-4343"><span class="linenos">4343</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-4344"><a href="#Min-4344"><span class="linenos">4344</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="Min-4345"><a href="#Min-4345"><span class="linenos">4345</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="Min-4346"><a href="#Min-4346"><span class="linenos">4346</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-4347"><a href="#Min-4347"><span class="linenos">4347</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="Min-4348"><a href="#Min-4348"><span class="linenos">4348</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -58898,8 +59025,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Month"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Month-4348"><a href="#Month-4348"><span class="linenos">4348</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-4349"><a href="#Month-4349"><span class="linenos">4349</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Month-4351"><a href="#Month-4351"><span class="linenos">4351</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-4352"><a href="#Month-4352"><span class="linenos">4352</span></a> <span class="k">pass</span> </span></pre></div> @@ -59008,8 +59135,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Nvl2"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Nvl2-4352"><a href="#Nvl2-4352"><span class="linenos">4352</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-4353"><a href="#Nvl2-4353"><span class="linenos">4353</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4355"><a href="#Nvl2-4355"><span class="linenos">4355</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-4356"><a href="#Nvl2-4356"><span class="linenos">4356</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -59129,8 +59256,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Posexplode"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Posexplode-4356"><a href="#Posexplode-4356"><span class="linenos">4356</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-4357"><a href="#Posexplode-4357"><span class="linenos">4357</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Posexplode-4359"><a href="#Posexplode-4359"><span class="linenos">4359</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-4360"><a href="#Posexplode-4360"><span class="linenos">4360</span></a> <span class="k">pass</span> </span></pre></div> @@ -59239,8 +59366,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Pow"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Pow-4360"><a href="#Pow-4360"><span class="linenos">4360</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-4361"><a href="#Pow-4361"><span class="linenos">4361</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-4363"><a href="#Pow-4363"><span class="linenos">4363</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-4364"><a href="#Pow-4364"><span class="linenos">4364</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> @@ -59354,8 +59481,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#PercentileCont"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="PercentileCont-4364"><a href="#PercentileCont-4364"><span class="linenos">4364</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-4365"><a href="#PercentileCont-4365"><span class="linenos">4365</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="PercentileCont-4367"><a href="#PercentileCont-4367"><span class="linenos">4367</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-4368"><a href="#PercentileCont-4368"><span class="linenos">4368</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -59475,8 +59602,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#PercentileDisc"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="PercentileDisc-4368"><a href="#PercentileDisc-4368"><span class="linenos">4368</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-4369"><a href="#PercentileDisc-4369"><span class="linenos">4369</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="PercentileDisc-4371"><a href="#PercentileDisc-4371"><span class="linenos">4371</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-4372"><a href="#PercentileDisc-4372"><span class="linenos">4372</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -59596,8 +59723,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Quantile"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Quantile-4372"><a href="#Quantile-4372"><span class="linenos">4372</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-4373"><a href="#Quantile-4373"><span class="linenos">4373</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4375"><a href="#Quantile-4375"><span class="linenos">4375</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-4376"><a href="#Quantile-4376"><span class="linenos">4376</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -59717,8 +59844,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ApproxQuantile"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ApproxQuantile-4376"><a href="#ApproxQuantile-4376"><span class="linenos">4376</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-4377"><a href="#ApproxQuantile-4377"><span class="linenos">4377</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4379"><a href="#ApproxQuantile-4379"><span class="linenos">4379</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-4380"><a href="#ApproxQuantile-4380"><span class="linenos">4380</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -59838,8 +59965,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#RangeN"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RangeN-4380"><a href="#RangeN-4380"><span class="linenos">4380</span></a><span class="k">class</span> <span class="nc">RangeN</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="RangeN-4381"><a href="#RangeN-4381"><span class="linenos">4381</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"each"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RangeN-4383"><a href="#RangeN-4383"><span class="linenos">4383</span></a><span class="k">class</span> <span class="nc">RangeN</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="RangeN-4384"><a href="#RangeN-4384"><span class="linenos">4384</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"each"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -59959,10 +60086,10 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ReadCSV"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ReadCSV-4384"><a href="#ReadCSV-4384"><span class="linenos">4384</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-4385"><a href="#ReadCSV-4385"><span class="linenos">4385</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-4386"><a href="#ReadCSV-4386"><span class="linenos">4386</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="ReadCSV-4387"><a href="#ReadCSV-4387"><span class="linenos">4387</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4387"><a href="#ReadCSV-4387"><span class="linenos">4387</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-4388"><a href="#ReadCSV-4388"><span class="linenos">4388</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-4389"><a href="#ReadCSV-4389"><span class="linenos">4389</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="ReadCSV-4390"><a href="#ReadCSV-4390"><span class="linenos">4390</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -60093,8 +60220,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Reduce"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Reduce-4390"><a href="#Reduce-4390"><span class="linenos">4390</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-4391"><a href="#Reduce-4391"><span class="linenos">4391</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4393"><a href="#Reduce-4393"><span class="linenos">4393</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-4394"><a href="#Reduce-4394"><span class="linenos">4394</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -60214,14 +60341,14 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#RegexpExtract"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpExtract-4394"><a href="#RegexpExtract-4394"><span class="linenos">4394</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-4395"><a href="#RegexpExtract-4395"><span class="linenos">4395</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="RegexpExtract-4396"><a href="#RegexpExtract-4396"><span class="linenos">4396</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="RegexpExtract-4397"><a href="#RegexpExtract-4397"><span class="linenos">4397</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="RegexpExtract-4398"><a href="#RegexpExtract-4398"><span class="linenos">4398</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RegexpExtract-4399"><a href="#RegexpExtract-4399"><span class="linenos">4399</span></a> <span class="s2">"occurrence"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RegexpExtract-4400"><a href="#RegexpExtract-4400"><span class="linenos">4400</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RegexpExtract-4401"><a href="#RegexpExtract-4401"><span class="linenos">4401</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpExtract-4397"><a href="#RegexpExtract-4397"><span class="linenos">4397</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-4398"><a href="#RegexpExtract-4398"><span class="linenos">4398</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="RegexpExtract-4399"><a href="#RegexpExtract-4399"><span class="linenos">4399</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="RegexpExtract-4400"><a href="#RegexpExtract-4400"><span class="linenos">4400</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="RegexpExtract-4401"><a href="#RegexpExtract-4401"><span class="linenos">4401</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RegexpExtract-4402"><a href="#RegexpExtract-4402"><span class="linenos">4402</span></a> <span class="s2">"occurrence"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RegexpExtract-4403"><a href="#RegexpExtract-4403"><span class="linenos">4403</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RegexpExtract-4404"><a href="#RegexpExtract-4404"><span class="linenos">4404</span></a> <span class="p">}</span> </span></pre></div> @@ -60341,8 +60468,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#RegexpLike"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpLike-4404"><a href="#RegexpLike-4404"><span class="linenos">4404</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-4405"><a href="#RegexpLike-4405"><span class="linenos">4405</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4407"><a href="#RegexpLike-4407"><span class="linenos">4407</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-4408"><a href="#RegexpLike-4408"><span class="linenos">4408</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -60462,8 +60589,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#RegexpILike"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpILike-4408"><a href="#RegexpILike-4408"><span class="linenos">4408</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-4409"><a href="#RegexpILike-4409"><span class="linenos">4409</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4411"><a href="#RegexpILike-4411"><span class="linenos">4411</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-4412"><a href="#RegexpILike-4412"><span class="linenos">4412</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -60583,8 +60710,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#RegexpSplit"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpSplit-4414"><a href="#RegexpSplit-4414"><span class="linenos">4414</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-4415"><a href="#RegexpSplit-4415"><span class="linenos">4415</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="RegexpSplit-4417"><a href="#RegexpSplit-4417"><span class="linenos">4417</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-4418"><a href="#RegexpSplit-4418"><span class="linenos">4418</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -60704,8 +60831,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Repeat"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Repeat-4418"><a href="#Repeat-4418"><span class="linenos">4418</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-4419"><a href="#Repeat-4419"><span class="linenos">4419</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4421"><a href="#Repeat-4421"><span class="linenos">4421</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-4422"><a href="#Repeat-4422"><span class="linenos">4422</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -60825,8 +60952,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Round"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Round-4422"><a href="#Round-4422"><span class="linenos">4422</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-4423"><a href="#Round-4423"><span class="linenos">4423</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4425"><a href="#Round-4425"><span class="linenos">4425</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-4426"><a href="#Round-4426"><span class="linenos">4426</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -60946,8 +61073,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#RowNumber"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RowNumber-4426"><a href="#RowNumber-4426"><span class="linenos">4426</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-4427"><a href="#RowNumber-4427"><span class="linenos">4427</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-4429"><a href="#RowNumber-4429"><span class="linenos">4429</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-4430"><a href="#RowNumber-4430"><span class="linenos">4430</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> @@ -61067,8 +61194,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#SafeDivide"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SafeDivide-4430"><a href="#SafeDivide-4430"><span class="linenos">4430</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-4431"><a href="#SafeDivide-4431"><span class="linenos">4431</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4433"><a href="#SafeDivide-4433"><span class="linenos">4433</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-4434"><a href="#SafeDivide-4434"><span class="linenos">4434</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -61188,8 +61315,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#SetAgg"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SetAgg-4434"><a href="#SetAgg-4434"><span class="linenos">4434</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-4435"><a href="#SetAgg-4435"><span class="linenos">4435</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SetAgg-4437"><a href="#SetAgg-4437"><span class="linenos">4437</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-4438"><a href="#SetAgg-4438"><span class="linenos">4438</span></a> <span class="k">pass</span> </span></pre></div> @@ -61298,8 +61425,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#SHA"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SHA-4438"><a href="#SHA-4438"><span class="linenos">4438</span></a><span class="k">class</span> <span class="nc">SHA</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="SHA-4439"><a href="#SHA-4439"><span class="linenos">4439</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"SHA"</span><span class="p">,</span> <span class="s2">"SHA1"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SHA-4441"><a href="#SHA-4441"><span class="linenos">4441</span></a><span class="k">class</span> <span class="nc">SHA</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="SHA-4442"><a href="#SHA-4442"><span class="linenos">4442</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"SHA"</span><span class="p">,</span> <span class="s2">"SHA1"</span><span class="p">]</span> </span></pre></div> @@ -61408,9 +61535,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#SHA2"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SHA2-4442"><a href="#SHA2-4442"><span class="linenos">4442</span></a><span class="k">class</span> <span class="nc">SHA2</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="SHA2-4443"><a href="#SHA2-4443"><span class="linenos">4443</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"SHA2"</span><span class="p">]</span> -</span><span id="SHA2-4444"><a href="#SHA2-4444"><span class="linenos">4444</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</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="SHA2-4445"><a href="#SHA2-4445"><span class="linenos">4445</span></a><span class="k">class</span> <span class="nc">SHA2</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="SHA2-4446"><a href="#SHA2-4446"><span class="linenos">4446</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"SHA2"</span><span class="p">]</span> +</span><span id="SHA2-4447"><a href="#SHA2-4447"><span class="linenos">4447</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</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> @@ -61530,8 +61657,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#SortArray"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SortArray-4447"><a href="#SortArray-4447"><span class="linenos">4447</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-4448"><a href="#SortArray-4448"><span class="linenos">4448</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4450"><a href="#SortArray-4450"><span class="linenos">4450</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-4451"><a href="#SortArray-4451"><span class="linenos">4451</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -61651,8 +61778,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Split"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Split-4451"><a href="#Split-4451"><span class="linenos">4451</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-4452"><a href="#Split-4452"><span class="linenos">4452</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4454"><a href="#Split-4454"><span class="linenos">4454</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-4455"><a href="#Split-4455"><span class="linenos">4455</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -61772,8 +61899,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Substring"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Substring-4457"><a href="#Substring-4457"><span class="linenos">4457</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-4458"><a href="#Substring-4458"><span class="linenos">4458</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4460"><a href="#Substring-4460"><span class="linenos">4460</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-4461"><a href="#Substring-4461"><span class="linenos">4461</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -61893,8 +62020,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#StandardHash"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StandardHash-4461"><a href="#StandardHash-4461"><span class="linenos">4461</span></a><span class="k">class</span> <span class="nc">StandardHash</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="StandardHash-4462"><a href="#StandardHash-4462"><span class="linenos">4462</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="StandardHash-4464"><a href="#StandardHash-4464"><span class="linenos">4464</span></a><span class="k">class</span> <span class="nc">StandardHash</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="StandardHash-4465"><a href="#StandardHash-4465"><span class="linenos">4465</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -62014,13 +62141,13 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#StrPosition"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StrPosition-4465"><a href="#StrPosition-4465"><span class="linenos">4465</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-4466"><a href="#StrPosition-4466"><span class="linenos">4466</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="StrPosition-4467"><a href="#StrPosition-4467"><span class="linenos">4467</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="StrPosition-4468"><a href="#StrPosition-4468"><span class="linenos">4468</span></a> <span class="s2">"substr"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="StrPosition-4469"><a href="#StrPosition-4469"><span class="linenos">4469</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="StrPosition-4470"><a href="#StrPosition-4470"><span class="linenos">4470</span></a> <span class="s2">"instance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="StrPosition-4471"><a href="#StrPosition-4471"><span class="linenos">4471</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="StrPosition-4468"><a href="#StrPosition-4468"><span class="linenos">4468</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-4469"><a href="#StrPosition-4469"><span class="linenos">4469</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="StrPosition-4470"><a href="#StrPosition-4470"><span class="linenos">4470</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="StrPosition-4471"><a href="#StrPosition-4471"><span class="linenos">4471</span></a> <span class="s2">"substr"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="StrPosition-4472"><a href="#StrPosition-4472"><span class="linenos">4472</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="StrPosition-4473"><a href="#StrPosition-4473"><span class="linenos">4473</span></a> <span class="s2">"instance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="StrPosition-4474"><a href="#StrPosition-4474"><span class="linenos">4474</span></a> <span class="p">}</span> </span></pre></div> @@ -62140,8 +62267,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#StrToDate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StrToDate-4474"><a href="#StrToDate-4474"><span class="linenos">4474</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-4475"><a href="#StrToDate-4475"><span class="linenos">4475</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4477"><a href="#StrToDate-4477"><span class="linenos">4477</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-4478"><a href="#StrToDate-4478"><span class="linenos">4478</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -62261,8 +62388,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#StrToTime"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StrToTime-4478"><a href="#StrToTime-4478"><span class="linenos">4478</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-4479"><a href="#StrToTime-4479"><span class="linenos">4479</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4481"><a href="#StrToTime-4481"><span class="linenos">4481</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-4482"><a href="#StrToTime-4482"><span class="linenos">4482</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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 class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -62271,7 +62398,7 @@ name is set to the expression's class name transformed to snake case.</li> <div id="StrToTime.arg_types" class="classattr"> <div class="attr variable"> <span class="name">arg_types</span> = -<span class="default_value">{'this': True, 'format': True}</span> +<span class="default_value">{'this': True, 'format': True, 'zone': False}</span> </div> @@ -62382,8 +62509,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#StrToUnix"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StrToUnix-4484"><a href="#StrToUnix-4484"><span class="linenos">4484</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-4485"><a href="#StrToUnix-4485"><span class="linenos">4485</span></a> <span class="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-4487"><a href="#StrToUnix-4487"><span class="linenos">4487</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-4488"><a href="#StrToUnix-4488"><span class="linenos">4488</span></a> <span class="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> @@ -62503,8 +62630,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#NumberToStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="NumberToStr-4488"><a href="#NumberToStr-4488"><span class="linenos">4488</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-4489"><a href="#NumberToStr-4489"><span class="linenos">4489</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4491"><a href="#NumberToStr-4491"><span class="linenos">4491</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-4492"><a href="#NumberToStr-4492"><span class="linenos">4492</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -62624,8 +62751,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#FromBase"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="FromBase-4492"><a href="#FromBase-4492"><span class="linenos">4492</span></a><span class="k">class</span> <span class="nc">FromBase</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="FromBase-4493"><a href="#FromBase-4493"><span class="linenos">4493</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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="FromBase-4495"><a href="#FromBase-4495"><span class="linenos">4495</span></a><span class="k">class</span> <span class="nc">FromBase</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="FromBase-4496"><a href="#FromBase-4496"><span class="linenos">4496</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -62745,9 +62872,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Struct"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Struct-4496"><a href="#Struct-4496"><span class="linenos">4496</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-4497"><a href="#Struct-4497"><span class="linenos">4497</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-4498"><a href="#Struct-4498"><span class="linenos">4498</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-4499"><a href="#Struct-4499"><span class="linenos">4499</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-4500"><a href="#Struct-4500"><span class="linenos">4500</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-4501"><a href="#Struct-4501"><span class="linenos">4501</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -62878,8 +63005,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#StructExtract"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StructExtract-4501"><a href="#StructExtract-4501"><span class="linenos">4501</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-4502"><a href="#StructExtract-4502"><span class="linenos">4502</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4504"><a href="#StructExtract-4504"><span class="linenos">4504</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-4505"><a href="#StructExtract-4505"><span class="linenos">4505</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -62999,8 +63126,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Sum"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Sum-4505"><a href="#Sum-4505"><span class="linenos">4505</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-4506"><a href="#Sum-4506"><span class="linenos">4506</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Sum-4508"><a href="#Sum-4508"><span class="linenos">4508</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-4509"><a href="#Sum-4509"><span class="linenos">4509</span></a> <span class="k">pass</span> </span></pre></div> @@ -63109,8 +63236,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Sqrt"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Sqrt-4509"><a href="#Sqrt-4509"><span class="linenos">4509</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-4510"><a href="#Sqrt-4510"><span class="linenos">4510</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Sqrt-4512"><a href="#Sqrt-4512"><span class="linenos">4512</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-4513"><a href="#Sqrt-4513"><span class="linenos">4513</span></a> <span class="k">pass</span> </span></pre></div> @@ -63219,8 +63346,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Stddev"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Stddev-4513"><a href="#Stddev-4513"><span class="linenos">4513</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-4514"><a href="#Stddev-4514"><span class="linenos">4514</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Stddev-4516"><a href="#Stddev-4516"><span class="linenos">4516</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-4517"><a href="#Stddev-4517"><span class="linenos">4517</span></a> <span class="k">pass</span> </span></pre></div> @@ -63329,8 +63456,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#StddevPop"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StddevPop-4517"><a href="#StddevPop-4517"><span class="linenos">4517</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-4518"><a href="#StddevPop-4518"><span class="linenos">4518</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="StddevPop-4520"><a href="#StddevPop-4520"><span class="linenos">4520</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-4521"><a href="#StddevPop-4521"><span class="linenos">4521</span></a> <span class="k">pass</span> </span></pre></div> @@ -63439,8 +63566,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#StddevSamp"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StddevSamp-4521"><a href="#StddevSamp-4521"><span class="linenos">4521</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-4522"><a href="#StddevSamp-4522"><span class="linenos">4522</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="StddevSamp-4524"><a href="#StddevSamp-4524"><span class="linenos">4524</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-4525"><a href="#StddevSamp-4525"><span class="linenos">4525</span></a> <span class="k">pass</span> </span></pre></div> @@ -63549,8 +63676,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimeToStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeToStr-4525"><a href="#TimeToStr-4525"><span class="linenos">4525</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-4526"><a href="#TimeToStr-4526"><span class="linenos">4526</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4528"><a href="#TimeToStr-4528"><span class="linenos">4528</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-4529"><a href="#TimeToStr-4529"><span class="linenos">4529</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -63670,8 +63797,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimeToTimeStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeToTimeStr-4529"><a href="#TimeToTimeStr-4529"><span class="linenos">4529</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-4530"><a href="#TimeToTimeStr-4530"><span class="linenos">4530</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeToTimeStr-4532"><a href="#TimeToTimeStr-4532"><span class="linenos">4532</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-4533"><a href="#TimeToTimeStr-4533"><span class="linenos">4533</span></a> <span class="k">pass</span> </span></pre></div> @@ -63780,8 +63907,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimeToUnix"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeToUnix-4533"><a href="#TimeToUnix-4533"><span class="linenos">4533</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-4534"><a href="#TimeToUnix-4534"><span class="linenos">4534</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeToUnix-4536"><a href="#TimeToUnix-4536"><span class="linenos">4536</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-4537"><a href="#TimeToUnix-4537"><span class="linenos">4537</span></a> <span class="k">pass</span> </span></pre></div> @@ -63890,8 +64017,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimeStrToDate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeStrToDate-4537"><a href="#TimeStrToDate-4537"><span class="linenos">4537</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-4538"><a href="#TimeStrToDate-4538"><span class="linenos">4538</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeStrToDate-4540"><a href="#TimeStrToDate-4540"><span class="linenos">4540</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-4541"><a href="#TimeStrToDate-4541"><span class="linenos">4541</span></a> <span class="k">pass</span> </span></pre></div> @@ -64000,8 +64127,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimeStrToTime"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeStrToTime-4541"><a href="#TimeStrToTime-4541"><span class="linenos">4541</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-4542"><a href="#TimeStrToTime-4542"><span class="linenos">4542</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeStrToTime-4544"><a href="#TimeStrToTime-4544"><span class="linenos">4544</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-4545"><a href="#TimeStrToTime-4545"><span class="linenos">4545</span></a> <span class="k">pass</span> </span></pre></div> @@ -64110,8 +64237,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimeStrToUnix"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeStrToUnix-4545"><a href="#TimeStrToUnix-4545"><span class="linenos">4545</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-4546"><a href="#TimeStrToUnix-4546"><span class="linenos">4546</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeStrToUnix-4548"><a href="#TimeStrToUnix-4548"><span class="linenos">4548</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-4549"><a href="#TimeStrToUnix-4549"><span class="linenos">4549</span></a> <span class="k">pass</span> </span></pre></div> @@ -64220,13 +64347,13 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Trim"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Trim-4549"><a href="#Trim-4549"><span class="linenos">4549</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-4550"><a href="#Trim-4550"><span class="linenos">4550</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Trim-4551"><a href="#Trim-4551"><span class="linenos">4551</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Trim-4552"><a href="#Trim-4552"><span class="linenos">4552</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Trim-4553"><a href="#Trim-4553"><span class="linenos">4553</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Trim-4554"><a href="#Trim-4554"><span class="linenos">4554</span></a> <span class="s2">"collation"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Trim-4555"><a href="#Trim-4555"><span class="linenos">4555</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Trim-4552"><a href="#Trim-4552"><span class="linenos">4552</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-4553"><a href="#Trim-4553"><span class="linenos">4553</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Trim-4554"><a href="#Trim-4554"><span class="linenos">4554</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Trim-4555"><a href="#Trim-4555"><span class="linenos">4555</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Trim-4556"><a href="#Trim-4556"><span class="linenos">4556</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Trim-4557"><a href="#Trim-4557"><span class="linenos">4557</span></a> <span class="s2">"collation"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Trim-4558"><a href="#Trim-4558"><span class="linenos">4558</span></a> <span class="p">}</span> </span></pre></div> @@ -64346,8 +64473,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TsOrDsAdd"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDsAdd-4558"><a href="#TsOrDsAdd-4558"><span class="linenos">4558</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-4559"><a href="#TsOrDsAdd-4559"><span class="linenos">4559</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4561"><a href="#TsOrDsAdd-4561"><span class="linenos">4561</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-4562"><a href="#TsOrDsAdd-4562"><span class="linenos">4562</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -64470,8 +64597,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TsOrDsToDateStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDsToDateStr-4562"><a href="#TsOrDsToDateStr-4562"><span class="linenos">4562</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-4563"><a href="#TsOrDsToDateStr-4563"><span class="linenos">4563</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDsToDateStr-4565"><a href="#TsOrDsToDateStr-4565"><span class="linenos">4565</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-4566"><a href="#TsOrDsToDateStr-4566"><span class="linenos">4566</span></a> <span class="k">pass</span> </span></pre></div> @@ -64580,8 +64707,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TsOrDsToDate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDsToDate-4566"><a href="#TsOrDsToDate-4566"><span class="linenos">4566</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-4567"><a href="#TsOrDsToDate-4567"><span class="linenos">4567</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4569"><a href="#TsOrDsToDate-4569"><span class="linenos">4569</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-4570"><a href="#TsOrDsToDate-4570"><span class="linenos">4570</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -64701,8 +64828,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TsOrDiToDi"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDiToDi-4570"><a href="#TsOrDiToDi-4570"><span class="linenos">4570</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-4571"><a href="#TsOrDiToDi-4571"><span class="linenos">4571</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDiToDi-4573"><a href="#TsOrDiToDi-4573"><span class="linenos">4573</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-4574"><a href="#TsOrDiToDi-4574"><span class="linenos">4574</span></a> <span class="k">pass</span> </span></pre></div> @@ -64811,8 +64938,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Unhex"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Unhex-4574"><a href="#Unhex-4574"><span class="linenos">4574</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-4575"><a href="#Unhex-4575"><span class="linenos">4575</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Unhex-4577"><a href="#Unhex-4577"><span class="linenos">4577</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-4578"><a href="#Unhex-4578"><span class="linenos">4578</span></a> <span class="k">pass</span> </span></pre></div> @@ -64921,8 +65048,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#UnixToStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="UnixToStr-4578"><a href="#UnixToStr-4578"><span class="linenos">4578</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-4579"><a href="#UnixToStr-4579"><span class="linenos">4579</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4581"><a href="#UnixToStr-4581"><span class="linenos">4581</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-4582"><a href="#UnixToStr-4582"><span class="linenos">4582</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -65042,12 +65169,12 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#UnixToTime"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="UnixToTime-4584"><a href="#UnixToTime-4584"><span class="linenos">4584</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-4585"><a href="#UnixToTime-4585"><span class="linenos">4585</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4586"><a href="#UnixToTime-4586"><span class="linenos">4586</span></a> -</span><span id="UnixToTime-4587"><a href="#UnixToTime-4587"><span class="linenos">4587</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-4588"><a href="#UnixToTime-4588"><span class="linenos">4588</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-4589"><a href="#UnixToTime-4589"><span class="linenos">4589</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-4587"><a href="#UnixToTime-4587"><span class="linenos">4587</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-4588"><a href="#UnixToTime-4588"><span class="linenos">4588</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4589"><a href="#UnixToTime-4589"><span class="linenos">4589</span></a> +</span><span id="UnixToTime-4590"><a href="#UnixToTime-4590"><span class="linenos">4590</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-4591"><a href="#UnixToTime-4591"><span class="linenos">4591</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-4592"><a href="#UnixToTime-4592"><span class="linenos">4592</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> @@ -65203,8 +65330,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#UnixToTimeStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="UnixToTimeStr-4592"><a href="#UnixToTimeStr-4592"><span class="linenos">4592</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-4593"><a href="#UnixToTimeStr-4593"><span class="linenos">4593</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="UnixToTimeStr-4595"><a href="#UnixToTimeStr-4595"><span class="linenos">4595</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-4596"><a href="#UnixToTimeStr-4596"><span class="linenos">4596</span></a> <span class="k">pass</span> </span></pre></div> @@ -65313,8 +65440,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Upper"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Upper-4596"><a href="#Upper-4596"><span class="linenos">4596</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-4597"><a href="#Upper-4597"><span class="linenos">4597</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-4599"><a href="#Upper-4599"><span class="linenos">4599</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-4600"><a href="#Upper-4600"><span class="linenos">4600</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> @@ -65423,8 +65550,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Variance"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Variance-4600"><a href="#Variance-4600"><span class="linenos">4600</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-4601"><a href="#Variance-4601"><span class="linenos">4601</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-4603"><a href="#Variance-4603"><span class="linenos">4603</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-4604"><a href="#Variance-4604"><span class="linenos">4604</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> @@ -65533,8 +65660,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#VariancePop"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="VariancePop-4604"><a href="#VariancePop-4604"><span class="linenos">4604</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-4605"><a href="#VariancePop-4605"><span class="linenos">4605</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-4607"><a href="#VariancePop-4607"><span class="linenos">4607</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-4608"><a href="#VariancePop-4608"><span class="linenos">4608</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> @@ -65643,8 +65770,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Week"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Week-4608"><a href="#Week-4608"><span class="linenos">4608</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-4609"><a href="#Week-4609"><span class="linenos">4609</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4611"><a href="#Week-4611"><span class="linenos">4611</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-4612"><a href="#Week-4612"><span class="linenos">4612</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -65764,8 +65891,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#XMLTable"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="XMLTable-4612"><a href="#XMLTable-4612"><span class="linenos">4612</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-4613"><a href="#XMLTable-4613"><span class="linenos">4613</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4615"><a href="#XMLTable-4615"><span class="linenos">4615</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-4616"><a href="#XMLTable-4616"><span class="linenos">4616</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -65885,8 +66012,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Year"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Year-4616"><a href="#Year-4616"><span class="linenos">4616</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-4617"><a href="#Year-4617"><span class="linenos">4617</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Year-4619"><a href="#Year-4619"><span class="linenos">4619</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-4620"><a href="#Year-4620"><span class="linenos">4620</span></a> <span class="k">pass</span> </span></pre></div> @@ -65995,8 +66122,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Use"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Use-4620"><a href="#Use-4620"><span class="linenos">4620</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-4621"><a href="#Use-4621"><span class="linenos">4621</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4623"><a href="#Use-4623"><span class="linenos">4623</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-4624"><a href="#Use-4624"><span class="linenos">4624</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -66093,8 +66220,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Merge"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Merge-4624"><a href="#Merge-4624"><span class="linenos">4624</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-4625"><a href="#Merge-4625"><span class="linenos">4625</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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-4627"><a href="#Merge-4627"><span class="linenos">4627</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-4628"><a href="#Merge-4628"><span class="linenos">4628</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span 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> @@ -66191,8 +66318,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#When"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="When-4628"><a href="#When-4628"><span class="linenos">4628</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-4629"><a href="#When-4629"><span class="linenos">4629</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"matched"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"source"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"condition"</span><span class="p">:</span> <span class="kc">False</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-4631"><a href="#When-4631"><span class="linenos">4631</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-4632"><a href="#When-4632"><span class="linenos">4632</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"matched"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"source"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"condition"</span><span class="p">:</span> <span class="kc">False</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> @@ -66312,8 +66439,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#NextValueFor"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="NextValueFor-4634"><a href="#NextValueFor-4634"><span class="linenos">4634</span></a><span class="k">class</span> <span class="nc">NextValueFor</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="NextValueFor-4635"><a href="#NextValueFor-4635"><span class="linenos">4635</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="NextValueFor-4637"><a href="#NextValueFor-4637"><span class="linenos">4637</span></a><span class="k">class</span> <span class="nc">NextValueFor</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="NextValueFor-4638"><a href="#NextValueFor-4638"><span class="linenos">4638</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -66426,7 +66553,7 @@ name is set to the expression's class name transformed to snake case.</li> <div class="attr variable"> <span class="name">ALL_FUNCTIONS</span> = <input id="ALL_FUNCTIONS-view-value" class="view-value-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> - <label class="view-value-button pdoc-button" for="ALL_FUNCTIONS-view-value"></label><span class="default_value">[<class '<a href="#Abs">sqlglot.expressions.Abs</a>'>, <class '<a href="#AnyValue">sqlglot.expressions.AnyValue</a>'>, <class '<a href="#ApproxDistinct">sqlglot.expressions.ApproxDistinct</a>'>, <class '<a href="#ApproxQuantile">sqlglot.expressions.ApproxQuantile</a>'>, <class '<a href="#Array">sqlglot.expressions.Array</a>'>, <class '<a href="#ArrayAgg">sqlglot.expressions.ArrayAgg</a>'>, <class '<a href="#ArrayAll">sqlglot.expressions.ArrayAll</a>'>, <class '<a href="#ArrayAny">sqlglot.expressions.ArrayAny</a>'>, <class '<a href="#ArrayConcat">sqlglot.expressions.ArrayConcat</a>'>, <class '<a href="#ArrayContains">sqlglot.expressions.ArrayContains</a>'>, <class '<a href="#ArrayFilter">sqlglot.expressions.ArrayFilter</a>'>, <class '<a href="#ArrayJoin">sqlglot.expressions.ArrayJoin</a>'>, <class '<a href="#ArraySize">sqlglot.expressions.ArraySize</a>'>, <class '<a href="#ArraySort">sqlglot.expressions.ArraySort</a>'>, <class '<a href="#ArraySum">sqlglot.expressions.ArraySum</a>'>, <class '<a href="#ArrayUnionAgg">sqlglot.expressions.ArrayUnionAgg</a>'>, <class '<a href="#Avg">sqlglot.expressions.Avg</a>'>, <class '<a href="#Case">sqlglot.expressions.Case</a>'>, <class '<a href="#Cast">sqlglot.expressions.Cast</a>'>, <class '<a href="#CastToStrType">sqlglot.expressions.CastToStrType</a>'>, <class '<a href="#Ceil">sqlglot.expressions.Ceil</a>'>, <class '<a href="#Coalesce">sqlglot.expressions.Coalesce</a>'>, <class '<a href="#Concat">sqlglot.expressions.Concat</a>'>, <class '<a href="#ConcatWs">sqlglot.expressions.ConcatWs</a>'>, <class '<a href="#Count">sqlglot.expressions.Count</a>'>, <class '<a href="#CountIf">sqlglot.expressions.CountIf</a>'>, <class '<a href="#CurrentDate">sqlglot.expressions.CurrentDate</a>'>, <class '<a href="#CurrentDatetime">sqlglot.expressions.CurrentDatetime</a>'>, <class '<a href="#CurrentTime">sqlglot.expressions.CurrentTime</a>'>, <class '<a href="#CurrentTimestamp">sqlglot.expressions.CurrentTimestamp</a>'>, <class '<a href="#CurrentUser">sqlglot.expressions.CurrentUser</a>'>, <class '<a href="#Date">sqlglot.expressions.Date</a>'>, <class '<a href="#DateAdd">sqlglot.expressions.DateAdd</a>'>, <class '<a href="#DateDiff">sqlglot.expressions.DateDiff</a>'>, <class '<a href="#DateFromParts">sqlglot.expressions.DateFromParts</a>'>, <class '<a href="#DateStrToDate">sqlglot.expressions.DateStrToDate</a>'>, <class '<a href="#DateSub">sqlglot.expressions.DateSub</a>'>, <class '<a href="#DateToDateStr">sqlglot.expressions.DateToDateStr</a>'>, <class '<a href="#DateToDi">sqlglot.expressions.DateToDi</a>'>, <class '<a href="#DateTrunc">sqlglot.expressions.DateTrunc</a>'>, <class '<a href="#DatetimeAdd">sqlglot.expressions.DatetimeAdd</a>'>, <class '<a href="#DatetimeDiff">sqlglot.expressions.DatetimeDiff</a>'>, <class '<a href="#DatetimeSub">sqlglot.expressions.DatetimeSub</a>'>, <class '<a href="#DatetimeTrunc">sqlglot.expressions.DatetimeTrunc</a>'>, <class '<a href="#Day">sqlglot.expressions.Day</a>'>, <class '<a href="#DayOfMonth">sqlglot.expressions.DayOfMonth</a>'>, <class '<a href="#DayOfWeek">sqlglot.expressions.DayOfWeek</a>'>, <class '<a href="#DayOfYear">sqlglot.expressions.DayOfYear</a>'>, <class '<a href="#Decode">sqlglot.expressions.Decode</a>'>, <class '<a href="#DiToDate">sqlglot.expressions.DiToDate</a>'>, <class '<a href="#Encode">sqlglot.expressions.Encode</a>'>, <class '<a href="#Exp">sqlglot.expressions.Exp</a>'>, <class '<a href="#Explode">sqlglot.expressions.Explode</a>'>, <class '<a href="#Extract">sqlglot.expressions.Extract</a>'>, <class '<a href="#Floor">sqlglot.expressions.Floor</a>'>, <class '<a href="#FromBase">sqlglot.expressions.FromBase</a>'>, <class '<a href="#FromBase64">sqlglot.expressions.FromBase64</a>'>, <class '<a href="#GenerateSeries">sqlglot.expressions.GenerateSeries</a>'>, <class '<a href="#Greatest">sqlglot.expressions.Greatest</a>'>, <class '<a href="#GroupConcat">sqlglot.expressions.GroupConcat</a>'>, <class '<a href="#Hex">sqlglot.expressions.Hex</a>'>, <class '<a href="#Hll">sqlglot.expressions.Hll</a>'>, <class '<a href="#If">sqlglot.expressions.If</a>'>, <class '<a href="#Initcap">sqlglot.expressions.Initcap</a>'>, <class '<a href="#JSONBExtract">sqlglot.expressions.JSONBExtract</a>'>, <class '<a href="#JSONBExtractScalar">sqlglot.expressions.JSONBExtractScalar</a>'>, <class '<a href="#JSONExtract">sqlglot.expressions.JSONExtract</a>'>, <class '<a href="#JSONExtractScalar">sqlglot.expressions.JSONExtractScalar</a>'>, <class '<a href="#JSONFormat">sqlglot.expressions.JSONFormat</a>'>, <class '<a href="#JSONObject">sqlglot.expressions.JSONObject</a>'>, <class '<a href="#LastDateOfMonth">sqlglot.expressions.LastDateOfMonth</a>'>, <class '<a href="#Least">sqlglot.expressions.Least</a>'>, <class '<a href="#Left">sqlglot.expressions.Left</a>'>, <class '<a href="#Length">sqlglot.expressions.Length</a>'>, <class '<a href="#Levenshtein">sqlglot.expressions.Levenshtein</a>'>, <class '<a href="#Ln">sqlglot.expressions.Ln</a>'>, <class '<a href="#Log">sqlglot.expressions.Log</a>'>, <class '<a href="#Log10">sqlglot.expressions.Log10</a>'>, <class '<a href="#Log2">sqlglot.expressions.Log2</a>'>, <class '<a href="#LogicalAnd">sqlglot.expressions.LogicalAnd</a>'>, <class '<a href="#LogicalOr">sqlglot.expressions.LogicalOr</a>'>, <class '<a href="#Lower">sqlglot.expressions.Lower</a>'>, <class '<a href="#MD5">sqlglot.expressions.MD5</a>'>, <class '<a href="#Map">sqlglot.expressions.Map</a>'>, <class '<a href="#MapFromEntries">sqlglot.expressions.MapFromEntries</a>'>, <class '<a href="#MatchAgainst">sqlglot.expressions.MatchAgainst</a>'>, <class '<a href="#Max">sqlglot.expressions.Max</a>'>, <class '<a href="#Min">sqlglot.expressions.Min</a>'>, <class '<a href="#Month">sqlglot.expressions.Month</a>'>, <class '<a href="#NextValueFor">sqlglot.expressions.NextValueFor</a>'>, <class '<a href="#NumberToStr">sqlglot.expressions.NumberToStr</a>'>, <class '<a href="#Nvl2">sqlglot.expressions.Nvl2</a>'>, <class '<a href="#OpenJSON">sqlglot.expressions.OpenJSON</a>'>, <class '<a href="#ParameterizedAgg">sqlglot.expressions.ParameterizedAgg</a>'>, <class '<a href="#PercentileCont">sqlglot.expressions.PercentileCont</a>'>, <class '<a href="#PercentileDisc">sqlglot.expressions.PercentileDisc</a>'>, <class '<a href="#Posexplode">sqlglot.expressions.Posexplode</a>'>, <class '<a href="#Pow">sqlglot.expressions.Pow</a>'>, <class '<a href="#Quantile">sqlglot.expressions.Quantile</a>'>, <class '<a href="#RangeN">sqlglot.expressions.RangeN</a>'>, <class '<a href="#ReadCSV">sqlglot.expressions.ReadCSV</a>'>, <class '<a href="#Reduce">sqlglot.expressions.Reduce</a>'>, <class '<a href="#RegexpExtract">sqlglot.expressions.RegexpExtract</a>'>, <class '<a href="#RegexpILike">sqlglot.expressions.RegexpILike</a>'>, <class '<a href="#RegexpLike">sqlglot.expressions.RegexpLike</a>'>, <class '<a href="#RegexpSplit">sqlglot.expressions.RegexpSplit</a>'>, <class '<a href="#Repeat">sqlglot.expressions.Repeat</a>'>, <class '<a href="#Right">sqlglot.expressions.Right</a>'>, <class '<a href="#Round">sqlglot.expressions.Round</a>'>, <class '<a href="#RowNumber">sqlglot.expressions.RowNumber</a>'>, <class '<a href="#SHA">sqlglot.expressions.SHA</a>'>, <class '<a href="#SHA2">sqlglot.expressions.SHA2</a>'>, <class '<a href="#SafeConcat">sqlglot.expressions.SafeConcat</a>'>, <class '<a href="#SafeDivide">sqlglot.expressions.SafeDivide</a>'>, <class '<a href="#SetAgg">sqlglot.expressions.SetAgg</a>'>, <class '<a href="#SortArray">sqlglot.expressions.SortArray</a>'>, <class '<a href="#Split">sqlglot.expressions.Split</a>'>, <class '<a href="#Sqrt">sqlglot.expressions.Sqrt</a>'>, <class '<a href="#StandardHash">sqlglot.expressions.StandardHash</a>'>, <class '<a href="#StarMap">sqlglot.expressions.StarMap</a>'>, <class '<a href="#Stddev">sqlglot.expressions.Stddev</a>'>, <class '<a href="#StddevPop">sqlglot.expressions.StddevPop</a>'>, <class '<a href="#StddevSamp">sqlglot.expressions.StddevSamp</a>'>, <class '<a href="#StrPosition">sqlglot.expressions.StrPosition</a>'>, <class '<a href="#StrToDate">sqlglot.expressions.StrToDate</a>'>, <class '<a href="#StrToTime">sqlglot.expressions.StrToTime</a>'>, <class '<a href="#StrToUnix">sqlglot.expressions.StrToUnix</a>'>, <class '<a href="#Struct">sqlglot.expressions.Struct</a>'>, <class '<a href="#StructExtract">sqlglot.expressions.StructExtract</a>'>, <class '<a href="#Substring">sqlglot.expressions.Substring</a>'>, <class '<a href="#Sum">sqlglot.expressions.Sum</a>'>, <class '<a href="#TimeAdd">sqlglot.expressions.TimeAdd</a>'>, <class '<a href="#TimeDiff">sqlglot.expressions.TimeDiff</a>'>, <class '<a href="#TimeStrToDate">sqlglot.expressions.TimeStrToDate</a>'>, <class '<a href="#TimeStrToTime">sqlglot.expressions.TimeStrToTime</a>'>, <class '<a href="#TimeStrToUnix">sqlglot.expressions.TimeStrToUnix</a>'>, <class '<a href="#TimeSub">sqlglot.expressions.TimeSub</a>'>, <class '<a href="#TimeToStr">sqlglot.expressions.TimeToStr</a>'>, <class '<a href="#TimeToTimeStr">sqlglot.expressions.TimeToTimeStr</a>'>, <class '<a href="#TimeToUnix">sqlglot.expressions.TimeToUnix</a>'>, <class '<a href="#TimeTrunc">sqlglot.expressions.TimeTrunc</a>'>, <class '<a href="#TimestampAdd">sqlglot.expressions.TimestampAdd</a>'>, <class '<a href="#TimestampDiff">sqlglot.expressions.TimestampDiff</a>'>, <class '<a href="#TimestampSub">sqlglot.expressions.TimestampSub</a>'>, <class '<a href="#TimestampTrunc">sqlglot.expressions.TimestampTrunc</a>'>, <class '<a href="#ToBase64">sqlglot.expressions.ToBase64</a>'>, <class '<a href="#ToChar">sqlglot.expressions.ToChar</a>'>, <class '<a href="#Trim">sqlglot.expressions.Trim</a>'>, <class '<a href="#TryCast">sqlglot.expressions.TryCast</a>'>, <class '<a href="#TsOrDiToDi">sqlglot.expressions.TsOrDiToDi</a>'>, <class '<a href="#TsOrDsAdd">sqlglot.expressions.TsOrDsAdd</a>'>, <class '<a href="#TsOrDsToDate">sqlglot.expressions.TsOrDsToDate</a>'>, <class '<a href="#TsOrDsToDateStr">sqlglot.expressions.TsOrDsToDateStr</a>'>, <class '<a href="#Unhex">sqlglot.expressions.Unhex</a>'>, <class '<a href="#UnixToStr">sqlglot.expressions.UnixToStr</a>'>, <class '<a href="#UnixToTime">sqlglot.expressions.UnixToTime</a>'>, <class '<a href="#UnixToTimeStr">sqlglot.expressions.UnixToTimeStr</a>'>, <class '<a href="#Upper">sqlglot.expressions.Upper</a>'>, <class '<a href="#VarMap">sqlglot.expressions.VarMap</a>'>, <class '<a href="#Variance">sqlglot.expressions.Variance</a>'>, <class '<a href="#VariancePop">sqlglot.expressions.VariancePop</a>'>, <class '<a href="#Week">sqlglot.expressions.Week</a>'>, <class '<a href="#WeekOfYear">sqlglot.expressions.WeekOfYear</a>'>, <class '<a href="#When">sqlglot.expressions.When</a>'>, <class '<a href="#XMLTable">sqlglot.expressions.XMLTable</a>'>, <class '<a href="#Year">sqlglot.expressions.Year</a>'>]</span> + <label class="view-value-button pdoc-button" for="ALL_FUNCTIONS-view-value"></label><span class="default_value">[<class '<a href="#Abs">sqlglot.expressions.Abs</a>'>, <class '<a href="#AnyValue">sqlglot.expressions.AnyValue</a>'>, <class '<a href="#ApproxDistinct">sqlglot.expressions.ApproxDistinct</a>'>, <class '<a href="#ApproxQuantile">sqlglot.expressions.ApproxQuantile</a>'>, <class '<a href="#Array">sqlglot.expressions.Array</a>'>, <class '<a href="#ArrayAgg">sqlglot.expressions.ArrayAgg</a>'>, <class '<a href="#ArrayAll">sqlglot.expressions.ArrayAll</a>'>, <class '<a href="#ArrayAny">sqlglot.expressions.ArrayAny</a>'>, <class '<a href="#ArrayConcat">sqlglot.expressions.ArrayConcat</a>'>, <class '<a href="#ArrayContains">sqlglot.expressions.ArrayContains</a>'>, <class '<a href="#ArrayFilter">sqlglot.expressions.ArrayFilter</a>'>, <class '<a href="#ArrayJoin">sqlglot.expressions.ArrayJoin</a>'>, <class '<a href="#ArraySize">sqlglot.expressions.ArraySize</a>'>, <class '<a href="#ArraySort">sqlglot.expressions.ArraySort</a>'>, <class '<a href="#ArraySum">sqlglot.expressions.ArraySum</a>'>, <class '<a href="#ArrayUnionAgg">sqlglot.expressions.ArrayUnionAgg</a>'>, <class '<a href="#Avg">sqlglot.expressions.Avg</a>'>, <class '<a href="#Case">sqlglot.expressions.Case</a>'>, <class '<a href="#Cast">sqlglot.expressions.Cast</a>'>, <class '<a href="#CastToStrType">sqlglot.expressions.CastToStrType</a>'>, <class '<a href="#Ceil">sqlglot.expressions.Ceil</a>'>, <class '<a href="#Coalesce">sqlglot.expressions.Coalesce</a>'>, <class '<a href="#Concat">sqlglot.expressions.Concat</a>'>, <class '<a href="#ConcatWs">sqlglot.expressions.ConcatWs</a>'>, <class '<a href="#Count">sqlglot.expressions.Count</a>'>, <class '<a href="#CountIf">sqlglot.expressions.CountIf</a>'>, <class '<a href="#CurrentDate">sqlglot.expressions.CurrentDate</a>'>, <class '<a href="#CurrentDatetime">sqlglot.expressions.CurrentDatetime</a>'>, <class '<a href="#CurrentTime">sqlglot.expressions.CurrentTime</a>'>, <class '<a href="#CurrentTimestamp">sqlglot.expressions.CurrentTimestamp</a>'>, <class '<a href="#CurrentUser">sqlglot.expressions.CurrentUser</a>'>, <class '<a href="#Date">sqlglot.expressions.Date</a>'>, <class '<a href="#DateAdd">sqlglot.expressions.DateAdd</a>'>, <class '<a href="#DateDiff">sqlglot.expressions.DateDiff</a>'>, <class '<a href="#DateFromParts">sqlglot.expressions.DateFromParts</a>'>, <class '<a href="#DateStrToDate">sqlglot.expressions.DateStrToDate</a>'>, <class '<a href="#DateSub">sqlglot.expressions.DateSub</a>'>, <class '<a href="#DateToDateStr">sqlglot.expressions.DateToDateStr</a>'>, <class '<a href="#DateToDi">sqlglot.expressions.DateToDi</a>'>, <class '<a href="#DateTrunc">sqlglot.expressions.DateTrunc</a>'>, <class '<a href="#DatetimeAdd">sqlglot.expressions.DatetimeAdd</a>'>, <class '<a href="#DatetimeDiff">sqlglot.expressions.DatetimeDiff</a>'>, <class '<a href="#DatetimeSub">sqlglot.expressions.DatetimeSub</a>'>, <class '<a href="#DatetimeTrunc">sqlglot.expressions.DatetimeTrunc</a>'>, <class '<a href="#Day">sqlglot.expressions.Day</a>'>, <class '<a href="#DayOfMonth">sqlglot.expressions.DayOfMonth</a>'>, <class '<a href="#DayOfWeek">sqlglot.expressions.DayOfWeek</a>'>, <class '<a href="#DayOfYear">sqlglot.expressions.DayOfYear</a>'>, <class '<a href="#Decode">sqlglot.expressions.Decode</a>'>, <class '<a href="#DiToDate">sqlglot.expressions.DiToDate</a>'>, <class '<a href="#Encode">sqlglot.expressions.Encode</a>'>, <class '<a href="#Exp">sqlglot.expressions.Exp</a>'>, <class '<a href="#Explode">sqlglot.expressions.Explode</a>'>, <class '<a href="#Extract">sqlglot.expressions.Extract</a>'>, <class '<a href="#Floor">sqlglot.expressions.Floor</a>'>, <class '<a href="#FromBase">sqlglot.expressions.FromBase</a>'>, <class '<a href="#FromBase64">sqlglot.expressions.FromBase64</a>'>, <class '<a href="#GenerateSeries">sqlglot.expressions.GenerateSeries</a>'>, <class '<a href="#Greatest">sqlglot.expressions.Greatest</a>'>, <class '<a href="#GroupConcat">sqlglot.expressions.GroupConcat</a>'>, <class '<a href="#Hex">sqlglot.expressions.Hex</a>'>, <class '<a href="#Hll">sqlglot.expressions.Hll</a>'>, <class '<a href="#If">sqlglot.expressions.If</a>'>, <class '<a href="#Initcap">sqlglot.expressions.Initcap</a>'>, <class '<a href="#JSONArrayContains">sqlglot.expressions.JSONArrayContains</a>'>, <class '<a href="#JSONBExtract">sqlglot.expressions.JSONBExtract</a>'>, <class '<a href="#JSONBExtractScalar">sqlglot.expressions.JSONBExtractScalar</a>'>, <class '<a href="#JSONExtract">sqlglot.expressions.JSONExtract</a>'>, <class '<a href="#JSONExtractScalar">sqlglot.expressions.JSONExtractScalar</a>'>, <class '<a href="#JSONFormat">sqlglot.expressions.JSONFormat</a>'>, <class '<a href="#JSONObject">sqlglot.expressions.JSONObject</a>'>, <class '<a href="#LastDateOfMonth">sqlglot.expressions.LastDateOfMonth</a>'>, <class '<a href="#Least">sqlglot.expressions.Least</a>'>, <class '<a href="#Left">sqlglot.expressions.Left</a>'>, <class '<a href="#Length">sqlglot.expressions.Length</a>'>, <class '<a href="#Levenshtein">sqlglot.expressions.Levenshtein</a>'>, <class '<a href="#Ln">sqlglot.expressions.Ln</a>'>, <class '<a href="#Log">sqlglot.expressions.Log</a>'>, <class '<a href="#Log10">sqlglot.expressions.Log10</a>'>, <class '<a href="#Log2">sqlglot.expressions.Log2</a>'>, <class '<a href="#LogicalAnd">sqlglot.expressions.LogicalAnd</a>'>, <class '<a href="#LogicalOr">sqlglot.expressions.LogicalOr</a>'>, <class '<a href="#Lower">sqlglot.expressions.Lower</a>'>, <class '<a href="#MD5">sqlglot.expressions.MD5</a>'>, <class '<a href="#Map">sqlglot.expressions.Map</a>'>, <class '<a href="#MapFromEntries">sqlglot.expressions.MapFromEntries</a>'>, <class '<a href="#MatchAgainst">sqlglot.expressions.MatchAgainst</a>'>, <class '<a href="#Max">sqlglot.expressions.Max</a>'>, <class '<a href="#Min">sqlglot.expressions.Min</a>'>, <class '<a href="#Month">sqlglot.expressions.Month</a>'>, <class '<a href="#NextValueFor">sqlglot.expressions.NextValueFor</a>'>, <class '<a href="#NumberToStr">sqlglot.expressions.NumberToStr</a>'>, <class '<a href="#Nvl2">sqlglot.expressions.Nvl2</a>'>, <class '<a href="#OpenJSON">sqlglot.expressions.OpenJSON</a>'>, <class '<a href="#ParameterizedAgg">sqlglot.expressions.ParameterizedAgg</a>'>, <class '<a href="#PercentileCont">sqlglot.expressions.PercentileCont</a>'>, <class '<a href="#PercentileDisc">sqlglot.expressions.PercentileDisc</a>'>, <class '<a href="#Posexplode">sqlglot.expressions.Posexplode</a>'>, <class '<a href="#Pow">sqlglot.expressions.Pow</a>'>, <class '<a href="#Quantile">sqlglot.expressions.Quantile</a>'>, <class '<a href="#RangeN">sqlglot.expressions.RangeN</a>'>, <class '<a href="#ReadCSV">sqlglot.expressions.ReadCSV</a>'>, <class '<a href="#Reduce">sqlglot.expressions.Reduce</a>'>, <class '<a href="#RegexpExtract">sqlglot.expressions.RegexpExtract</a>'>, <class '<a href="#RegexpILike">sqlglot.expressions.RegexpILike</a>'>, <class '<a href="#RegexpLike">sqlglot.expressions.RegexpLike</a>'>, <class '<a href="#RegexpSplit">sqlglot.expressions.RegexpSplit</a>'>, <class '<a href="#Repeat">sqlglot.expressions.Repeat</a>'>, <class '<a href="#Right">sqlglot.expressions.Right</a>'>, <class '<a href="#Round">sqlglot.expressions.Round</a>'>, <class '<a href="#RowNumber">sqlglot.expressions.RowNumber</a>'>, <class '<a href="#SHA">sqlglot.expressions.SHA</a>'>, <class '<a href="#SHA2">sqlglot.expressions.SHA2</a>'>, <class '<a href="#SafeConcat">sqlglot.expressions.SafeConcat</a>'>, <class '<a href="#SafeDivide">sqlglot.expressions.SafeDivide</a>'>, <class '<a href="#SetAgg">sqlglot.expressions.SetAgg</a>'>, <class '<a href="#SortArray">sqlglot.expressions.SortArray</a>'>, <class '<a href="#Split">sqlglot.expressions.Split</a>'>, <class '<a href="#Sqrt">sqlglot.expressions.Sqrt</a>'>, <class '<a href="#StandardHash">sqlglot.expressions.StandardHash</a>'>, <class '<a href="#StarMap">sqlglot.expressions.StarMap</a>'>, <class '<a href="#Stddev">sqlglot.expressions.Stddev</a>'>, <class '<a href="#StddevPop">sqlglot.expressions.StddevPop</a>'>, <class '<a href="#StddevSamp">sqlglot.expressions.StddevSamp</a>'>, <class '<a href="#StrPosition">sqlglot.expressions.StrPosition</a>'>, <class '<a href="#StrToDate">sqlglot.expressions.StrToDate</a>'>, <class '<a href="#StrToTime">sqlglot.expressions.StrToTime</a>'>, <class '<a href="#StrToUnix">sqlglot.expressions.StrToUnix</a>'>, <class '<a href="#Struct">sqlglot.expressions.Struct</a>'>, <class '<a href="#StructExtract">sqlglot.expressions.StructExtract</a>'>, <class '<a href="#Substring">sqlglot.expressions.Substring</a>'>, <class '<a href="#Sum">sqlglot.expressions.Sum</a>'>, <class '<a href="#TimeAdd">sqlglot.expressions.TimeAdd</a>'>, <class '<a href="#TimeDiff">sqlglot.expressions.TimeDiff</a>'>, <class '<a href="#TimeStrToDate">sqlglot.expressions.TimeStrToDate</a>'>, <class '<a href="#TimeStrToTime">sqlglot.expressions.TimeStrToTime</a>'>, <class '<a href="#TimeStrToUnix">sqlglot.expressions.TimeStrToUnix</a>'>, <class '<a href="#TimeSub">sqlglot.expressions.TimeSub</a>'>, <class '<a href="#TimeToStr">sqlglot.expressions.TimeToStr</a>'>, <class '<a href="#TimeToTimeStr">sqlglot.expressions.TimeToTimeStr</a>'>, <class '<a href="#TimeToUnix">sqlglot.expressions.TimeToUnix</a>'>, <class '<a href="#TimeTrunc">sqlglot.expressions.TimeTrunc</a>'>, <class '<a href="#TimestampAdd">sqlglot.expressions.TimestampAdd</a>'>, <class '<a href="#TimestampDiff">sqlglot.expressions.TimestampDiff</a>'>, <class '<a href="#TimestampSub">sqlglot.expressions.TimestampSub</a>'>, <class '<a href="#TimestampTrunc">sqlglot.expressions.TimestampTrunc</a>'>, <class '<a href="#ToBase64">sqlglot.expressions.ToBase64</a>'>, <class '<a href="#ToChar">sqlglot.expressions.ToChar</a>'>, <class '<a href="#Trim">sqlglot.expressions.Trim</a>'>, <class '<a href="#TryCast">sqlglot.expressions.TryCast</a>'>, <class '<a href="#TsOrDiToDi">sqlglot.expressions.TsOrDiToDi</a>'>, <class '<a href="#TsOrDsAdd">sqlglot.expressions.TsOrDsAdd</a>'>, <class '<a href="#TsOrDsToDate">sqlglot.expressions.TsOrDsToDate</a>'>, <class '<a href="#TsOrDsToDateStr">sqlglot.expressions.TsOrDsToDateStr</a>'>, <class '<a href="#Unhex">sqlglot.expressions.Unhex</a>'>, <class '<a href="#UnixToStr">sqlglot.expressions.UnixToStr</a>'>, <class '<a href="#UnixToTime">sqlglot.expressions.UnixToTime</a>'>, <class '<a href="#UnixToTimeStr">sqlglot.expressions.UnixToTimeStr</a>'>, <class '<a href="#Upper">sqlglot.expressions.Upper</a>'>, <class '<a href="#VarMap">sqlglot.expressions.VarMap</a>'>, <class '<a href="#Variance">sqlglot.expressions.Variance</a>'>, <class '<a href="#VariancePop">sqlglot.expressions.VariancePop</a>'>, <class '<a href="#Week">sqlglot.expressions.Week</a>'>, <class '<a href="#WeekOfYear">sqlglot.expressions.WeekOfYear</a>'>, <class '<a href="#When">sqlglot.expressions.When</a>'>, <class '<a href="#XMLTable">sqlglot.expressions.XMLTable</a>'>, <class '<a href="#Year">sqlglot.expressions.Year</a>'>]</span> </div> @@ -66446,52 +66573,52 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#maybe_parse"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="maybe_parse-4672"><a href="#maybe_parse-4672"><span class="linenos">4672</span></a><span class="k">def</span> <span class="nf">maybe_parse</span><span class="p">(</span> -</span><span id="maybe_parse-4673"><a href="#maybe_parse-4673"><span class="linenos">4673</span></a> <span class="n">sql_or_expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="maybe_parse-4674"><a href="#maybe_parse-4674"><span class="linenos">4674</span></a> <span class="o">*</span><span class="p">,</span> -</span><span id="maybe_parse-4675"><a href="#maybe_parse-4675"><span class="linenos">4675</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-4676"><a href="#maybe_parse-4676"><span class="linenos">4676</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-4677"><a href="#maybe_parse-4677"><span class="linenos">4677</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-4678"><a href="#maybe_parse-4678"><span class="linenos">4678</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-4679"><a href="#maybe_parse-4679"><span class="linenos">4679</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="maybe_parse-4680"><a href="#maybe_parse-4680"><span class="linenos">4680</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="maybe_parse-4681"><a href="#maybe_parse-4681"><span class="linenos">4681</span></a><span class="w"> </span><span class="sd">"""Gracefully handle a possible string or expression.</span> -</span><span id="maybe_parse-4682"><a href="#maybe_parse-4682"><span class="linenos">4682</span></a> -</span><span id="maybe_parse-4683"><a href="#maybe_parse-4683"><span class="linenos">4683</span></a><span class="sd"> Example:</span> -</span><span id="maybe_parse-4684"><a href="#maybe_parse-4684"><span class="linenos">4684</span></a><span class="sd"> >>> maybe_parse("1")</span> -</span><span id="maybe_parse-4685"><a href="#maybe_parse-4685"><span class="linenos">4685</span></a><span class="sd"> (LITERAL this: 1, is_string: False)</span> -</span><span id="maybe_parse-4686"><a href="#maybe_parse-4686"><span class="linenos">4686</span></a><span class="sd"> >>> maybe_parse(to_identifier("x"))</span> -</span><span id="maybe_parse-4687"><a href="#maybe_parse-4687"><span class="linenos">4687</span></a><span class="sd"> (IDENTIFIER this: x, quoted: False)</span> -</span><span id="maybe_parse-4688"><a href="#maybe_parse-4688"><span class="linenos">4688</span></a> -</span><span id="maybe_parse-4689"><a href="#maybe_parse-4689"><span class="linenos">4689</span></a><span class="sd"> Args:</span> -</span><span id="maybe_parse-4690"><a href="#maybe_parse-4690"><span class="linenos">4690</span></a><span class="sd"> sql_or_expression: the SQL code string or an expression</span> -</span><span id="maybe_parse-4691"><a href="#maybe_parse-4691"><span class="linenos">4691</span></a><span class="sd"> into: the SQLGlot Expression to parse into</span> -</span><span id="maybe_parse-4692"><a href="#maybe_parse-4692"><span class="linenos">4692</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-4693"><a href="#maybe_parse-4693"><span class="linenos">4693</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="maybe_parse-4694"><a href="#maybe_parse-4694"><span class="linenos">4694</span></a><span class="sd"> prefix: a string to prefix the sql with before it gets parsed</span> -</span><span id="maybe_parse-4695"><a href="#maybe_parse-4695"><span class="linenos">4695</span></a><span class="sd"> (automatically includes a space)</span> -</span><span id="maybe_parse-4696"><a href="#maybe_parse-4696"><span class="linenos">4696</span></a><span class="sd"> copy: whether or not to copy the expression.</span> -</span><span id="maybe_parse-4697"><a href="#maybe_parse-4697"><span class="linenos">4697</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-4698"><a href="#maybe_parse-4698"><span class="linenos">4698</span></a><span class="sd"> that an input expression is a SQL string).</span> -</span><span id="maybe_parse-4699"><a href="#maybe_parse-4699"><span class="linenos">4699</span></a> -</span><span id="maybe_parse-4700"><a href="#maybe_parse-4700"><span class="linenos">4700</span></a><span class="sd"> Returns:</span> -</span><span id="maybe_parse-4701"><a href="#maybe_parse-4701"><span class="linenos">4701</span></a><span class="sd"> Expression: the parsed or given expression.</span> -</span><span id="maybe_parse-4702"><a href="#maybe_parse-4702"><span class="linenos">4702</span></a><span class="sd"> """</span> -</span><span id="maybe_parse-4703"><a href="#maybe_parse-4703"><span class="linenos">4703</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-4704"><a href="#maybe_parse-4704"><span class="linenos">4704</span></a> <span class="k">if</span> <span class="n">copy</span><span class="p">:</span> -</span><span id="maybe_parse-4705"><a href="#maybe_parse-4705"><span class="linenos">4705</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-4706"><a href="#maybe_parse-4706"><span class="linenos">4706</span></a> <span class="k">return</span> <span class="n">sql_or_expression</span> -</span><span id="maybe_parse-4707"><a href="#maybe_parse-4707"><span class="linenos">4707</span></a> -</span><span id="maybe_parse-4708"><a href="#maybe_parse-4708"><span class="linenos">4708</span></a> <span class="k">if</span> <span class="n">sql_or_expression</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> -</span><span id="maybe_parse-4709"><a href="#maybe_parse-4709"><span class="linenos">4709</span></a> <span class="k">raise</span> <span class="n">ParseError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"SQL cannot be None"</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="maybe_parse-4675"><a href="#maybe_parse-4675"><span class="linenos">4675</span></a><span class="k">def</span> <span class="nf">maybe_parse</span><span class="p">(</span> +</span><span id="maybe_parse-4676"><a href="#maybe_parse-4676"><span class="linenos">4676</span></a> <span class="n">sql_or_expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="maybe_parse-4677"><a href="#maybe_parse-4677"><span class="linenos">4677</span></a> <span class="o">*</span><span class="p">,</span> +</span><span id="maybe_parse-4678"><a href="#maybe_parse-4678"><span class="linenos">4678</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-4679"><a href="#maybe_parse-4679"><span class="linenos">4679</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-4680"><a href="#maybe_parse-4680"><span class="linenos">4680</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-4681"><a href="#maybe_parse-4681"><span class="linenos">4681</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-4682"><a href="#maybe_parse-4682"><span class="linenos">4682</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="maybe_parse-4683"><a href="#maybe_parse-4683"><span class="linenos">4683</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="maybe_parse-4684"><a href="#maybe_parse-4684"><span class="linenos">4684</span></a><span class="w"> </span><span class="sd">"""Gracefully handle a possible string or expression.</span> +</span><span id="maybe_parse-4685"><a href="#maybe_parse-4685"><span class="linenos">4685</span></a> +</span><span id="maybe_parse-4686"><a href="#maybe_parse-4686"><span class="linenos">4686</span></a><span class="sd"> Example:</span> +</span><span id="maybe_parse-4687"><a href="#maybe_parse-4687"><span class="linenos">4687</span></a><span class="sd"> >>> maybe_parse("1")</span> +</span><span id="maybe_parse-4688"><a href="#maybe_parse-4688"><span class="linenos">4688</span></a><span class="sd"> (LITERAL this: 1, is_string: False)</span> +</span><span id="maybe_parse-4689"><a href="#maybe_parse-4689"><span class="linenos">4689</span></a><span class="sd"> >>> maybe_parse(to_identifier("x"))</span> +</span><span id="maybe_parse-4690"><a href="#maybe_parse-4690"><span class="linenos">4690</span></a><span class="sd"> (IDENTIFIER this: x, quoted: False)</span> +</span><span id="maybe_parse-4691"><a href="#maybe_parse-4691"><span class="linenos">4691</span></a> +</span><span id="maybe_parse-4692"><a href="#maybe_parse-4692"><span class="linenos">4692</span></a><span class="sd"> Args:</span> +</span><span id="maybe_parse-4693"><a href="#maybe_parse-4693"><span class="linenos">4693</span></a><span class="sd"> sql_or_expression: the SQL code string or an expression</span> +</span><span id="maybe_parse-4694"><a href="#maybe_parse-4694"><span class="linenos">4694</span></a><span class="sd"> into: the SQLGlot Expression to parse into</span> +</span><span id="maybe_parse-4695"><a href="#maybe_parse-4695"><span class="linenos">4695</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-4696"><a href="#maybe_parse-4696"><span class="linenos">4696</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="maybe_parse-4697"><a href="#maybe_parse-4697"><span class="linenos">4697</span></a><span class="sd"> prefix: a string to prefix the sql with before it gets parsed</span> +</span><span id="maybe_parse-4698"><a href="#maybe_parse-4698"><span class="linenos">4698</span></a><span class="sd"> (automatically includes a space)</span> +</span><span id="maybe_parse-4699"><a href="#maybe_parse-4699"><span class="linenos">4699</span></a><span class="sd"> copy: whether or not to copy the expression.</span> +</span><span id="maybe_parse-4700"><a href="#maybe_parse-4700"><span class="linenos">4700</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-4701"><a href="#maybe_parse-4701"><span class="linenos">4701</span></a><span class="sd"> that an input expression is a SQL string).</span> +</span><span id="maybe_parse-4702"><a href="#maybe_parse-4702"><span class="linenos">4702</span></a> +</span><span id="maybe_parse-4703"><a href="#maybe_parse-4703"><span class="linenos">4703</span></a><span class="sd"> Returns:</span> +</span><span id="maybe_parse-4704"><a href="#maybe_parse-4704"><span class="linenos">4704</span></a><span class="sd"> Expression: the parsed or given expression.</span> +</span><span id="maybe_parse-4705"><a href="#maybe_parse-4705"><span class="linenos">4705</span></a><span class="sd"> """</span> +</span><span id="maybe_parse-4706"><a href="#maybe_parse-4706"><span class="linenos">4706</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-4707"><a href="#maybe_parse-4707"><span class="linenos">4707</span></a> <span class="k">if</span> <span class="n">copy</span><span class="p">:</span> +</span><span id="maybe_parse-4708"><a href="#maybe_parse-4708"><span class="linenos">4708</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-4709"><a href="#maybe_parse-4709"><span class="linenos">4709</span></a> <span class="k">return</span> <span class="n">sql_or_expression</span> </span><span id="maybe_parse-4710"><a href="#maybe_parse-4710"><span class="linenos">4710</span></a> -</span><span id="maybe_parse-4711"><a href="#maybe_parse-4711"><span class="linenos">4711</span></a> <span class="kn">import</span> <span class="nn">sqlglot</span> -</span><span id="maybe_parse-4712"><a href="#maybe_parse-4712"><span class="linenos">4712</span></a> -</span><span id="maybe_parse-4713"><a href="#maybe_parse-4713"><span class="linenos">4713</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-4714"><a href="#maybe_parse-4714"><span class="linenos">4714</span></a> <span class="k">if</span> <span class="n">prefix</span><span class="p">:</span> -</span><span id="maybe_parse-4715"><a href="#maybe_parse-4715"><span class="linenos">4715</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-4716"><a href="#maybe_parse-4716"><span class="linenos">4716</span></a> -</span><span id="maybe_parse-4717"><a href="#maybe_parse-4717"><span class="linenos">4717</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="maybe_parse-4711"><a href="#maybe_parse-4711"><span class="linenos">4711</span></a> <span class="k">if</span> <span class="n">sql_or_expression</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="maybe_parse-4712"><a href="#maybe_parse-4712"><span class="linenos">4712</span></a> <span class="k">raise</span> <span class="n">ParseError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"SQL cannot be None"</span><span class="p">)</span> +</span><span id="maybe_parse-4713"><a href="#maybe_parse-4713"><span class="linenos">4713</span></a> +</span><span id="maybe_parse-4714"><a href="#maybe_parse-4714"><span class="linenos">4714</span></a> <span class="kn">import</span> <span class="nn">sqlglot</span> +</span><span id="maybe_parse-4715"><a href="#maybe_parse-4715"><span class="linenos">4715</span></a> +</span><span id="maybe_parse-4716"><a href="#maybe_parse-4716"><span class="linenos">4716</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-4717"><a href="#maybe_parse-4717"><span class="linenos">4717</span></a> <span class="k">if</span> <span class="n">prefix</span><span class="p">:</span> +</span><span id="maybe_parse-4718"><a href="#maybe_parse-4718"><span class="linenos">4718</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-4719"><a href="#maybe_parse-4719"><span class="linenos">4719</span></a> +</span><span id="maybe_parse-4720"><a href="#maybe_parse-4720"><span class="linenos">4720</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> @@ -66543,32 +66670,32 @@ 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-4901"><a href="#union-4901"><span class="linenos">4901</span></a><span class="k">def</span> <span class="nf">union</span><span class="p">(</span> -</span><span id="union-4902"><a href="#union-4902"><span class="linenos">4902</span></a> <span class="n">left</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">right</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="union-4903"><a href="#union-4903"><span class="linenos">4903</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> -</span><span id="union-4904"><a href="#union-4904"><span class="linenos">4904</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="union-4905"><a href="#union-4905"><span class="linenos">4905</span></a><span class="sd"> Initializes a syntax tree from one UNION expression.</span> -</span><span id="union-4906"><a href="#union-4906"><span class="linenos">4906</span></a> -</span><span id="union-4907"><a href="#union-4907"><span class="linenos">4907</span></a><span class="sd"> Example:</span> -</span><span id="union-4908"><a href="#union-4908"><span class="linenos">4908</span></a><span class="sd"> >>> union("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> -</span><span id="union-4909"><a href="#union-4909"><span class="linenos">4909</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> -</span><span id="union-4910"><a href="#union-4910"><span class="linenos">4910</span></a> -</span><span id="union-4911"><a href="#union-4911"><span class="linenos">4911</span></a><span class="sd"> Args:</span> -</span><span id="union-4912"><a href="#union-4912"><span class="linenos">4912</span></a><span class="sd"> left: the SQL code string corresponding to the left-hand side.</span> -</span><span id="union-4913"><a href="#union-4913"><span class="linenos">4913</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="union-4914"><a href="#union-4914"><span class="linenos">4914</span></a><span class="sd"> right: the SQL code string corresponding to the right-hand side.</span> -</span><span id="union-4915"><a href="#union-4915"><span class="linenos">4915</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="union-4916"><a href="#union-4916"><span class="linenos">4916</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="union-4917"><a href="#union-4917"><span class="linenos">4917</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="union-4918"><a href="#union-4918"><span class="linenos">4918</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="union-4919"><a href="#union-4919"><span class="linenos">4919</span></a> -</span><span id="union-4920"><a href="#union-4920"><span class="linenos">4920</span></a><span class="sd"> Returns:</span> -</span><span id="union-4921"><a href="#union-4921"><span class="linenos">4921</span></a><span class="sd"> The new Union instance.</span> -</span><span id="union-4922"><a href="#union-4922"><span class="linenos">4922</span></a><span class="sd"> """</span> -</span><span id="union-4923"><a href="#union-4923"><span class="linenos">4923</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-4924"><a href="#union-4924"><span class="linenos">4924</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-4925"><a href="#union-4925"><span class="linenos">4925</span></a> -</span><span id="union-4926"><a href="#union-4926"><span class="linenos">4926</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-4904"><a href="#union-4904"><span class="linenos">4904</span></a><span class="k">def</span> <span class="nf">union</span><span class="p">(</span> +</span><span id="union-4905"><a href="#union-4905"><span class="linenos">4905</span></a> <span class="n">left</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">right</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="union-4906"><a href="#union-4906"><span class="linenos">4906</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> +</span><span id="union-4907"><a href="#union-4907"><span class="linenos">4907</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="union-4908"><a href="#union-4908"><span class="linenos">4908</span></a><span class="sd"> Initializes a syntax tree from one UNION expression.</span> +</span><span id="union-4909"><a href="#union-4909"><span class="linenos">4909</span></a> +</span><span id="union-4910"><a href="#union-4910"><span class="linenos">4910</span></a><span class="sd"> Example:</span> +</span><span id="union-4911"><a href="#union-4911"><span class="linenos">4911</span></a><span class="sd"> >>> union("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> +</span><span id="union-4912"><a href="#union-4912"><span class="linenos">4912</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> +</span><span id="union-4913"><a href="#union-4913"><span class="linenos">4913</span></a> +</span><span id="union-4914"><a href="#union-4914"><span class="linenos">4914</span></a><span class="sd"> Args:</span> +</span><span id="union-4915"><a href="#union-4915"><span class="linenos">4915</span></a><span class="sd"> left: the SQL code string corresponding to the left-hand side.</span> +</span><span id="union-4916"><a href="#union-4916"><span class="linenos">4916</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="union-4917"><a href="#union-4917"><span class="linenos">4917</span></a><span class="sd"> right: the SQL code string corresponding to the right-hand side.</span> +</span><span id="union-4918"><a href="#union-4918"><span class="linenos">4918</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="union-4919"><a href="#union-4919"><span class="linenos">4919</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="union-4920"><a href="#union-4920"><span class="linenos">4920</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="union-4921"><a href="#union-4921"><span class="linenos">4921</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="union-4922"><a href="#union-4922"><span class="linenos">4922</span></a> +</span><span id="union-4923"><a href="#union-4923"><span class="linenos">4923</span></a><span class="sd"> Returns:</span> +</span><span id="union-4924"><a href="#union-4924"><span class="linenos">4924</span></a><span class="sd"> The new Union instance.</span> +</span><span id="union-4925"><a href="#union-4925"><span class="linenos">4925</span></a><span class="sd"> """</span> +</span><span id="union-4926"><a href="#union-4926"><span class="linenos">4926</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-4927"><a href="#union-4927"><span class="linenos">4927</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-4928"><a href="#union-4928"><span class="linenos">4928</span></a> +</span><span id="union-4929"><a href="#union-4929"><span class="linenos">4929</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> @@ -66616,32 +66743,32 @@ 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-4929"><a href="#intersect-4929"><span class="linenos">4929</span></a><span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span> -</span><span id="intersect-4930"><a href="#intersect-4930"><span class="linenos">4930</span></a> <span class="n">left</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">right</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="intersect-4931"><a href="#intersect-4931"><span class="linenos">4931</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Intersect</span><span class="p">:</span> -</span><span id="intersect-4932"><a href="#intersect-4932"><span class="linenos">4932</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="intersect-4933"><a href="#intersect-4933"><span class="linenos">4933</span></a><span class="sd"> Initializes a syntax tree from one INTERSECT expression.</span> -</span><span id="intersect-4934"><a href="#intersect-4934"><span class="linenos">4934</span></a> -</span><span id="intersect-4935"><a href="#intersect-4935"><span class="linenos">4935</span></a><span class="sd"> Example:</span> -</span><span id="intersect-4936"><a href="#intersect-4936"><span class="linenos">4936</span></a><span class="sd"> >>> intersect("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> -</span><span id="intersect-4937"><a href="#intersect-4937"><span class="linenos">4937</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> -</span><span id="intersect-4938"><a href="#intersect-4938"><span class="linenos">4938</span></a> -</span><span id="intersect-4939"><a href="#intersect-4939"><span class="linenos">4939</span></a><span class="sd"> Args:</span> -</span><span id="intersect-4940"><a href="#intersect-4940"><span class="linenos">4940</span></a><span class="sd"> left: the SQL code string corresponding to the left-hand side.</span> -</span><span id="intersect-4941"><a href="#intersect-4941"><span class="linenos">4941</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="intersect-4942"><a href="#intersect-4942"><span class="linenos">4942</span></a><span class="sd"> right: the SQL code string corresponding to the right-hand side.</span> -</span><span id="intersect-4943"><a href="#intersect-4943"><span class="linenos">4943</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="intersect-4944"><a href="#intersect-4944"><span class="linenos">4944</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="intersect-4945"><a href="#intersect-4945"><span class="linenos">4945</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="intersect-4946"><a href="#intersect-4946"><span class="linenos">4946</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="intersect-4947"><a href="#intersect-4947"><span class="linenos">4947</span></a> -</span><span id="intersect-4948"><a href="#intersect-4948"><span class="linenos">4948</span></a><span class="sd"> Returns:</span> -</span><span id="intersect-4949"><a href="#intersect-4949"><span class="linenos">4949</span></a><span class="sd"> The new Intersect instance.</span> -</span><span id="intersect-4950"><a href="#intersect-4950"><span class="linenos">4950</span></a><span class="sd"> """</span> -</span><span id="intersect-4951"><a href="#intersect-4951"><span class="linenos">4951</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-4952"><a href="#intersect-4952"><span class="linenos">4952</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-4953"><a href="#intersect-4953"><span class="linenos">4953</span></a> -</span><span id="intersect-4954"><a href="#intersect-4954"><span class="linenos">4954</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-4932"><a href="#intersect-4932"><span class="linenos">4932</span></a><span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span> +</span><span id="intersect-4933"><a href="#intersect-4933"><span class="linenos">4933</span></a> <span class="n">left</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">right</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="intersect-4934"><a href="#intersect-4934"><span class="linenos">4934</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Intersect</span><span class="p">:</span> +</span><span id="intersect-4935"><a href="#intersect-4935"><span class="linenos">4935</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="intersect-4936"><a href="#intersect-4936"><span class="linenos">4936</span></a><span class="sd"> Initializes a syntax tree from one INTERSECT expression.</span> +</span><span id="intersect-4937"><a href="#intersect-4937"><span class="linenos">4937</span></a> +</span><span id="intersect-4938"><a href="#intersect-4938"><span class="linenos">4938</span></a><span class="sd"> Example:</span> +</span><span id="intersect-4939"><a href="#intersect-4939"><span class="linenos">4939</span></a><span class="sd"> >>> intersect("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> +</span><span id="intersect-4940"><a href="#intersect-4940"><span class="linenos">4940</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> +</span><span id="intersect-4941"><a href="#intersect-4941"><span class="linenos">4941</span></a> +</span><span id="intersect-4942"><a href="#intersect-4942"><span class="linenos">4942</span></a><span class="sd"> Args:</span> +</span><span id="intersect-4943"><a href="#intersect-4943"><span class="linenos">4943</span></a><span class="sd"> left: the SQL code string corresponding to the left-hand side.</span> +</span><span id="intersect-4944"><a href="#intersect-4944"><span class="linenos">4944</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="intersect-4945"><a href="#intersect-4945"><span class="linenos">4945</span></a><span class="sd"> right: the SQL code string corresponding to the right-hand side.</span> +</span><span id="intersect-4946"><a href="#intersect-4946"><span class="linenos">4946</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="intersect-4947"><a href="#intersect-4947"><span class="linenos">4947</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="intersect-4948"><a href="#intersect-4948"><span class="linenos">4948</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="intersect-4949"><a href="#intersect-4949"><span class="linenos">4949</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="intersect-4950"><a href="#intersect-4950"><span class="linenos">4950</span></a> +</span><span id="intersect-4951"><a href="#intersect-4951"><span class="linenos">4951</span></a><span class="sd"> Returns:</span> +</span><span id="intersect-4952"><a href="#intersect-4952"><span class="linenos">4952</span></a><span class="sd"> The new Intersect instance.</span> +</span><span id="intersect-4953"><a href="#intersect-4953"><span class="linenos">4953</span></a><span class="sd"> """</span> +</span><span id="intersect-4954"><a href="#intersect-4954"><span class="linenos">4954</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-4955"><a href="#intersect-4955"><span class="linenos">4955</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-4956"><a href="#intersect-4956"><span class="linenos">4956</span></a> +</span><span id="intersect-4957"><a href="#intersect-4957"><span class="linenos">4957</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> @@ -66689,32 +66816,32 @@ 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_-4957"><a href="#except_-4957"><span class="linenos">4957</span></a><span class="k">def</span> <span class="nf">except_</span><span class="p">(</span> -</span><span id="except_-4958"><a href="#except_-4958"><span class="linenos">4958</span></a> <span class="n">left</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">right</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="except_-4959"><a href="#except_-4959"><span class="linenos">4959</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Except</span><span class="p">:</span> -</span><span id="except_-4960"><a href="#except_-4960"><span class="linenos">4960</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="except_-4961"><a href="#except_-4961"><span class="linenos">4961</span></a><span class="sd"> Initializes a syntax tree from one EXCEPT expression.</span> -</span><span id="except_-4962"><a href="#except_-4962"><span class="linenos">4962</span></a> -</span><span id="except_-4963"><a href="#except_-4963"><span class="linenos">4963</span></a><span class="sd"> Example:</span> -</span><span id="except_-4964"><a href="#except_-4964"><span class="linenos">4964</span></a><span class="sd"> >>> except_("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> -</span><span id="except_-4965"><a href="#except_-4965"><span class="linenos">4965</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> -</span><span id="except_-4966"><a href="#except_-4966"><span class="linenos">4966</span></a> -</span><span id="except_-4967"><a href="#except_-4967"><span class="linenos">4967</span></a><span class="sd"> Args:</span> -</span><span id="except_-4968"><a href="#except_-4968"><span class="linenos">4968</span></a><span class="sd"> left: the SQL code string corresponding to the left-hand side.</span> -</span><span id="except_-4969"><a href="#except_-4969"><span class="linenos">4969</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="except_-4970"><a href="#except_-4970"><span class="linenos">4970</span></a><span class="sd"> right: the SQL code string corresponding to the right-hand side.</span> -</span><span id="except_-4971"><a href="#except_-4971"><span class="linenos">4971</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="except_-4972"><a href="#except_-4972"><span class="linenos">4972</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> -</span><span id="except_-4973"><a href="#except_-4973"><span class="linenos">4973</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="except_-4974"><a href="#except_-4974"><span class="linenos">4974</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="except_-4975"><a href="#except_-4975"><span class="linenos">4975</span></a> -</span><span id="except_-4976"><a href="#except_-4976"><span class="linenos">4976</span></a><span class="sd"> Returns:</span> -</span><span id="except_-4977"><a href="#except_-4977"><span class="linenos">4977</span></a><span class="sd"> The new Except instance.</span> -</span><span id="except_-4978"><a href="#except_-4978"><span class="linenos">4978</span></a><span class="sd"> """</span> -</span><span id="except_-4979"><a href="#except_-4979"><span class="linenos">4979</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_-4980"><a href="#except_-4980"><span class="linenos">4980</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_-4981"><a href="#except_-4981"><span class="linenos">4981</span></a> -</span><span id="except_-4982"><a href="#except_-4982"><span class="linenos">4982</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_-4960"><a href="#except_-4960"><span class="linenos">4960</span></a><span class="k">def</span> <span class="nf">except_</span><span class="p">(</span> +</span><span id="except_-4961"><a href="#except_-4961"><span class="linenos">4961</span></a> <span class="n">left</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">right</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> <span class="n">distinct</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">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><span id="except_-4962"><a href="#except_-4962"><span class="linenos">4962</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Except</span><span class="p">:</span> +</span><span id="except_-4963"><a href="#except_-4963"><span class="linenos">4963</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="except_-4964"><a href="#except_-4964"><span class="linenos">4964</span></a><span class="sd"> Initializes a syntax tree from one EXCEPT expression.</span> +</span><span id="except_-4965"><a href="#except_-4965"><span class="linenos">4965</span></a> +</span><span id="except_-4966"><a href="#except_-4966"><span class="linenos">4966</span></a><span class="sd"> Example:</span> +</span><span id="except_-4967"><a href="#except_-4967"><span class="linenos">4967</span></a><span class="sd"> >>> except_("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> +</span><span id="except_-4968"><a href="#except_-4968"><span class="linenos">4968</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> +</span><span id="except_-4969"><a href="#except_-4969"><span class="linenos">4969</span></a> +</span><span id="except_-4970"><a href="#except_-4970"><span class="linenos">4970</span></a><span class="sd"> Args:</span> +</span><span id="except_-4971"><a href="#except_-4971"><span class="linenos">4971</span></a><span class="sd"> left: the SQL code string corresponding to the left-hand side.</span> +</span><span id="except_-4972"><a href="#except_-4972"><span class="linenos">4972</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="except_-4973"><a href="#except_-4973"><span class="linenos">4973</span></a><span class="sd"> right: the SQL code string corresponding to the right-hand side.</span> +</span><span id="except_-4974"><a href="#except_-4974"><span class="linenos">4974</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="except_-4975"><a href="#except_-4975"><span class="linenos">4975</span></a><span class="sd"> distinct: set the DISTINCT flag if and only if this is true.</span> +</span><span id="except_-4976"><a href="#except_-4976"><span class="linenos">4976</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="except_-4977"><a href="#except_-4977"><span class="linenos">4977</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="except_-4978"><a href="#except_-4978"><span class="linenos">4978</span></a> +</span><span id="except_-4979"><a href="#except_-4979"><span class="linenos">4979</span></a><span class="sd"> Returns:</span> +</span><span id="except_-4980"><a href="#except_-4980"><span class="linenos">4980</span></a><span class="sd"> The new Except instance.</span> +</span><span id="except_-4981"><a href="#except_-4981"><span class="linenos">4981</span></a><span class="sd"> """</span> +</span><span id="except_-4982"><a href="#except_-4982"><span class="linenos">4982</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_-4983"><a href="#except_-4983"><span class="linenos">4983</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_-4984"><a href="#except_-4984"><span class="linenos">4984</span></a> +</span><span id="except_-4985"><a href="#except_-4985"><span class="linenos">4985</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> @@ -66762,26 +66889,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-4985"><a href="#select-4985"><span class="linenos">4985</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="n">ExpOrStr</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-4986"><a href="#select-4986"><span class="linenos">4986</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="select-4987"><a href="#select-4987"><span class="linenos">4987</span></a><span class="sd"> Initializes a syntax tree from one or multiple SELECT expressions.</span> -</span><span id="select-4988"><a href="#select-4988"><span class="linenos">4988</span></a> -</span><span id="select-4989"><a href="#select-4989"><span class="linenos">4989</span></a><span class="sd"> Example:</span> -</span><span id="select-4990"><a href="#select-4990"><span class="linenos">4990</span></a><span class="sd"> >>> select("col1", "col2").from_("tbl").sql()</span> -</span><span id="select-4991"><a href="#select-4991"><span class="linenos">4991</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> -</span><span id="select-4992"><a href="#select-4992"><span class="linenos">4992</span></a> -</span><span id="select-4993"><a href="#select-4993"><span class="linenos">4993</span></a><span class="sd"> Args:</span> -</span><span id="select-4994"><a href="#select-4994"><span class="linenos">4994</span></a><span class="sd"> *expressions: the SQL code string to parse as the expressions of a</span> -</span><span id="select-4995"><a href="#select-4995"><span class="linenos">4995</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> -</span><span id="select-4996"><a href="#select-4996"><span class="linenos">4996</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> -</span><span id="select-4997"><a href="#select-4997"><span class="linenos">4997</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="select-4998"><a href="#select-4998"><span class="linenos">4998</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="select-4999"><a href="#select-4999"><span class="linenos">4999</span></a><span class="sd"> that an input expression is a SQL string).</span> -</span><span id="select-5000"><a href="#select-5000"><span class="linenos">5000</span></a> -</span><span id="select-5001"><a href="#select-5001"><span class="linenos">5001</span></a><span class="sd"> Returns:</span> -</span><span id="select-5002"><a href="#select-5002"><span class="linenos">5002</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> -</span><span id="select-5003"><a href="#select-5003"><span class="linenos">5003</span></a><span class="sd"> """</span> -</span><span id="select-5004"><a href="#select-5004"><span class="linenos">5004</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-4988"><a href="#select-4988"><span class="linenos">4988</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="n">ExpOrStr</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-4989"><a href="#select-4989"><span class="linenos">4989</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="select-4990"><a href="#select-4990"><span class="linenos">4990</span></a><span class="sd"> Initializes a syntax tree from one or multiple SELECT expressions.</span> +</span><span id="select-4991"><a href="#select-4991"><span class="linenos">4991</span></a> +</span><span id="select-4992"><a href="#select-4992"><span class="linenos">4992</span></a><span class="sd"> Example:</span> +</span><span id="select-4993"><a href="#select-4993"><span class="linenos">4993</span></a><span class="sd"> >>> select("col1", "col2").from_("tbl").sql()</span> +</span><span id="select-4994"><a href="#select-4994"><span class="linenos">4994</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> +</span><span id="select-4995"><a href="#select-4995"><span class="linenos">4995</span></a> +</span><span id="select-4996"><a href="#select-4996"><span class="linenos">4996</span></a><span class="sd"> Args:</span> +</span><span id="select-4997"><a href="#select-4997"><span class="linenos">4997</span></a><span class="sd"> *expressions: the SQL code string to parse as the expressions of a</span> +</span><span id="select-4998"><a href="#select-4998"><span class="linenos">4998</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> +</span><span id="select-4999"><a href="#select-4999"><span class="linenos">4999</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> +</span><span id="select-5000"><a href="#select-5000"><span class="linenos">5000</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="select-5001"><a href="#select-5001"><span class="linenos">5001</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="select-5002"><a href="#select-5002"><span class="linenos">5002</span></a><span class="sd"> that an input expression is a SQL string).</span> +</span><span id="select-5003"><a href="#select-5003"><span class="linenos">5003</span></a> +</span><span id="select-5004"><a href="#select-5004"><span class="linenos">5004</span></a><span class="sd"> Returns:</span> +</span><span id="select-5005"><a href="#select-5005"><span class="linenos">5005</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> +</span><span id="select-5006"><a href="#select-5006"><span class="linenos">5006</span></a><span class="sd"> """</span> +</span><span id="select-5007"><a href="#select-5007"><span class="linenos">5007</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> @@ -66828,26 +66955,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_-5007"><a href="#from_-5007"><span class="linenos">5007</span></a><span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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="from_-5008"><a href="#from_-5008"><span class="linenos">5008</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="from_-5009"><a href="#from_-5009"><span class="linenos">5009</span></a><span class="sd"> Initializes a syntax tree from a FROM expression.</span> -</span><span id="from_-5010"><a href="#from_-5010"><span class="linenos">5010</span></a> -</span><span id="from_-5011"><a href="#from_-5011"><span class="linenos">5011</span></a><span class="sd"> Example:</span> -</span><span id="from_-5012"><a href="#from_-5012"><span class="linenos">5012</span></a><span class="sd"> >>> from_("tbl").select("col1", "col2").sql()</span> -</span><span id="from_-5013"><a href="#from_-5013"><span class="linenos">5013</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> -</span><span id="from_-5014"><a href="#from_-5014"><span class="linenos">5014</span></a> -</span><span id="from_-5015"><a href="#from_-5015"><span class="linenos">5015</span></a><span class="sd"> Args:</span> -</span><span id="from_-5016"><a href="#from_-5016"><span class="linenos">5016</span></a><span class="sd"> *expression: the SQL code string to parse as the FROM expressions of a</span> -</span><span id="from_-5017"><a href="#from_-5017"><span class="linenos">5017</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> -</span><span id="from_-5018"><a href="#from_-5018"><span class="linenos">5018</span></a><span class="sd"> dialect: the dialect used to parse the input expression (in the case that the</span> -</span><span id="from_-5019"><a href="#from_-5019"><span class="linenos">5019</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="from_-5020"><a href="#from_-5020"><span class="linenos">5020</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="from_-5021"><a href="#from_-5021"><span class="linenos">5021</span></a><span class="sd"> that the input expression is a SQL string).</span> -</span><span id="from_-5022"><a href="#from_-5022"><span class="linenos">5022</span></a> -</span><span id="from_-5023"><a href="#from_-5023"><span class="linenos">5023</span></a><span class="sd"> Returns:</span> -</span><span id="from_-5024"><a href="#from_-5024"><span class="linenos">5024</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> -</span><span id="from_-5025"><a href="#from_-5025"><span class="linenos">5025</span></a><span class="sd"> """</span> -</span><span id="from_-5026"><a href="#from_-5026"><span class="linenos">5026</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="from_-5010"><a href="#from_-5010"><span class="linenos">5010</span></a><span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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="from_-5011"><a href="#from_-5011"><span class="linenos">5011</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="from_-5012"><a href="#from_-5012"><span class="linenos">5012</span></a><span class="sd"> Initializes a syntax tree from a FROM expression.</span> +</span><span id="from_-5013"><a href="#from_-5013"><span class="linenos">5013</span></a> +</span><span id="from_-5014"><a href="#from_-5014"><span class="linenos">5014</span></a><span class="sd"> Example:</span> +</span><span id="from_-5015"><a href="#from_-5015"><span class="linenos">5015</span></a><span class="sd"> >>> from_("tbl").select("col1", "col2").sql()</span> +</span><span id="from_-5016"><a href="#from_-5016"><span class="linenos">5016</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> +</span><span id="from_-5017"><a href="#from_-5017"><span class="linenos">5017</span></a> +</span><span id="from_-5018"><a href="#from_-5018"><span class="linenos">5018</span></a><span class="sd"> Args:</span> +</span><span id="from_-5019"><a href="#from_-5019"><span class="linenos">5019</span></a><span class="sd"> *expression: the SQL code string to parse as the FROM expressions of a</span> +</span><span id="from_-5020"><a href="#from_-5020"><span class="linenos">5020</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> +</span><span id="from_-5021"><a href="#from_-5021"><span class="linenos">5021</span></a><span class="sd"> dialect: the dialect used to parse the input expression (in the case that the</span> +</span><span id="from_-5022"><a href="#from_-5022"><span class="linenos">5022</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="from_-5023"><a href="#from_-5023"><span class="linenos">5023</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="from_-5024"><a href="#from_-5024"><span class="linenos">5024</span></a><span class="sd"> that the input expression is a SQL string).</span> +</span><span id="from_-5025"><a href="#from_-5025"><span class="linenos">5025</span></a> +</span><span id="from_-5026"><a href="#from_-5026"><span class="linenos">5026</span></a><span class="sd"> Returns:</span> +</span><span id="from_-5027"><a href="#from_-5027"><span class="linenos">5027</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> +</span><span id="from_-5028"><a href="#from_-5028"><span class="linenos">5028</span></a><span class="sd"> """</span> +</span><span id="from_-5029"><a href="#from_-5029"><span class="linenos">5029</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> @@ -66894,53 +67021,53 @@ 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-5029"><a href="#update-5029"><span class="linenos">5029</span></a><span class="k">def</span> <span class="nf">update</span><span class="p">(</span> -</span><span id="update-5030"><a href="#update-5030"><span class="linenos">5030</span></a> <span class="n">table</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">,</span> -</span><span id="update-5031"><a href="#update-5031"><span class="linenos">5031</span></a> <span class="n">properties</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> -</span><span id="update-5032"><a href="#update-5032"><span class="linenos">5032</span></a> <span class="n">where</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="update-5033"><a href="#update-5033"><span class="linenos">5033</span></a> <span class="n">from_</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="update-5034"><a href="#update-5034"><span class="linenos">5034</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="update-5035"><a href="#update-5035"><span class="linenos">5035</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="update-5036"><a href="#update-5036"><span class="linenos">5036</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Update</span><span class="p">:</span> -</span><span id="update-5037"><a href="#update-5037"><span class="linenos">5037</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="update-5038"><a href="#update-5038"><span class="linenos">5038</span></a><span class="sd"> Creates an update statement.</span> -</span><span id="update-5039"><a href="#update-5039"><span class="linenos">5039</span></a> -</span><span id="update-5040"><a href="#update-5040"><span class="linenos">5040</span></a><span class="sd"> Example:</span> -</span><span id="update-5041"><a href="#update-5041"><span class="linenos">5041</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-5042"><a href="#update-5042"><span class="linenos">5042</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-5043"><a href="#update-5043"><span class="linenos">5043</span></a> -</span><span id="update-5044"><a href="#update-5044"><span class="linenos">5044</span></a><span class="sd"> Args:</span> -</span><span id="update-5045"><a href="#update-5045"><span class="linenos">5045</span></a><span class="sd"> *properties: dictionary of properties to set which are</span> -</span><span id="update-5046"><a href="#update-5046"><span class="linenos">5046</span></a><span class="sd"> auto converted to sql objects eg None -> NULL</span> -</span><span id="update-5047"><a href="#update-5047"><span class="linenos">5047</span></a><span class="sd"> where: sql conditional parsed into a WHERE statement</span> -</span><span id="update-5048"><a href="#update-5048"><span class="linenos">5048</span></a><span class="sd"> from_: sql statement parsed into a FROM statement</span> -</span><span id="update-5049"><a href="#update-5049"><span class="linenos">5049</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="update-5050"><a href="#update-5050"><span class="linenos">5050</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="update-5051"><a href="#update-5051"><span class="linenos">5051</span></a> -</span><span id="update-5052"><a href="#update-5052"><span class="linenos">5052</span></a><span class="sd"> Returns:</span> -</span><span id="update-5053"><a href="#update-5053"><span class="linenos">5053</span></a><span class="sd"> Update: the syntax tree for the UPDATE statement.</span> -</span><span id="update-5054"><a href="#update-5054"><span class="linenos">5054</span></a><span class="sd"> """</span> -</span><span id="update-5055"><a href="#update-5055"><span class="linenos">5055</span></a> <span class="n">update_expr</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-5056"><a href="#update-5056"><span class="linenos">5056</span></a> <span class="n">update_expr</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="update-5057"><a href="#update-5057"><span class="linenos">5057</span></a> <span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="update-5058"><a href="#update-5058"><span class="linenos">5058</span></a> <span class="p">[</span> -</span><span id="update-5059"><a href="#update-5059"><span class="linenos">5059</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-5060"><a href="#update-5060"><span class="linenos">5060</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-5061"><a href="#update-5061"><span class="linenos">5061</span></a> <span class="p">],</span> -</span><span id="update-5062"><a href="#update-5062"><span class="linenos">5062</span></a> <span class="p">)</span> -</span><span id="update-5063"><a href="#update-5063"><span class="linenos">5063</span></a> <span class="k">if</span> <span class="n">from_</span><span class="p">:</span> -</span><span id="update-5064"><a href="#update-5064"><span class="linenos">5064</span></a> <span class="n">update_expr</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="update-5065"><a href="#update-5065"><span class="linenos">5065</span></a> <span class="s2">"from"</span><span class="p">,</span> -</span><span id="update-5066"><a href="#update-5066"><span class="linenos">5066</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-5067"><a href="#update-5067"><span class="linenos">5067</span></a> <span class="p">)</span> -</span><span id="update-5068"><a href="#update-5068"><span class="linenos">5068</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-5069"><a href="#update-5069"><span class="linenos">5069</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-5070"><a href="#update-5070"><span class="linenos">5070</span></a> <span class="k">if</span> <span class="n">where</span><span class="p">:</span> -</span><span id="update-5071"><a href="#update-5071"><span class="linenos">5071</span></a> <span class="n">update_expr</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="update-5072"><a href="#update-5072"><span class="linenos">5072</span></a> <span class="s2">"where"</span><span class="p">,</span> -</span><span id="update-5073"><a href="#update-5073"><span class="linenos">5073</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-5074"><a href="#update-5074"><span class="linenos">5074</span></a> <span class="p">)</span> -</span><span id="update-5075"><a href="#update-5075"><span class="linenos">5075</span></a> <span class="k">return</span> <span class="n">update_expr</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="update-5032"><a href="#update-5032"><span class="linenos">5032</span></a><span class="k">def</span> <span class="nf">update</span><span class="p">(</span> +</span><span id="update-5033"><a href="#update-5033"><span class="linenos">5033</span></a> <span class="n">table</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">,</span> +</span><span id="update-5034"><a href="#update-5034"><span class="linenos">5034</span></a> <span class="n">properties</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> +</span><span id="update-5035"><a href="#update-5035"><span class="linenos">5035</span></a> <span class="n">where</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="update-5036"><a href="#update-5036"><span class="linenos">5036</span></a> <span class="n">from_</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="update-5037"><a href="#update-5037"><span class="linenos">5037</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="update-5038"><a href="#update-5038"><span class="linenos">5038</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="update-5039"><a href="#update-5039"><span class="linenos">5039</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Update</span><span class="p">:</span> +</span><span id="update-5040"><a href="#update-5040"><span class="linenos">5040</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="update-5041"><a href="#update-5041"><span class="linenos">5041</span></a><span class="sd"> Creates an update statement.</span> +</span><span id="update-5042"><a href="#update-5042"><span class="linenos">5042</span></a> +</span><span id="update-5043"><a href="#update-5043"><span class="linenos">5043</span></a><span class="sd"> Example:</span> +</span><span id="update-5044"><a href="#update-5044"><span class="linenos">5044</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-5045"><a href="#update-5045"><span class="linenos">5045</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-5046"><a href="#update-5046"><span class="linenos">5046</span></a> +</span><span id="update-5047"><a href="#update-5047"><span class="linenos">5047</span></a><span class="sd"> Args:</span> +</span><span id="update-5048"><a href="#update-5048"><span class="linenos">5048</span></a><span class="sd"> *properties: dictionary of properties to set which are</span> +</span><span id="update-5049"><a href="#update-5049"><span class="linenos">5049</span></a><span class="sd"> auto converted to sql objects eg None -> NULL</span> +</span><span id="update-5050"><a href="#update-5050"><span class="linenos">5050</span></a><span class="sd"> where: sql conditional parsed into a WHERE statement</span> +</span><span id="update-5051"><a href="#update-5051"><span class="linenos">5051</span></a><span class="sd"> from_: sql statement parsed into a FROM statement</span> +</span><span id="update-5052"><a href="#update-5052"><span class="linenos">5052</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="update-5053"><a href="#update-5053"><span class="linenos">5053</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="update-5054"><a href="#update-5054"><span class="linenos">5054</span></a> +</span><span id="update-5055"><a href="#update-5055"><span class="linenos">5055</span></a><span class="sd"> Returns:</span> +</span><span id="update-5056"><a href="#update-5056"><span class="linenos">5056</span></a><span class="sd"> Update: the syntax tree for the UPDATE statement.</span> +</span><span id="update-5057"><a href="#update-5057"><span class="linenos">5057</span></a><span class="sd"> """</span> +</span><span id="update-5058"><a href="#update-5058"><span class="linenos">5058</span></a> <span class="n">update_expr</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-5059"><a href="#update-5059"><span class="linenos">5059</span></a> <span class="n">update_expr</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="update-5060"><a href="#update-5060"><span class="linenos">5060</span></a> <span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="update-5061"><a href="#update-5061"><span class="linenos">5061</span></a> <span class="p">[</span> +</span><span id="update-5062"><a href="#update-5062"><span class="linenos">5062</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-5063"><a href="#update-5063"><span class="linenos">5063</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-5064"><a href="#update-5064"><span class="linenos">5064</span></a> <span class="p">],</span> +</span><span id="update-5065"><a href="#update-5065"><span class="linenos">5065</span></a> <span class="p">)</span> +</span><span id="update-5066"><a href="#update-5066"><span class="linenos">5066</span></a> <span class="k">if</span> <span class="n">from_</span><span class="p">:</span> +</span><span id="update-5067"><a href="#update-5067"><span class="linenos">5067</span></a> <span class="n">update_expr</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="update-5068"><a href="#update-5068"><span class="linenos">5068</span></a> <span class="s2">"from"</span><span class="p">,</span> +</span><span id="update-5069"><a href="#update-5069"><span class="linenos">5069</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-5070"><a href="#update-5070"><span class="linenos">5070</span></a> <span class="p">)</span> +</span><span id="update-5071"><a href="#update-5071"><span class="linenos">5071</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-5072"><a href="#update-5072"><span class="linenos">5072</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-5073"><a href="#update-5073"><span class="linenos">5073</span></a> <span class="k">if</span> <span class="n">where</span><span class="p">:</span> +</span><span id="update-5074"><a href="#update-5074"><span class="linenos">5074</span></a> <span class="n">update_expr</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="update-5075"><a href="#update-5075"><span class="linenos">5075</span></a> <span class="s2">"where"</span><span class="p">,</span> +</span><span id="update-5076"><a href="#update-5076"><span class="linenos">5076</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-5077"><a href="#update-5077"><span class="linenos">5077</span></a> <span class="p">)</span> +</span><span id="update-5078"><a href="#update-5078"><span class="linenos">5078</span></a> <span class="k">return</span> <span class="n">update_expr</span> </span></pre></div> @@ -66987,35 +67114,35 @@ 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-5078"><a href="#delete-5078"><span class="linenos">5078</span></a><span class="k">def</span> <span class="nf">delete</span><span class="p">(</span> -</span><span id="delete-5079"><a href="#delete-5079"><span class="linenos">5079</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="delete-5080"><a href="#delete-5080"><span class="linenos">5080</span></a> <span class="n">where</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="delete-5081"><a href="#delete-5081"><span class="linenos">5081</span></a> <span class="n">returning</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="delete-5082"><a href="#delete-5082"><span class="linenos">5082</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="delete-5083"><a href="#delete-5083"><span class="linenos">5083</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="delete-5084"><a href="#delete-5084"><span class="linenos">5084</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="delete-5085"><a href="#delete-5085"><span class="linenos">5085</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="delete-5086"><a href="#delete-5086"><span class="linenos">5086</span></a><span class="sd"> Builds a delete statement.</span> -</span><span id="delete-5087"><a href="#delete-5087"><span class="linenos">5087</span></a> -</span><span id="delete-5088"><a href="#delete-5088"><span class="linenos">5088</span></a><span class="sd"> Example:</span> -</span><span id="delete-5089"><a href="#delete-5089"><span class="linenos">5089</span></a><span class="sd"> >>> delete("my_table", where="id > 1").sql()</span> -</span><span id="delete-5090"><a href="#delete-5090"><span class="linenos">5090</span></a><span class="sd"> 'DELETE FROM my_table WHERE id > 1'</span> -</span><span id="delete-5091"><a href="#delete-5091"><span class="linenos">5091</span></a> -</span><span id="delete-5092"><a href="#delete-5092"><span class="linenos">5092</span></a><span class="sd"> Args:</span> -</span><span id="delete-5093"><a href="#delete-5093"><span class="linenos">5093</span></a><span class="sd"> where: sql conditional parsed into a WHERE statement</span> -</span><span id="delete-5094"><a href="#delete-5094"><span class="linenos">5094</span></a><span class="sd"> returning: sql conditional parsed into a RETURNING statement</span> -</span><span id="delete-5095"><a href="#delete-5095"><span class="linenos">5095</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="delete-5096"><a href="#delete-5096"><span class="linenos">5096</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="delete-5097"><a href="#delete-5097"><span class="linenos">5097</span></a> -</span><span id="delete-5098"><a href="#delete-5098"><span class="linenos">5098</span></a><span class="sd"> Returns:</span> -</span><span id="delete-5099"><a href="#delete-5099"><span class="linenos">5099</span></a><span class="sd"> Delete: the syntax tree for the DELETE statement.</span> -</span><span id="delete-5100"><a href="#delete-5100"><span class="linenos">5100</span></a><span class="sd"> """</span> -</span><span id="delete-5101"><a href="#delete-5101"><span class="linenos">5101</span></a> <span class="n">delete_expr</span> <span class="o">=</span> <span class="n">Delete</span><span class="p">()</span><span class="o">.</span><span class="n">delete</span><span class="p">(</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="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="delete-5102"><a href="#delete-5102"><span class="linenos">5102</span></a> <span class="k">if</span> <span class="n">where</span><span class="p">:</span> -</span><span id="delete-5103"><a href="#delete-5103"><span class="linenos">5103</span></a> <span class="n">delete_expr</span> <span class="o">=</span> <span class="n">delete_expr</span><span class="o">.</span><span class="n">where</span><span class="p">(</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">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="delete-5104"><a href="#delete-5104"><span class="linenos">5104</span></a> <span class="k">if</span> <span class="n">returning</span><span class="p">:</span> -</span><span id="delete-5105"><a href="#delete-5105"><span class="linenos">5105</span></a> <span class="n">delete_expr</span> <span class="o">=</span> <span class="n">delete_expr</span><span class="o">.</span><span class="n">returning</span><span class="p">(</span><span class="n">returning</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="delete-5106"><a href="#delete-5106"><span class="linenos">5106</span></a> <span class="k">return</span> <span class="n">delete_expr</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="delete-5081"><a href="#delete-5081"><span class="linenos">5081</span></a><span class="k">def</span> <span class="nf">delete</span><span class="p">(</span> +</span><span id="delete-5082"><a href="#delete-5082"><span class="linenos">5082</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="delete-5083"><a href="#delete-5083"><span class="linenos">5083</span></a> <span class="n">where</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="delete-5084"><a href="#delete-5084"><span class="linenos">5084</span></a> <span class="n">returning</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">ExpOrStr</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="delete-5085"><a href="#delete-5085"><span class="linenos">5085</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="delete-5086"><a href="#delete-5086"><span class="linenos">5086</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="delete-5087"><a href="#delete-5087"><span class="linenos">5087</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="delete-5088"><a href="#delete-5088"><span class="linenos">5088</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="delete-5089"><a href="#delete-5089"><span class="linenos">5089</span></a><span class="sd"> Builds a delete statement.</span> +</span><span id="delete-5090"><a href="#delete-5090"><span class="linenos">5090</span></a> +</span><span id="delete-5091"><a href="#delete-5091"><span class="linenos">5091</span></a><span class="sd"> Example:</span> +</span><span id="delete-5092"><a href="#delete-5092"><span class="linenos">5092</span></a><span class="sd"> >>> delete("my_table", where="id > 1").sql()</span> +</span><span id="delete-5093"><a href="#delete-5093"><span class="linenos">5093</span></a><span class="sd"> 'DELETE FROM my_table WHERE id > 1'</span> +</span><span id="delete-5094"><a href="#delete-5094"><span class="linenos">5094</span></a> +</span><span id="delete-5095"><a href="#delete-5095"><span class="linenos">5095</span></a><span class="sd"> Args:</span> +</span><span id="delete-5096"><a href="#delete-5096"><span class="linenos">5096</span></a><span class="sd"> where: sql conditional parsed into a WHERE statement</span> +</span><span id="delete-5097"><a href="#delete-5097"><span class="linenos">5097</span></a><span class="sd"> returning: sql conditional parsed into a RETURNING statement</span> +</span><span id="delete-5098"><a href="#delete-5098"><span class="linenos">5098</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="delete-5099"><a href="#delete-5099"><span class="linenos">5099</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="delete-5100"><a href="#delete-5100"><span class="linenos">5100</span></a> +</span><span id="delete-5101"><a href="#delete-5101"><span class="linenos">5101</span></a><span class="sd"> Returns:</span> +</span><span id="delete-5102"><a href="#delete-5102"><span class="linenos">5102</span></a><span class="sd"> Delete: the syntax tree for the DELETE statement.</span> +</span><span id="delete-5103"><a href="#delete-5103"><span class="linenos">5103</span></a><span class="sd"> """</span> +</span><span id="delete-5104"><a href="#delete-5104"><span class="linenos">5104</span></a> <span class="n">delete_expr</span> <span class="o">=</span> <span class="n">Delete</span><span class="p">()</span><span class="o">.</span><span class="n">delete</span><span class="p">(</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="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="delete-5105"><a href="#delete-5105"><span class="linenos">5105</span></a> <span class="k">if</span> <span class="n">where</span><span class="p">:</span> +</span><span id="delete-5106"><a href="#delete-5106"><span class="linenos">5106</span></a> <span class="n">delete_expr</span> <span class="o">=</span> <span class="n">delete_expr</span><span class="o">.</span><span class="n">where</span><span class="p">(</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">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="delete-5107"><a href="#delete-5107"><span class="linenos">5107</span></a> <span class="k">if</span> <span class="n">returning</span><span class="p">:</span> +</span><span id="delete-5108"><a href="#delete-5108"><span class="linenos">5108</span></a> <span class="n">delete_expr</span> <span class="o">=</span> <span class="n">delete_expr</span><span class="o">.</span><span class="n">returning</span><span class="p">(</span><span class="n">returning</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="delete-5109"><a href="#delete-5109"><span class="linenos">5109</span></a> <span class="k">return</span> <span class="n">delete_expr</span> </span></pre></div> @@ -67060,49 +67187,49 @@ auto converted to sql objects eg None -> NULL</li> </div> <a class="headerlink" href="#insert"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="insert-5109"><a href="#insert-5109"><span class="linenos">5109</span></a><span class="k">def</span> <span class="nf">insert</span><span class="p">(</span> -</span><span id="insert-5110"><a href="#insert-5110"><span class="linenos">5110</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="insert-5111"><a href="#insert-5111"><span class="linenos">5111</span></a> <span class="n">into</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="insert-5112"><a href="#insert-5112"><span class="linenos">5112</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">Sequence</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="insert-5113"><a href="#insert-5113"><span class="linenos">5113</span></a> <span class="n">overwrite</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="insert-5114"><a href="#insert-5114"><span class="linenos">5114</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="insert-5115"><a href="#insert-5115"><span class="linenos">5115</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="insert-5116"><a href="#insert-5116"><span class="linenos">5116</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="insert-5117"><a href="#insert-5117"><span class="linenos">5117</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Insert</span><span class="p">:</span> -</span><span id="insert-5118"><a href="#insert-5118"><span class="linenos">5118</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="insert-5119"><a href="#insert-5119"><span class="linenos">5119</span></a><span class="sd"> Builds an INSERT statement.</span> -</span><span id="insert-5120"><a href="#insert-5120"><span class="linenos">5120</span></a> -</span><span id="insert-5121"><a href="#insert-5121"><span class="linenos">5121</span></a><span class="sd"> Example:</span> -</span><span id="insert-5122"><a href="#insert-5122"><span class="linenos">5122</span></a><span class="sd"> >>> insert("VALUES (1, 2, 3)", "tbl").sql()</span> -</span><span id="insert-5123"><a href="#insert-5123"><span class="linenos">5123</span></a><span class="sd"> 'INSERT INTO tbl VALUES (1, 2, 3)'</span> -</span><span id="insert-5124"><a href="#insert-5124"><span class="linenos">5124</span></a> -</span><span id="insert-5125"><a href="#insert-5125"><span class="linenos">5125</span></a><span class="sd"> Args:</span> -</span><span id="insert-5126"><a href="#insert-5126"><span class="linenos">5126</span></a><span class="sd"> expression: the sql string or expression of the INSERT statement</span> -</span><span id="insert-5127"><a href="#insert-5127"><span class="linenos">5127</span></a><span class="sd"> into: the tbl to insert data to.</span> -</span><span id="insert-5128"><a href="#insert-5128"><span class="linenos">5128</span></a><span class="sd"> columns: optionally the table's column names.</span> -</span><span id="insert-5129"><a href="#insert-5129"><span class="linenos">5129</span></a><span class="sd"> overwrite: whether to INSERT OVERWRITE or not.</span> -</span><span id="insert-5130"><a href="#insert-5130"><span class="linenos">5130</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="insert-5131"><a href="#insert-5131"><span class="linenos">5131</span></a><span class="sd"> copy: whether or not to copy the expression.</span> -</span><span id="insert-5132"><a href="#insert-5132"><span class="linenos">5132</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="insert-5133"><a href="#insert-5133"><span class="linenos">5133</span></a> -</span><span id="insert-5134"><a href="#insert-5134"><span class="linenos">5134</span></a><span class="sd"> Returns:</span> -</span><span id="insert-5135"><a href="#insert-5135"><span class="linenos">5135</span></a><span class="sd"> Insert: the syntax tree for the INSERT statement.</span> -</span><span id="insert-5136"><a href="#insert-5136"><span class="linenos">5136</span></a><span class="sd"> """</span> -</span><span id="insert-5137"><a href="#insert-5137"><span class="linenos">5137</span></a> <span class="n">expr</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="insert-5138"><a href="#insert-5138"><span class="linenos">5138</span></a> <span class="n">this</span><span class="p">:</span> <span class="n">Table</span> <span class="o">|</span> <span class="n">Schema</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">into</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="insert-5139"><a href="#insert-5139"><span class="linenos">5139</span></a> -</span><span id="insert-5140"><a href="#insert-5140"><span class="linenos">5140</span></a> <span class="k">if</span> <span class="n">columns</span><span class="p">:</span> -</span><span id="insert-5141"><a href="#insert-5141"><span class="linenos">5141</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="insert-5142"><a href="#insert-5142"><span class="linenos">5142</span></a> <span class="o">*</span><span class="n">columns</span><span class="p">,</span> -</span><span id="insert-5143"><a href="#insert-5143"><span class="linenos">5143</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">Schema</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">),</span> -</span><span id="insert-5144"><a href="#insert-5144"><span class="linenos">5144</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="insert-5145"><a href="#insert-5145"><span class="linenos">5145</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Identifier</span><span class="p">,</span> -</span><span id="insert-5146"><a href="#insert-5146"><span class="linenos">5146</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> -</span><span id="insert-5147"><a href="#insert-5147"><span class="linenos">5147</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="insert-5148"><a href="#insert-5148"><span class="linenos">5148</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="insert-5149"><a href="#insert-5149"><span class="linenos">5149</span></a> <span class="p">)</span> -</span><span id="insert-5150"><a href="#insert-5150"><span class="linenos">5150</span></a> -</span><span id="insert-5151"><a href="#insert-5151"><span class="linenos">5151</span></a> <span class="k">return</span> <span class="n">Insert</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">expr</span><span class="p">,</span> <span class="n">overwrite</span><span class="o">=</span><span class="n">overwrite</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="insert-5112"><a href="#insert-5112"><span class="linenos">5112</span></a><span class="k">def</span> <span class="nf">insert</span><span class="p">(</span> +</span><span id="insert-5113"><a href="#insert-5113"><span class="linenos">5113</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="insert-5114"><a href="#insert-5114"><span class="linenos">5114</span></a> <span class="n">into</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="insert-5115"><a href="#insert-5115"><span class="linenos">5115</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">Sequence</span><span class="p">[</span><span class="n">ExpOrStr</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="insert-5116"><a href="#insert-5116"><span class="linenos">5116</span></a> <span class="n">overwrite</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="insert-5117"><a href="#insert-5117"><span class="linenos">5117</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="insert-5118"><a href="#insert-5118"><span class="linenos">5118</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="insert-5119"><a href="#insert-5119"><span class="linenos">5119</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="insert-5120"><a href="#insert-5120"><span class="linenos">5120</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Insert</span><span class="p">:</span> +</span><span id="insert-5121"><a href="#insert-5121"><span class="linenos">5121</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="insert-5122"><a href="#insert-5122"><span class="linenos">5122</span></a><span class="sd"> Builds an INSERT statement.</span> +</span><span id="insert-5123"><a href="#insert-5123"><span class="linenos">5123</span></a> +</span><span id="insert-5124"><a href="#insert-5124"><span class="linenos">5124</span></a><span class="sd"> Example:</span> +</span><span id="insert-5125"><a href="#insert-5125"><span class="linenos">5125</span></a><span class="sd"> >>> insert("VALUES (1, 2, 3)", "tbl").sql()</span> +</span><span id="insert-5126"><a href="#insert-5126"><span class="linenos">5126</span></a><span class="sd"> 'INSERT INTO tbl VALUES (1, 2, 3)'</span> +</span><span id="insert-5127"><a href="#insert-5127"><span class="linenos">5127</span></a> +</span><span id="insert-5128"><a href="#insert-5128"><span class="linenos">5128</span></a><span class="sd"> Args:</span> +</span><span id="insert-5129"><a href="#insert-5129"><span class="linenos">5129</span></a><span class="sd"> expression: the sql string or expression of the INSERT statement</span> +</span><span id="insert-5130"><a href="#insert-5130"><span class="linenos">5130</span></a><span class="sd"> into: the tbl to insert data to.</span> +</span><span id="insert-5131"><a href="#insert-5131"><span class="linenos">5131</span></a><span class="sd"> columns: optionally the table's column names.</span> +</span><span id="insert-5132"><a href="#insert-5132"><span class="linenos">5132</span></a><span class="sd"> overwrite: whether to INSERT OVERWRITE or not.</span> +</span><span id="insert-5133"><a href="#insert-5133"><span class="linenos">5133</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="insert-5134"><a href="#insert-5134"><span class="linenos">5134</span></a><span class="sd"> copy: whether or not to copy the expression.</span> +</span><span id="insert-5135"><a href="#insert-5135"><span class="linenos">5135</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="insert-5136"><a href="#insert-5136"><span class="linenos">5136</span></a> +</span><span id="insert-5137"><a href="#insert-5137"><span class="linenos">5137</span></a><span class="sd"> Returns:</span> +</span><span id="insert-5138"><a href="#insert-5138"><span class="linenos">5138</span></a><span class="sd"> Insert: the syntax tree for the INSERT statement.</span> +</span><span id="insert-5139"><a href="#insert-5139"><span class="linenos">5139</span></a><span class="sd"> """</span> +</span><span id="insert-5140"><a href="#insert-5140"><span class="linenos">5140</span></a> <span class="n">expr</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="insert-5141"><a href="#insert-5141"><span class="linenos">5141</span></a> <span class="n">this</span><span class="p">:</span> <span class="n">Table</span> <span class="o">|</span> <span class="n">Schema</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">into</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="insert-5142"><a href="#insert-5142"><span class="linenos">5142</span></a> +</span><span id="insert-5143"><a href="#insert-5143"><span class="linenos">5143</span></a> <span class="k">if</span> <span class="n">columns</span><span class="p">:</span> +</span><span id="insert-5144"><a href="#insert-5144"><span class="linenos">5144</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="insert-5145"><a href="#insert-5145"><span class="linenos">5145</span></a> <span class="o">*</span><span class="n">columns</span><span class="p">,</span> +</span><span id="insert-5146"><a href="#insert-5146"><span class="linenos">5146</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">Schema</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">),</span> +</span><span id="insert-5147"><a href="#insert-5147"><span class="linenos">5147</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="insert-5148"><a href="#insert-5148"><span class="linenos">5148</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Identifier</span><span class="p">,</span> +</span><span id="insert-5149"><a href="#insert-5149"><span class="linenos">5149</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> +</span><span id="insert-5150"><a href="#insert-5150"><span class="linenos">5150</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="insert-5151"><a href="#insert-5151"><span class="linenos">5151</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="insert-5152"><a href="#insert-5152"><span class="linenos">5152</span></a> <span class="p">)</span> +</span><span id="insert-5153"><a href="#insert-5153"><span class="linenos">5153</span></a> +</span><span id="insert-5154"><a href="#insert-5154"><span class="linenos">5154</span></a> <span class="k">return</span> <span class="n">Insert</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">expr</span><span class="p">,</span> <span class="n">overwrite</span><span class="o">=</span><span class="n">overwrite</span><span class="p">)</span> </span></pre></div> @@ -67150,41 +67277,41 @@ 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-5154"><a href="#condition-5154"><span class="linenos">5154</span></a><span class="k">def</span> <span class="nf">condition</span><span class="p">(</span> -</span><span id="condition-5155"><a href="#condition-5155"><span class="linenos">5155</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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="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">opts</span> -</span><span id="condition-5156"><a href="#condition-5156"><span class="linenos">5156</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="condition-5157"><a href="#condition-5157"><span class="linenos">5157</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="condition-5158"><a href="#condition-5158"><span class="linenos">5158</span></a><span class="sd"> Initialize a logical condition expression.</span> -</span><span id="condition-5159"><a href="#condition-5159"><span class="linenos">5159</span></a> -</span><span id="condition-5160"><a href="#condition-5160"><span class="linenos">5160</span></a><span class="sd"> Example:</span> -</span><span id="condition-5161"><a href="#condition-5161"><span class="linenos">5161</span></a><span class="sd"> >>> condition("x=1").sql()</span> -</span><span id="condition-5162"><a href="#condition-5162"><span class="linenos">5162</span></a><span class="sd"> 'x = 1'</span> -</span><span id="condition-5163"><a href="#condition-5163"><span class="linenos">5163</span></a> -</span><span id="condition-5164"><a href="#condition-5164"><span class="linenos">5164</span></a><span class="sd"> This is helpful for composing larger logical syntax trees:</span> -</span><span id="condition-5165"><a href="#condition-5165"><span class="linenos">5165</span></a><span class="sd"> >>> where = condition("x=1")</span> -</span><span id="condition-5166"><a href="#condition-5166"><span class="linenos">5166</span></a><span class="sd"> >>> where = where.and_("y=1")</span> -</span><span id="condition-5167"><a href="#condition-5167"><span class="linenos">5167</span></a><span class="sd"> >>> Select().from_("tbl").select("*").where(where).sql()</span> -</span><span id="condition-5168"><a href="#condition-5168"><span class="linenos">5168</span></a><span class="sd"> 'SELECT * FROM tbl WHERE x = 1 AND y = 1'</span> -</span><span id="condition-5169"><a href="#condition-5169"><span class="linenos">5169</span></a> -</span><span id="condition-5170"><a href="#condition-5170"><span class="linenos">5170</span></a><span class="sd"> Args:</span> -</span><span id="condition-5171"><a href="#condition-5171"><span class="linenos">5171</span></a><span class="sd"> *expression: the SQL code string to parse.</span> -</span><span id="condition-5172"><a href="#condition-5172"><span class="linenos">5172</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="condition-5173"><a href="#condition-5173"><span class="linenos">5173</span></a><span class="sd"> dialect: the dialect used to parse the input expression (in the case that the</span> -</span><span id="condition-5174"><a href="#condition-5174"><span class="linenos">5174</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="condition-5175"><a href="#condition-5175"><span class="linenos">5175</span></a><span class="sd"> copy: Whether or not to copy `expression` (only applies to expressions).</span> -</span><span id="condition-5176"><a href="#condition-5176"><span class="linenos">5176</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="condition-5177"><a href="#condition-5177"><span class="linenos">5177</span></a><span class="sd"> that the input expression is a SQL string).</span> -</span><span id="condition-5178"><a href="#condition-5178"><span class="linenos">5178</span></a> -</span><span id="condition-5179"><a href="#condition-5179"><span class="linenos">5179</span></a><span class="sd"> Returns:</span> -</span><span id="condition-5180"><a href="#condition-5180"><span class="linenos">5180</span></a><span class="sd"> The new Condition instance</span> -</span><span id="condition-5181"><a href="#condition-5181"><span class="linenos">5181</span></a><span class="sd"> """</span> -</span><span id="condition-5182"><a href="#condition-5182"><span class="linenos">5182</span></a> <span class="k">return</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="condition-5183"><a href="#condition-5183"><span class="linenos">5183</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="condition-5184"><a href="#condition-5184"><span class="linenos">5184</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Condition</span><span class="p">,</span> -</span><span id="condition-5185"><a href="#condition-5185"><span class="linenos">5185</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="condition-5186"><a href="#condition-5186"><span class="linenos">5186</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="condition-5187"><a href="#condition-5187"><span class="linenos">5187</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="condition-5188"><a href="#condition-5188"><span class="linenos">5188</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="condition-5157"><a href="#condition-5157"><span class="linenos">5157</span></a><span class="k">def</span> <span class="nf">condition</span><span class="p">(</span> +</span><span id="condition-5158"><a href="#condition-5158"><span class="linenos">5158</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</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="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">opts</span> +</span><span id="condition-5159"><a href="#condition-5159"><span class="linenos">5159</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="condition-5160"><a href="#condition-5160"><span class="linenos">5160</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="condition-5161"><a href="#condition-5161"><span class="linenos">5161</span></a><span class="sd"> Initialize a logical condition expression.</span> +</span><span id="condition-5162"><a href="#condition-5162"><span class="linenos">5162</span></a> +</span><span id="condition-5163"><a href="#condition-5163"><span class="linenos">5163</span></a><span class="sd"> Example:</span> +</span><span id="condition-5164"><a href="#condition-5164"><span class="linenos">5164</span></a><span class="sd"> >>> condition("x=1").sql()</span> +</span><span id="condition-5165"><a href="#condition-5165"><span class="linenos">5165</span></a><span class="sd"> 'x = 1'</span> +</span><span id="condition-5166"><a href="#condition-5166"><span class="linenos">5166</span></a> +</span><span id="condition-5167"><a href="#condition-5167"><span class="linenos">5167</span></a><span class="sd"> This is helpful for composing larger logical syntax trees:</span> +</span><span id="condition-5168"><a href="#condition-5168"><span class="linenos">5168</span></a><span class="sd"> >>> where = condition("x=1")</span> +</span><span id="condition-5169"><a href="#condition-5169"><span class="linenos">5169</span></a><span class="sd"> >>> where = where.and_("y=1")</span> +</span><span id="condition-5170"><a href="#condition-5170"><span class="linenos">5170</span></a><span class="sd"> >>> Select().from_("tbl").select("*").where(where).sql()</span> +</span><span id="condition-5171"><a href="#condition-5171"><span class="linenos">5171</span></a><span class="sd"> 'SELECT * FROM tbl WHERE x = 1 AND y = 1'</span> +</span><span id="condition-5172"><a href="#condition-5172"><span class="linenos">5172</span></a> +</span><span id="condition-5173"><a href="#condition-5173"><span class="linenos">5173</span></a><span class="sd"> Args:</span> +</span><span id="condition-5174"><a href="#condition-5174"><span class="linenos">5174</span></a><span class="sd"> *expression: the SQL code string to parse.</span> +</span><span id="condition-5175"><a href="#condition-5175"><span class="linenos">5175</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="condition-5176"><a href="#condition-5176"><span class="linenos">5176</span></a><span class="sd"> dialect: the dialect used to parse the input expression (in the case that the</span> +</span><span id="condition-5177"><a href="#condition-5177"><span class="linenos">5177</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="condition-5178"><a href="#condition-5178"><span class="linenos">5178</span></a><span class="sd"> copy: Whether or not to copy `expression` (only applies to expressions).</span> +</span><span id="condition-5179"><a href="#condition-5179"><span class="linenos">5179</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="condition-5180"><a href="#condition-5180"><span class="linenos">5180</span></a><span class="sd"> that the input expression is a SQL string).</span> +</span><span id="condition-5181"><a href="#condition-5181"><span class="linenos">5181</span></a> +</span><span id="condition-5182"><a href="#condition-5182"><span class="linenos">5182</span></a><span class="sd"> Returns:</span> +</span><span id="condition-5183"><a href="#condition-5183"><span class="linenos">5183</span></a><span class="sd"> The new Condition instance</span> +</span><span id="condition-5184"><a href="#condition-5184"><span class="linenos">5184</span></a><span class="sd"> """</span> +</span><span id="condition-5185"><a href="#condition-5185"><span class="linenos">5185</span></a> <span class="k">return</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="condition-5186"><a href="#condition-5186"><span class="linenos">5186</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="condition-5187"><a href="#condition-5187"><span class="linenos">5187</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Condition</span><span class="p">,</span> +</span><span id="condition-5188"><a href="#condition-5188"><span class="linenos">5188</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="condition-5189"><a href="#condition-5189"><span class="linenos">5189</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="condition-5190"><a href="#condition-5190"><span class="linenos">5190</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="condition-5191"><a href="#condition-5191"><span class="linenos">5191</span></a> <span class="p">)</span> </span></pre></div> @@ -67242,27 +67369,27 @@ 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_-5191"><a href="#and_-5191"><span class="linenos">5191</span></a><span class="k">def</span> <span class="nf">and_</span><span class="p">(</span> -</span><span id="and_-5192"><a href="#and_-5192"><span class="linenos">5192</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</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="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">opts</span> -</span><span id="and_-5193"><a href="#and_-5193"><span class="linenos">5193</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="and_-5194"><a href="#and_-5194"><span class="linenos">5194</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="and_-5195"><a href="#and_-5195"><span class="linenos">5195</span></a><span class="sd"> Combine multiple conditions with an AND logical operator.</span> -</span><span id="and_-5196"><a href="#and_-5196"><span class="linenos">5196</span></a> -</span><span id="and_-5197"><a href="#and_-5197"><span class="linenos">5197</span></a><span class="sd"> Example:</span> -</span><span id="and_-5198"><a href="#and_-5198"><span class="linenos">5198</span></a><span class="sd"> >>> and_("x=1", and_("y=1", "z=1")).sql()</span> -</span><span id="and_-5199"><a href="#and_-5199"><span class="linenos">5199</span></a><span class="sd"> 'x = 1 AND (y = 1 AND z = 1)'</span> -</span><span id="and_-5200"><a href="#and_-5200"><span class="linenos">5200</span></a> -</span><span id="and_-5201"><a href="#and_-5201"><span class="linenos">5201</span></a><span class="sd"> Args:</span> -</span><span id="and_-5202"><a href="#and_-5202"><span class="linenos">5202</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="and_-5203"><a href="#and_-5203"><span class="linenos">5203</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="and_-5204"><a href="#and_-5204"><span class="linenos">5204</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="and_-5205"><a href="#and_-5205"><span class="linenos">5205</span></a><span class="sd"> copy: whether or not to copy `expressions` (only applies to Expressions).</span> -</span><span id="and_-5206"><a href="#and_-5206"><span class="linenos">5206</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="and_-5207"><a href="#and_-5207"><span class="linenos">5207</span></a> -</span><span id="and_-5208"><a href="#and_-5208"><span class="linenos">5208</span></a><span class="sd"> Returns:</span> -</span><span id="and_-5209"><a href="#and_-5209"><span class="linenos">5209</span></a><span class="sd"> And: the new condition</span> -</span><span id="and_-5210"><a href="#and_-5210"><span class="linenos">5210</span></a><span class="sd"> """</span> -</span><span id="and_-5211"><a href="#and_-5211"><span class="linenos">5211</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Condition</span><span class="p">,</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="n">copy</span><span class="o">=</span><span class="n">copy</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_-5194"><a href="#and_-5194"><span class="linenos">5194</span></a><span class="k">def</span> <span class="nf">and_</span><span class="p">(</span> +</span><span id="and_-5195"><a href="#and_-5195"><span class="linenos">5195</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</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="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">opts</span> +</span><span id="and_-5196"><a href="#and_-5196"><span class="linenos">5196</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="and_-5197"><a href="#and_-5197"><span class="linenos">5197</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="and_-5198"><a href="#and_-5198"><span class="linenos">5198</span></a><span class="sd"> Combine multiple conditions with an AND logical operator.</span> +</span><span id="and_-5199"><a href="#and_-5199"><span class="linenos">5199</span></a> +</span><span id="and_-5200"><a href="#and_-5200"><span class="linenos">5200</span></a><span class="sd"> Example:</span> +</span><span id="and_-5201"><a href="#and_-5201"><span class="linenos">5201</span></a><span class="sd"> >>> and_("x=1", and_("y=1", "z=1")).sql()</span> +</span><span id="and_-5202"><a href="#and_-5202"><span class="linenos">5202</span></a><span class="sd"> 'x = 1 AND (y = 1 AND z = 1)'</span> +</span><span id="and_-5203"><a href="#and_-5203"><span class="linenos">5203</span></a> +</span><span id="and_-5204"><a href="#and_-5204"><span class="linenos">5204</span></a><span class="sd"> Args:</span> +</span><span id="and_-5205"><a href="#and_-5205"><span class="linenos">5205</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="and_-5206"><a href="#and_-5206"><span class="linenos">5206</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="and_-5207"><a href="#and_-5207"><span class="linenos">5207</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="and_-5208"><a href="#and_-5208"><span class="linenos">5208</span></a><span class="sd"> copy: whether or not to copy `expressions` (only applies to Expressions).</span> +</span><span id="and_-5209"><a href="#and_-5209"><span class="linenos">5209</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="and_-5210"><a href="#and_-5210"><span class="linenos">5210</span></a> +</span><span id="and_-5211"><a href="#and_-5211"><span class="linenos">5211</span></a><span class="sd"> Returns:</span> +</span><span id="and_-5212"><a href="#and_-5212"><span class="linenos">5212</span></a><span class="sd"> And: the new condition</span> +</span><span id="and_-5213"><a href="#and_-5213"><span class="linenos">5213</span></a><span class="sd"> """</span> +</span><span id="and_-5214"><a href="#and_-5214"><span class="linenos">5214</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Condition</span><span class="p">,</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> </span></pre></div> @@ -67308,27 +67435,27 @@ 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_-5214"><a href="#or_-5214"><span class="linenos">5214</span></a><span class="k">def</span> <span class="nf">or_</span><span class="p">(</span> -</span><span id="or_-5215"><a href="#or_-5215"><span class="linenos">5215</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</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="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">opts</span> -</span><span id="or_-5216"><a href="#or_-5216"><span class="linenos">5216</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="or_-5217"><a href="#or_-5217"><span class="linenos">5217</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="or_-5218"><a href="#or_-5218"><span class="linenos">5218</span></a><span class="sd"> Combine multiple conditions with an OR logical operator.</span> -</span><span id="or_-5219"><a href="#or_-5219"><span class="linenos">5219</span></a> -</span><span id="or_-5220"><a href="#or_-5220"><span class="linenos">5220</span></a><span class="sd"> Example:</span> -</span><span id="or_-5221"><a href="#or_-5221"><span class="linenos">5221</span></a><span class="sd"> >>> or_("x=1", or_("y=1", "z=1")).sql()</span> -</span><span id="or_-5222"><a href="#or_-5222"><span class="linenos">5222</span></a><span class="sd"> 'x = 1 OR (y = 1 OR z = 1)'</span> -</span><span id="or_-5223"><a href="#or_-5223"><span class="linenos">5223</span></a> -</span><span id="or_-5224"><a href="#or_-5224"><span class="linenos">5224</span></a><span class="sd"> Args:</span> -</span><span id="or_-5225"><a href="#or_-5225"><span class="linenos">5225</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="or_-5226"><a href="#or_-5226"><span class="linenos">5226</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="or_-5227"><a href="#or_-5227"><span class="linenos">5227</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="or_-5228"><a href="#or_-5228"><span class="linenos">5228</span></a><span class="sd"> copy: whether or not to copy `expressions` (only applies to Expressions).</span> -</span><span id="or_-5229"><a href="#or_-5229"><span class="linenos">5229</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="or_-5230"><a href="#or_-5230"><span class="linenos">5230</span></a> -</span><span id="or_-5231"><a href="#or_-5231"><span class="linenos">5231</span></a><span class="sd"> Returns:</span> -</span><span id="or_-5232"><a href="#or_-5232"><span class="linenos">5232</span></a><span class="sd"> Or: the new condition</span> -</span><span id="or_-5233"><a href="#or_-5233"><span class="linenos">5233</span></a><span class="sd"> """</span> -</span><span id="or_-5234"><a href="#or_-5234"><span class="linenos">5234</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Condition</span><span class="p">,</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="n">copy</span><span class="o">=</span><span class="n">copy</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_-5217"><a href="#or_-5217"><span class="linenos">5217</span></a><span class="k">def</span> <span class="nf">or_</span><span class="p">(</span> +</span><span id="or_-5218"><a href="#or_-5218"><span class="linenos">5218</span></a> <span class="o">*</span><span class="n">expressions</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">ExpOrStr</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="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">opts</span> +</span><span id="or_-5219"><a href="#or_-5219"><span class="linenos">5219</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="or_-5220"><a href="#or_-5220"><span class="linenos">5220</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="or_-5221"><a href="#or_-5221"><span class="linenos">5221</span></a><span class="sd"> Combine multiple conditions with an OR logical operator.</span> +</span><span id="or_-5222"><a href="#or_-5222"><span class="linenos">5222</span></a> +</span><span id="or_-5223"><a href="#or_-5223"><span class="linenos">5223</span></a><span class="sd"> Example:</span> +</span><span id="or_-5224"><a href="#or_-5224"><span class="linenos">5224</span></a><span class="sd"> >>> or_("x=1", or_("y=1", "z=1")).sql()</span> +</span><span id="or_-5225"><a href="#or_-5225"><span class="linenos">5225</span></a><span class="sd"> 'x = 1 OR (y = 1 OR z = 1)'</span> +</span><span id="or_-5226"><a href="#or_-5226"><span class="linenos">5226</span></a> +</span><span id="or_-5227"><a href="#or_-5227"><span class="linenos">5227</span></a><span class="sd"> Args:</span> +</span><span id="or_-5228"><a href="#or_-5228"><span class="linenos">5228</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="or_-5229"><a href="#or_-5229"><span class="linenos">5229</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="or_-5230"><a href="#or_-5230"><span class="linenos">5230</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="or_-5231"><a href="#or_-5231"><span class="linenos">5231</span></a><span class="sd"> copy: whether or not to copy `expressions` (only applies to Expressions).</span> +</span><span id="or_-5232"><a href="#or_-5232"><span class="linenos">5232</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="or_-5233"><a href="#or_-5233"><span class="linenos">5233</span></a> +</span><span id="or_-5234"><a href="#or_-5234"><span class="linenos">5234</span></a><span class="sd"> Returns:</span> +</span><span id="or_-5235"><a href="#or_-5235"><span class="linenos">5235</span></a><span class="sd"> Or: the new condition</span> +</span><span id="or_-5236"><a href="#or_-5236"><span class="linenos">5236</span></a><span class="sd"> """</span> +</span><span id="or_-5237"><a href="#or_-5237"><span class="linenos">5237</span></a> <span class="k">return</span> <span class="n">t</span><span class="o">.</span><span class="n">cast</span><span class="p">(</span><span class="n">Condition</span><span class="p">,</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> </span></pre></div> @@ -67374,31 +67501,31 @@ 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_-5237"><a href="#not_-5237"><span class="linenos">5237</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">ExpOrStr</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="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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Not</span><span class="p">:</span> -</span><span id="not_-5238"><a href="#not_-5238"><span class="linenos">5238</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="not_-5239"><a href="#not_-5239"><span class="linenos">5239</span></a><span class="sd"> Wrap a condition with a NOT operator.</span> -</span><span id="not_-5240"><a href="#not_-5240"><span class="linenos">5240</span></a> -</span><span id="not_-5241"><a href="#not_-5241"><span class="linenos">5241</span></a><span class="sd"> Example:</span> -</span><span id="not_-5242"><a href="#not_-5242"><span class="linenos">5242</span></a><span class="sd"> >>> not_("this_suit='black'").sql()</span> -</span><span id="not_-5243"><a href="#not_-5243"><span class="linenos">5243</span></a><span class="sd"> "NOT this_suit = 'black'"</span> -</span><span id="not_-5244"><a href="#not_-5244"><span class="linenos">5244</span></a> -</span><span id="not_-5245"><a href="#not_-5245"><span class="linenos">5245</span></a><span class="sd"> Args:</span> -</span><span id="not_-5246"><a href="#not_-5246"><span class="linenos">5246</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="not_-5247"><a href="#not_-5247"><span class="linenos">5247</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="not_-5248"><a href="#not_-5248"><span class="linenos">5248</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="not_-5249"><a href="#not_-5249"><span class="linenos">5249</span></a><span class="sd"> copy: whether to copy the expression or not.</span> -</span><span id="not_-5250"><a href="#not_-5250"><span class="linenos">5250</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="not_-5251"><a href="#not_-5251"><span class="linenos">5251</span></a> -</span><span id="not_-5252"><a href="#not_-5252"><span class="linenos">5252</span></a><span class="sd"> Returns:</span> -</span><span id="not_-5253"><a href="#not_-5253"><span class="linenos">5253</span></a><span class="sd"> The new condition.</span> -</span><span id="not_-5254"><a href="#not_-5254"><span class="linenos">5254</span></a><span class="sd"> """</span> -</span><span id="not_-5255"><a href="#not_-5255"><span class="linenos">5255</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">condition</span><span class="p">(</span> -</span><span id="not_-5256"><a href="#not_-5256"><span class="linenos">5256</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="not_-5257"><a href="#not_-5257"><span class="linenos">5257</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="not_-5258"><a href="#not_-5258"><span class="linenos">5258</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="not_-5259"><a href="#not_-5259"><span class="linenos">5259</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="not_-5260"><a href="#not_-5260"><span class="linenos">5260</span></a> <span class="p">)</span> -</span><span id="not_-5261"><a href="#not_-5261"><span class="linenos">5261</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</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">Connector</span><span class="p">))</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="not_-5240"><a href="#not_-5240"><span class="linenos">5240</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">ExpOrStr</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="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">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Not</span><span class="p">:</span> +</span><span id="not_-5241"><a href="#not_-5241"><span class="linenos">5241</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="not_-5242"><a href="#not_-5242"><span class="linenos">5242</span></a><span class="sd"> Wrap a condition with a NOT operator.</span> +</span><span id="not_-5243"><a href="#not_-5243"><span class="linenos">5243</span></a> +</span><span id="not_-5244"><a href="#not_-5244"><span class="linenos">5244</span></a><span class="sd"> Example:</span> +</span><span id="not_-5245"><a href="#not_-5245"><span class="linenos">5245</span></a><span class="sd"> >>> not_("this_suit='black'").sql()</span> +</span><span id="not_-5246"><a href="#not_-5246"><span class="linenos">5246</span></a><span class="sd"> "NOT this_suit = 'black'"</span> +</span><span id="not_-5247"><a href="#not_-5247"><span class="linenos">5247</span></a> +</span><span id="not_-5248"><a href="#not_-5248"><span class="linenos">5248</span></a><span class="sd"> Args:</span> +</span><span id="not_-5249"><a href="#not_-5249"><span class="linenos">5249</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="not_-5250"><a href="#not_-5250"><span class="linenos">5250</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="not_-5251"><a href="#not_-5251"><span class="linenos">5251</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="not_-5252"><a href="#not_-5252"><span class="linenos">5252</span></a><span class="sd"> copy: whether to copy the expression or not.</span> +</span><span id="not_-5253"><a href="#not_-5253"><span class="linenos">5253</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="not_-5254"><a href="#not_-5254"><span class="linenos">5254</span></a> +</span><span id="not_-5255"><a href="#not_-5255"><span class="linenos">5255</span></a><span class="sd"> Returns:</span> +</span><span id="not_-5256"><a href="#not_-5256"><span class="linenos">5256</span></a><span class="sd"> The new condition.</span> +</span><span id="not_-5257"><a href="#not_-5257"><span class="linenos">5257</span></a><span class="sd"> """</span> +</span><span id="not_-5258"><a href="#not_-5258"><span class="linenos">5258</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">condition</span><span class="p">(</span> +</span><span id="not_-5259"><a href="#not_-5259"><span class="linenos">5259</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="not_-5260"><a href="#not_-5260"><span class="linenos">5260</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="not_-5261"><a href="#not_-5261"><span class="linenos">5261</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="not_-5262"><a href="#not_-5262"><span class="linenos">5262</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="not_-5263"><a href="#not_-5263"><span class="linenos">5263</span></a> <span class="p">)</span> +</span><span id="not_-5264"><a href="#not_-5264"><span class="linenos">5264</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</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">Connector</span><span class="p">))</span> </span></pre></div> @@ -67444,23 +67571,23 @@ 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-5264"><a href="#paren-5264"><span class="linenos">5264</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="n">ExpOrStr</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">Paren</span><span class="p">:</span> -</span><span id="paren-5265"><a href="#paren-5265"><span class="linenos">5265</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="paren-5266"><a href="#paren-5266"><span class="linenos">5266</span></a><span class="sd"> Wrap an expression in parentheses.</span> -</span><span id="paren-5267"><a href="#paren-5267"><span class="linenos">5267</span></a> -</span><span id="paren-5268"><a href="#paren-5268"><span class="linenos">5268</span></a><span class="sd"> Example:</span> -</span><span id="paren-5269"><a href="#paren-5269"><span class="linenos">5269</span></a><span class="sd"> >>> paren("5 + 3").sql()</span> -</span><span id="paren-5270"><a href="#paren-5270"><span class="linenos">5270</span></a><span class="sd"> '(5 + 3)'</span> -</span><span id="paren-5271"><a href="#paren-5271"><span class="linenos">5271</span></a> -</span><span id="paren-5272"><a href="#paren-5272"><span class="linenos">5272</span></a><span class="sd"> Args:</span> -</span><span id="paren-5273"><a href="#paren-5273"><span class="linenos">5273</span></a><span class="sd"> expression: the SQL code string to parse.</span> -</span><span id="paren-5274"><a href="#paren-5274"><span class="linenos">5274</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="paren-5275"><a href="#paren-5275"><span class="linenos">5275</span></a><span class="sd"> copy: whether to copy the expression or not.</span> -</span><span id="paren-5276"><a href="#paren-5276"><span class="linenos">5276</span></a> -</span><span id="paren-5277"><a href="#paren-5277"><span class="linenos">5277</span></a><span class="sd"> Returns:</span> -</span><span id="paren-5278"><a href="#paren-5278"><span class="linenos">5278</span></a><span class="sd"> The wrapped expression.</span> -</span><span id="paren-5279"><a href="#paren-5279"><span class="linenos">5279</span></a><span class="sd"> """</span> -</span><span id="paren-5280"><a href="#paren-5280"><span class="linenos">5280</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">maybe_parse</span><span class="p">(</span><span class="n">expression</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="paren-5267"><a href="#paren-5267"><span class="linenos">5267</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="n">ExpOrStr</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">Paren</span><span class="p">:</span> +</span><span id="paren-5268"><a href="#paren-5268"><span class="linenos">5268</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="paren-5269"><a href="#paren-5269"><span class="linenos">5269</span></a><span class="sd"> Wrap an expression in parentheses.</span> +</span><span id="paren-5270"><a href="#paren-5270"><span class="linenos">5270</span></a> +</span><span id="paren-5271"><a href="#paren-5271"><span class="linenos">5271</span></a><span class="sd"> Example:</span> +</span><span id="paren-5272"><a href="#paren-5272"><span class="linenos">5272</span></a><span class="sd"> >>> paren("5 + 3").sql()</span> +</span><span id="paren-5273"><a href="#paren-5273"><span class="linenos">5273</span></a><span class="sd"> '(5 + 3)'</span> +</span><span id="paren-5274"><a href="#paren-5274"><span class="linenos">5274</span></a> +</span><span id="paren-5275"><a href="#paren-5275"><span class="linenos">5275</span></a><span class="sd"> Args:</span> +</span><span id="paren-5276"><a href="#paren-5276"><span class="linenos">5276</span></a><span class="sd"> expression: the SQL code string to parse.</span> +</span><span id="paren-5277"><a href="#paren-5277"><span class="linenos">5277</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="paren-5278"><a href="#paren-5278"><span class="linenos">5278</span></a><span class="sd"> copy: whether to copy the expression or not.</span> +</span><span id="paren-5279"><a href="#paren-5279"><span class="linenos">5279</span></a> +</span><span id="paren-5280"><a href="#paren-5280"><span class="linenos">5280</span></a><span class="sd"> Returns:</span> +</span><span id="paren-5281"><a href="#paren-5281"><span class="linenos">5281</span></a><span class="sd"> The wrapped expression.</span> +</span><span id="paren-5282"><a href="#paren-5282"><span class="linenos">5282</span></a><span class="sd"> """</span> +</span><span id="paren-5283"><a href="#paren-5283"><span class="linenos">5283</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">maybe_parse</span><span class="p">(</span><span class="n">expression</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> @@ -67516,31 +67643,31 @@ 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-5298"><a href="#to_identifier-5298"><span class="linenos">5298</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 class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> -</span><span id="to_identifier-5299"><a href="#to_identifier-5299"><span class="linenos">5299</span></a><span class="w"> </span><span class="sd">"""Builds an identifier.</span> -</span><span id="to_identifier-5300"><a href="#to_identifier-5300"><span class="linenos">5300</span></a> -</span><span id="to_identifier-5301"><a href="#to_identifier-5301"><span class="linenos">5301</span></a><span class="sd"> Args:</span> -</span><span id="to_identifier-5302"><a href="#to_identifier-5302"><span class="linenos">5302</span></a><span class="sd"> name: The name to turn into an identifier.</span> -</span><span id="to_identifier-5303"><a href="#to_identifier-5303"><span class="linenos">5303</span></a><span class="sd"> quoted: Whether or not force quote the identifier.</span> -</span><span id="to_identifier-5304"><a href="#to_identifier-5304"><span class="linenos">5304</span></a><span class="sd"> copy: Whether or not to copy a passed in Identefier node.</span> -</span><span id="to_identifier-5305"><a href="#to_identifier-5305"><span class="linenos">5305</span></a> -</span><span id="to_identifier-5306"><a href="#to_identifier-5306"><span class="linenos">5306</span></a><span class="sd"> Returns:</span> -</span><span id="to_identifier-5307"><a href="#to_identifier-5307"><span class="linenos">5307</span></a><span class="sd"> The identifier ast node.</span> -</span><span id="to_identifier-5308"><a href="#to_identifier-5308"><span class="linenos">5308</span></a><span class="sd"> """</span> -</span><span id="to_identifier-5309"><a href="#to_identifier-5309"><span class="linenos">5309</span></a> -</span><span id="to_identifier-5310"><a href="#to_identifier-5310"><span class="linenos">5310</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-5311"><a href="#to_identifier-5311"><span class="linenos">5311</span></a> <span class="k">return</span> <span class="kc">None</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="to_identifier-5301"><a href="#to_identifier-5301"><span class="linenos">5301</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 class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="to_identifier-5302"><a href="#to_identifier-5302"><span class="linenos">5302</span></a><span class="w"> </span><span class="sd">"""Builds an identifier.</span> +</span><span id="to_identifier-5303"><a href="#to_identifier-5303"><span class="linenos">5303</span></a> +</span><span id="to_identifier-5304"><a href="#to_identifier-5304"><span class="linenos">5304</span></a><span class="sd"> Args:</span> +</span><span id="to_identifier-5305"><a href="#to_identifier-5305"><span class="linenos">5305</span></a><span class="sd"> name: The name to turn into an identifier.</span> +</span><span id="to_identifier-5306"><a href="#to_identifier-5306"><span class="linenos">5306</span></a><span class="sd"> quoted: Whether or not force quote the identifier.</span> +</span><span id="to_identifier-5307"><a href="#to_identifier-5307"><span class="linenos">5307</span></a><span class="sd"> copy: Whether or not to copy a passed in Identefier node.</span> +</span><span id="to_identifier-5308"><a href="#to_identifier-5308"><span class="linenos">5308</span></a> +</span><span id="to_identifier-5309"><a href="#to_identifier-5309"><span class="linenos">5309</span></a><span class="sd"> Returns:</span> +</span><span id="to_identifier-5310"><a href="#to_identifier-5310"><span class="linenos">5310</span></a><span class="sd"> The identifier ast node.</span> +</span><span id="to_identifier-5311"><a href="#to_identifier-5311"><span class="linenos">5311</span></a><span class="sd"> """</span> </span><span id="to_identifier-5312"><a href="#to_identifier-5312"><span class="linenos">5312</span></a> -</span><span id="to_identifier-5313"><a href="#to_identifier-5313"><span class="linenos">5313</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-5314"><a href="#to_identifier-5314"><span class="linenos">5314</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="to_identifier-5315"><a href="#to_identifier-5315"><span class="linenos">5315</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-5316"><a href="#to_identifier-5316"><span class="linenos">5316</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-5317"><a href="#to_identifier-5317"><span class="linenos">5317</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-5318"><a href="#to_identifier-5318"><span class="linenos">5318</span></a> <span class="n">quoted</span><span class="o">=</span><span class="ow">not</span> <span class="n">SAFE_IDENTIFIER_RE</span><span class="o">.</span><span class="n">match</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-5319"><a href="#to_identifier-5319"><span class="linenos">5319</span></a> <span class="p">)</span> -</span><span id="to_identifier-5320"><a href="#to_identifier-5320"><span class="linenos">5320</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="to_identifier-5321"><a href="#to_identifier-5321"><span class="linenos">5321</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-5322"><a href="#to_identifier-5322"><span class="linenos">5322</span></a> <span class="k">return</span> <span class="n">identifier</span> +</span><span id="to_identifier-5313"><a href="#to_identifier-5313"><span class="linenos">5313</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-5314"><a href="#to_identifier-5314"><span class="linenos">5314</span></a> <span class="k">return</span> <span class="kc">None</span> +</span><span id="to_identifier-5315"><a href="#to_identifier-5315"><span class="linenos">5315</span></a> +</span><span id="to_identifier-5316"><a href="#to_identifier-5316"><span class="linenos">5316</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-5317"><a href="#to_identifier-5317"><span class="linenos">5317</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="to_identifier-5318"><a href="#to_identifier-5318"><span class="linenos">5318</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-5319"><a href="#to_identifier-5319"><span class="linenos">5319</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-5320"><a href="#to_identifier-5320"><span class="linenos">5320</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-5321"><a href="#to_identifier-5321"><span class="linenos">5321</span></a> <span class="n">quoted</span><span class="o">=</span><span class="ow">not</span> <span class="n">SAFE_IDENTIFIER_RE</span><span class="o">.</span><span class="n">match</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-5322"><a href="#to_identifier-5322"><span class="linenos">5322</span></a> <span class="p">)</span> +</span><span id="to_identifier-5323"><a href="#to_identifier-5323"><span class="linenos">5323</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="to_identifier-5324"><a href="#to_identifier-5324"><span class="linenos">5324</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-5325"><a href="#to_identifier-5325"><span class="linenos">5325</span></a> <span class="k">return</span> <span class="n">identifier</span> </span></pre></div> @@ -67586,23 +67713,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-5328"><a href="#to_interval-5328"><span class="linenos">5328</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-5329"><a href="#to_interval-5329"><span class="linenos">5329</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-5330"><a href="#to_interval-5330"><span class="linenos">5330</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-5331"><a href="#to_interval-5331"><span class="linenos">5331</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-5332"><a href="#to_interval-5332"><span class="linenos">5332</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-5333"><a href="#to_interval-5333"><span class="linenos">5333</span></a> -</span><span id="to_interval-5334"><a href="#to_interval-5334"><span class="linenos">5334</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-5335"><a href="#to_interval-5335"><span class="linenos">5335</span></a> -</span><span id="to_interval-5336"><a href="#to_interval-5336"><span class="linenos">5336</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-5337"><a href="#to_interval-5337"><span class="linenos">5337</span></a> -</span><span id="to_interval-5338"><a href="#to_interval-5338"><span class="linenos">5338</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-5339"><a href="#to_interval-5339"><span class="linenos">5339</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="to_interval-5331"><a href="#to_interval-5331"><span class="linenos">5331</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-5332"><a href="#to_interval-5332"><span class="linenos">5332</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-5333"><a href="#to_interval-5333"><span class="linenos">5333</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-5334"><a href="#to_interval-5334"><span class="linenos">5334</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-5335"><a href="#to_interval-5335"><span class="linenos">5335</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-5336"><a href="#to_interval-5336"><span class="linenos">5336</span></a> +</span><span id="to_interval-5337"><a href="#to_interval-5337"><span class="linenos">5337</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-5338"><a href="#to_interval-5338"><span class="linenos">5338</span></a> +</span><span id="to_interval-5339"><a href="#to_interval-5339"><span class="linenos">5339</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-5340"><a href="#to_interval-5340"><span class="linenos">5340</span></a> -</span><span id="to_interval-5341"><a href="#to_interval-5341"><span class="linenos">5341</span></a> <span class="k">return</span> <span class="n">Interval</span><span class="p">(</span> -</span><span id="to_interval-5342"><a href="#to_interval-5342"><span class="linenos">5342</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-5343"><a href="#to_interval-5343"><span class="linenos">5343</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-5344"><a href="#to_interval-5344"><span class="linenos">5344</span></a> <span class="p">)</span> +</span><span id="to_interval-5341"><a href="#to_interval-5341"><span class="linenos">5341</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-5342"><a href="#to_interval-5342"><span class="linenos">5342</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-5343"><a href="#to_interval-5343"><span class="linenos">5343</span></a> +</span><span id="to_interval-5344"><a href="#to_interval-5344"><span class="linenos">5344</span></a> <span class="k">return</span> <span class="n">Interval</span><span class="p">(</span> +</span><span id="to_interval-5345"><a href="#to_interval-5345"><span class="linenos">5345</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-5346"><a href="#to_interval-5346"><span class="linenos">5346</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-5347"><a href="#to_interval-5347"><span class="linenos">5347</span></a> <span class="p">)</span> </span></pre></div> @@ -67622,32 +67749,32 @@ 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-5357"><a href="#to_table-5357"><span class="linenos">5357</span></a><span class="k">def</span> <span class="nf">to_table</span><span class="p">(</span> -</span><span id="to_table-5358"><a href="#to_table-5358"><span class="linenos">5358</span></a> <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="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="to_table-5359"><a href="#to_table-5359"><span class="linenos">5359</span></a><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-5360"><a href="#to_table-5360"><span class="linenos">5360</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="to_table-5361"><a href="#to_table-5361"><span class="linenos">5361</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-5362"><a href="#to_table-5362"><span class="linenos">5362</span></a><span class="sd"> If a table is passed in then that table is returned.</span> -</span><span id="to_table-5363"><a href="#to_table-5363"><span class="linenos">5363</span></a> -</span><span id="to_table-5364"><a href="#to_table-5364"><span class="linenos">5364</span></a><span class="sd"> Args:</span> -</span><span id="to_table-5365"><a href="#to_table-5365"><span class="linenos">5365</span></a><span class="sd"> sql_path: a `[catalog].[schema].[table]` string.</span> -</span><span id="to_table-5366"><a href="#to_table-5366"><span class="linenos">5366</span></a><span class="sd"> dialect: the source dialect according to which the table name will be parsed.</span> -</span><span id="to_table-5367"><a href="#to_table-5367"><span class="linenos">5367</span></a><span class="sd"> kwargs: the kwargs to instantiate the resulting `Table` expression with.</span> -</span><span id="to_table-5368"><a href="#to_table-5368"><span class="linenos">5368</span></a> -</span><span id="to_table-5369"><a href="#to_table-5369"><span class="linenos">5369</span></a><span class="sd"> Returns:</span> -</span><span id="to_table-5370"><a href="#to_table-5370"><span class="linenos">5370</span></a><span class="sd"> A table expression.</span> -</span><span id="to_table-5371"><a href="#to_table-5371"><span class="linenos">5371</span></a><span class="sd"> """</span> -</span><span id="to_table-5372"><a href="#to_table-5372"><span class="linenos">5372</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-5373"><a href="#to_table-5373"><span class="linenos">5373</span></a> <span class="k">return</span> <span class="n">sql_path</span> -</span><span id="to_table-5374"><a href="#to_table-5374"><span class="linenos">5374</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-5375"><a href="#to_table-5375"><span class="linenos">5375</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-5376"><a href="#to_table-5376"><span class="linenos">5376</span></a> -</span><span id="to_table-5377"><a href="#to_table-5377"><span class="linenos">5377</span></a> <span class="n">table</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_path</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="to_table-5378"><a href="#to_table-5378"><span class="linenos">5378</span></a> <span class="k">if</span> <span class="n">table</span><span class="p">:</span> -</span><span id="to_table-5379"><a href="#to_table-5379"><span class="linenos">5379</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">kwargs</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="to_table-5380"><a href="#to_table-5380"><span class="linenos">5380</span></a> <span class="n">table</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="to_table-5381"><a href="#to_table-5381"><span class="linenos">5381</span></a> -</span><span id="to_table-5382"><a href="#to_table-5382"><span class="linenos">5382</span></a> <span class="k">return</span> <span class="n">table</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="to_table-5360"><a href="#to_table-5360"><span class="linenos">5360</span></a><span class="k">def</span> <span class="nf">to_table</span><span class="p">(</span> +</span><span id="to_table-5361"><a href="#to_table-5361"><span class="linenos">5361</span></a> <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="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="to_table-5362"><a href="#to_table-5362"><span class="linenos">5362</span></a><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-5363"><a href="#to_table-5363"><span class="linenos">5363</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="to_table-5364"><a href="#to_table-5364"><span class="linenos">5364</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-5365"><a href="#to_table-5365"><span class="linenos">5365</span></a><span class="sd"> If a table is passed in then that table is returned.</span> +</span><span id="to_table-5366"><a href="#to_table-5366"><span class="linenos">5366</span></a> +</span><span id="to_table-5367"><a href="#to_table-5367"><span class="linenos">5367</span></a><span class="sd"> Args:</span> +</span><span id="to_table-5368"><a href="#to_table-5368"><span class="linenos">5368</span></a><span class="sd"> sql_path: a `[catalog].[schema].[table]` string.</span> +</span><span id="to_table-5369"><a href="#to_table-5369"><span class="linenos">5369</span></a><span class="sd"> dialect: the source dialect according to which the table name will be parsed.</span> +</span><span id="to_table-5370"><a href="#to_table-5370"><span class="linenos">5370</span></a><span class="sd"> kwargs: the kwargs to instantiate the resulting `Table` expression with.</span> +</span><span id="to_table-5371"><a href="#to_table-5371"><span class="linenos">5371</span></a> +</span><span id="to_table-5372"><a href="#to_table-5372"><span class="linenos">5372</span></a><span class="sd"> Returns:</span> +</span><span id="to_table-5373"><a href="#to_table-5373"><span class="linenos">5373</span></a><span class="sd"> A table expression.</span> +</span><span id="to_table-5374"><a href="#to_table-5374"><span class="linenos">5374</span></a><span class="sd"> """</span> +</span><span id="to_table-5375"><a href="#to_table-5375"><span class="linenos">5375</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-5376"><a href="#to_table-5376"><span class="linenos">5376</span></a> <span class="k">return</span> <span class="n">sql_path</span> +</span><span id="to_table-5377"><a href="#to_table-5377"><span class="linenos">5377</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-5378"><a href="#to_table-5378"><span class="linenos">5378</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-5379"><a href="#to_table-5379"><span class="linenos">5379</span></a> +</span><span id="to_table-5380"><a href="#to_table-5380"><span class="linenos">5380</span></a> <span class="n">table</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_path</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="to_table-5381"><a href="#to_table-5381"><span class="linenos">5381</span></a> <span class="k">if</span> <span class="n">table</span><span class="p">:</span> +</span><span id="to_table-5382"><a href="#to_table-5382"><span class="linenos">5382</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">kwargs</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="to_table-5383"><a href="#to_table-5383"><span class="linenos">5383</span></a> <span class="n">table</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="to_table-5384"><a href="#to_table-5384"><span class="linenos">5384</span></a> +</span><span id="to_table-5385"><a href="#to_table-5385"><span class="linenos">5385</span></a> <span class="k">return</span> <span class="n">table</span> </span></pre></div> @@ -67682,22 +67809,22 @@ 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-5385"><a href="#to_column-5385"><span class="linenos">5385</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-5386"><a href="#to_column-5386"><span class="linenos">5386</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="to_column-5387"><a href="#to_column-5387"><span class="linenos">5387</span></a><span class="sd"> Create a column from a `[table].[column]` sql path. Schema is optional.</span> -</span><span id="to_column-5388"><a href="#to_column-5388"><span class="linenos">5388</span></a> -</span><span id="to_column-5389"><a href="#to_column-5389"><span class="linenos">5389</span></a><span class="sd"> If a column is passed in then that column is returned.</span> -</span><span id="to_column-5390"><a href="#to_column-5390"><span class="linenos">5390</span></a> -</span><span id="to_column-5391"><a href="#to_column-5391"><span class="linenos">5391</span></a><span class="sd"> Args:</span> -</span><span id="to_column-5392"><a href="#to_column-5392"><span class="linenos">5392</span></a><span class="sd"> sql_path: `[table].[column]` string</span> -</span><span id="to_column-5393"><a href="#to_column-5393"><span class="linenos">5393</span></a><span class="sd"> Returns:</span> -</span><span id="to_column-5394"><a href="#to_column-5394"><span class="linenos">5394</span></a><span class="sd"> Table: A column expression</span> -</span><span id="to_column-5395"><a href="#to_column-5395"><span class="linenos">5395</span></a><span class="sd"> """</span> -</span><span id="to_column-5396"><a href="#to_column-5396"><span class="linenos">5396</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-5397"><a href="#to_column-5397"><span class="linenos">5397</span></a> <span class="k">return</span> <span class="n">sql_path</span> -</span><span id="to_column-5398"><a href="#to_column-5398"><span class="linenos">5398</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-5399"><a href="#to_column-5399"><span class="linenos">5399</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-5400"><a href="#to_column-5400"><span class="linenos">5400</span></a> <span class="k">return</span> <span class="n">column</span><span class="p">(</span><span class="o">*</span><span class="nb">reversed</span><span class="p">(</span><span class="n">sql_path</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"."</span><span class="p">)),</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="c1"># type: ignore</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="to_column-5388"><a href="#to_column-5388"><span class="linenos">5388</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-5389"><a href="#to_column-5389"><span class="linenos">5389</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="to_column-5390"><a href="#to_column-5390"><span class="linenos">5390</span></a><span class="sd"> Create a column from a `[table].[column]` sql path. Schema is optional.</span> +</span><span id="to_column-5391"><a href="#to_column-5391"><span class="linenos">5391</span></a> +</span><span id="to_column-5392"><a href="#to_column-5392"><span class="linenos">5392</span></a><span class="sd"> If a column is passed in then that column is returned.</span> +</span><span id="to_column-5393"><a href="#to_column-5393"><span class="linenos">5393</span></a> +</span><span id="to_column-5394"><a href="#to_column-5394"><span class="linenos">5394</span></a><span class="sd"> Args:</span> +</span><span id="to_column-5395"><a href="#to_column-5395"><span class="linenos">5395</span></a><span class="sd"> sql_path: `[table].[column]` string</span> +</span><span id="to_column-5396"><a href="#to_column-5396"><span class="linenos">5396</span></a><span class="sd"> Returns:</span> +</span><span id="to_column-5397"><a href="#to_column-5397"><span class="linenos">5397</span></a><span class="sd"> Table: A column expression</span> +</span><span id="to_column-5398"><a href="#to_column-5398"><span class="linenos">5398</span></a><span class="sd"> """</span> +</span><span id="to_column-5399"><a href="#to_column-5399"><span class="linenos">5399</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-5400"><a href="#to_column-5400"><span class="linenos">5400</span></a> <span class="k">return</span> <span class="n">sql_path</span> +</span><span id="to_column-5401"><a href="#to_column-5401"><span class="linenos">5401</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-5402"><a href="#to_column-5402"><span class="linenos">5402</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-5403"><a href="#to_column-5403"><span class="linenos">5403</span></a> <span class="k">return</span> <span class="n">column</span><span class="p">(</span><span class="o">*</span><span class="nb">reversed</span><span class="p">(</span><span class="n">sql_path</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">"."</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></pre></div> @@ -67731,61 +67858,61 @@ 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_-5403"><a href="#alias_-5403"><span class="linenos">5403</span></a><span class="k">def</span> <span class="nf">alias_</span><span class="p">(</span> -</span><span id="alias_-5404"><a href="#alias_-5404"><span class="linenos">5404</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="alias_-5405"><a href="#alias_-5405"><span class="linenos">5405</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_-5406"><a href="#alias_-5406"><span class="linenos">5406</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_-5407"><a href="#alias_-5407"><span class="linenos">5407</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_-5408"><a href="#alias_-5408"><span class="linenos">5408</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_-5409"><a href="#alias_-5409"><span class="linenos">5409</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="alias_-5410"><a href="#alias_-5410"><span class="linenos">5410</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="alias_-5411"><a href="#alias_-5411"><span class="linenos">5411</span></a><span class="p">):</span> -</span><span id="alias_-5412"><a href="#alias_-5412"><span class="linenos">5412</span></a><span class="w"> </span><span class="sd">"""Create an Alias expression.</span> -</span><span id="alias_-5413"><a href="#alias_-5413"><span class="linenos">5413</span></a> -</span><span id="alias_-5414"><a href="#alias_-5414"><span class="linenos">5414</span></a><span class="sd"> Example:</span> -</span><span id="alias_-5415"><a href="#alias_-5415"><span class="linenos">5415</span></a><span class="sd"> >>> alias_('foo', 'bar').sql()</span> -</span><span id="alias_-5416"><a href="#alias_-5416"><span class="linenos">5416</span></a><span class="sd"> 'foo AS bar'</span> -</span><span id="alias_-5417"><a href="#alias_-5417"><span class="linenos">5417</span></a> -</span><span id="alias_-5418"><a href="#alias_-5418"><span class="linenos">5418</span></a><span class="sd"> >>> alias_('(select 1, 2)', 'bar', table=['a', 'b']).sql()</span> -</span><span id="alias_-5419"><a href="#alias_-5419"><span class="linenos">5419</span></a><span class="sd"> '(SELECT 1, 2) AS bar(a, b)'</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="alias_-5406"><a href="#alias_-5406"><span class="linenos">5406</span></a><span class="k">def</span> <span class="nf">alias_</span><span class="p">(</span> +</span><span id="alias_-5407"><a href="#alias_-5407"><span class="linenos">5407</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="alias_-5408"><a href="#alias_-5408"><span class="linenos">5408</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_-5409"><a href="#alias_-5409"><span class="linenos">5409</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_-5410"><a href="#alias_-5410"><span class="linenos">5410</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_-5411"><a href="#alias_-5411"><span class="linenos">5411</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_-5412"><a href="#alias_-5412"><span class="linenos">5412</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="alias_-5413"><a href="#alias_-5413"><span class="linenos">5413</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="alias_-5414"><a href="#alias_-5414"><span class="linenos">5414</span></a><span class="p">):</span> +</span><span id="alias_-5415"><a href="#alias_-5415"><span class="linenos">5415</span></a><span class="w"> </span><span class="sd">"""Create an Alias expression.</span> +</span><span id="alias_-5416"><a href="#alias_-5416"><span class="linenos">5416</span></a> +</span><span id="alias_-5417"><a href="#alias_-5417"><span class="linenos">5417</span></a><span class="sd"> Example:</span> +</span><span id="alias_-5418"><a href="#alias_-5418"><span class="linenos">5418</span></a><span class="sd"> >>> alias_('foo', 'bar').sql()</span> +</span><span id="alias_-5419"><a href="#alias_-5419"><span class="linenos">5419</span></a><span class="sd"> 'foo AS bar'</span> </span><span id="alias_-5420"><a href="#alias_-5420"><span class="linenos">5420</span></a> -</span><span id="alias_-5421"><a href="#alias_-5421"><span class="linenos">5421</span></a><span class="sd"> Args:</span> -</span><span id="alias_-5422"><a href="#alias_-5422"><span class="linenos">5422</span></a><span class="sd"> expression: the SQL code strings to parse.</span> -</span><span id="alias_-5423"><a href="#alias_-5423"><span class="linenos">5423</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="alias_-5424"><a href="#alias_-5424"><span class="linenos">5424</span></a><span class="sd"> alias: the alias name to use. If the name has</span> -</span><span id="alias_-5425"><a href="#alias_-5425"><span class="linenos">5425</span></a><span class="sd"> special characters it is quoted.</span> -</span><span id="alias_-5426"><a href="#alias_-5426"><span class="linenos">5426</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_-5427"><a href="#alias_-5427"><span class="linenos">5427</span></a><span class="sd"> quoted: whether or not to quote the alias</span> -</span><span id="alias_-5428"><a href="#alias_-5428"><span class="linenos">5428</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="alias_-5429"><a href="#alias_-5429"><span class="linenos">5429</span></a><span class="sd"> copy: Whether or not to copy the expression.</span> -</span><span id="alias_-5430"><a href="#alias_-5430"><span class="linenos">5430</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="alias_-5431"><a href="#alias_-5431"><span class="linenos">5431</span></a> -</span><span id="alias_-5432"><a href="#alias_-5432"><span class="linenos">5432</span></a><span class="sd"> Returns:</span> -</span><span id="alias_-5433"><a href="#alias_-5433"><span class="linenos">5433</span></a><span class="sd"> Alias: the aliased expression</span> -</span><span id="alias_-5434"><a href="#alias_-5434"><span class="linenos">5434</span></a><span class="sd"> """</span> -</span><span id="alias_-5435"><a href="#alias_-5435"><span class="linenos">5435</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="alias_-5436"><a href="#alias_-5436"><span class="linenos">5436</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_-5437"><a href="#alias_-5437"><span class="linenos">5437</span></a> -</span><span id="alias_-5438"><a href="#alias_-5438"><span class="linenos">5438</span></a> <span class="k">if</span> <span class="n">table</span><span class="p">:</span> -</span><span id="alias_-5439"><a href="#alias_-5439"><span class="linenos">5439</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_-5440"><a href="#alias_-5440"><span class="linenos">5440</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_-5441"><a href="#alias_-5441"><span class="linenos">5441</span></a> -</span><span id="alias_-5442"><a href="#alias_-5442"><span class="linenos">5442</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_-5443"><a href="#alias_-5443"><span class="linenos">5443</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_-5444"><a href="#alias_-5444"><span class="linenos">5444</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_-5445"><a href="#alias_-5445"><span class="linenos">5445</span></a> -</span><span id="alias_-5446"><a href="#alias_-5446"><span class="linenos">5446</span></a> <span class="k">return</span> <span class="n">exp</span> -</span><span id="alias_-5447"><a href="#alias_-5447"><span class="linenos">5447</span></a> -</span><span id="alias_-5448"><a href="#alias_-5448"><span class="linenos">5448</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_-5449"><a href="#alias_-5449"><span class="linenos">5449</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_-5450"><a href="#alias_-5450"><span class="linenos">5450</span></a> <span class="c1"># for the complete Window expression.</span> -</span><span id="alias_-5451"><a href="#alias_-5451"><span class="linenos">5451</span></a> <span class="c1">#</span> -</span><span id="alias_-5452"><a href="#alias_-5452"><span class="linenos">5452</span></a> <span class="c1"># [1]: https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls</span> -</span><span id="alias_-5453"><a href="#alias_-5453"><span class="linenos">5453</span></a> -</span><span id="alias_-5454"><a href="#alias_-5454"><span class="linenos">5454</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_-5455"><a href="#alias_-5455"><span class="linenos">5455</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_-5456"><a href="#alias_-5456"><span class="linenos">5456</span></a> <span class="k">return</span> <span class="n">exp</span> -</span><span id="alias_-5457"><a href="#alias_-5457"><span class="linenos">5457</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="alias_-5421"><a href="#alias_-5421"><span class="linenos">5421</span></a><span class="sd"> >>> alias_('(select 1, 2)', 'bar', table=['a', 'b']).sql()</span> +</span><span id="alias_-5422"><a href="#alias_-5422"><span class="linenos">5422</span></a><span class="sd"> '(SELECT 1, 2) AS bar(a, b)'</span> +</span><span id="alias_-5423"><a href="#alias_-5423"><span class="linenos">5423</span></a> +</span><span id="alias_-5424"><a href="#alias_-5424"><span class="linenos">5424</span></a><span class="sd"> Args:</span> +</span><span id="alias_-5425"><a href="#alias_-5425"><span class="linenos">5425</span></a><span class="sd"> expression: the SQL code strings to parse.</span> +</span><span id="alias_-5426"><a href="#alias_-5426"><span class="linenos">5426</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="alias_-5427"><a href="#alias_-5427"><span class="linenos">5427</span></a><span class="sd"> alias: the alias name to use. If the name has</span> +</span><span id="alias_-5428"><a href="#alias_-5428"><span class="linenos">5428</span></a><span class="sd"> special characters it is quoted.</span> +</span><span id="alias_-5429"><a href="#alias_-5429"><span class="linenos">5429</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_-5430"><a href="#alias_-5430"><span class="linenos">5430</span></a><span class="sd"> quoted: whether or not to quote the alias</span> +</span><span id="alias_-5431"><a href="#alias_-5431"><span class="linenos">5431</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="alias_-5432"><a href="#alias_-5432"><span class="linenos">5432</span></a><span class="sd"> copy: Whether or not to copy the expression.</span> +</span><span id="alias_-5433"><a href="#alias_-5433"><span class="linenos">5433</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="alias_-5434"><a href="#alias_-5434"><span class="linenos">5434</span></a> +</span><span id="alias_-5435"><a href="#alias_-5435"><span class="linenos">5435</span></a><span class="sd"> Returns:</span> +</span><span id="alias_-5436"><a href="#alias_-5436"><span class="linenos">5436</span></a><span class="sd"> Alias: the aliased expression</span> +</span><span id="alias_-5437"><a href="#alias_-5437"><span class="linenos">5437</span></a><span class="sd"> """</span> +</span><span id="alias_-5438"><a href="#alias_-5438"><span class="linenos">5438</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="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="alias_-5439"><a href="#alias_-5439"><span class="linenos">5439</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_-5440"><a href="#alias_-5440"><span class="linenos">5440</span></a> +</span><span id="alias_-5441"><a href="#alias_-5441"><span class="linenos">5441</span></a> <span class="k">if</span> <span class="n">table</span><span class="p">:</span> +</span><span id="alias_-5442"><a href="#alias_-5442"><span class="linenos">5442</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_-5443"><a href="#alias_-5443"><span class="linenos">5443</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_-5444"><a href="#alias_-5444"><span class="linenos">5444</span></a> +</span><span id="alias_-5445"><a href="#alias_-5445"><span class="linenos">5445</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_-5446"><a href="#alias_-5446"><span class="linenos">5446</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_-5447"><a href="#alias_-5447"><span class="linenos">5447</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_-5448"><a href="#alias_-5448"><span class="linenos">5448</span></a> +</span><span id="alias_-5449"><a href="#alias_-5449"><span class="linenos">5449</span></a> <span class="k">return</span> <span class="n">exp</span> +</span><span id="alias_-5450"><a href="#alias_-5450"><span class="linenos">5450</span></a> +</span><span id="alias_-5451"><a href="#alias_-5451"><span class="linenos">5451</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_-5452"><a href="#alias_-5452"><span class="linenos">5452</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_-5453"><a href="#alias_-5453"><span class="linenos">5453</span></a> <span class="c1"># for the complete Window expression.</span> +</span><span id="alias_-5454"><a href="#alias_-5454"><span class="linenos">5454</span></a> <span class="c1">#</span> +</span><span id="alias_-5455"><a href="#alias_-5455"><span class="linenos">5455</span></a> <span class="c1"># [1]: https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls</span> +</span><span id="alias_-5456"><a href="#alias_-5456"><span class="linenos">5456</span></a> +</span><span id="alias_-5457"><a href="#alias_-5457"><span class="linenos">5457</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_-5458"><a href="#alias_-5458"><span class="linenos">5458</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_-5459"><a href="#alias_-5459"><span class="linenos">5459</span></a> <span class="k">return</span> <span class="n">exp</span> +</span><span id="alias_-5460"><a href="#alias_-5460"><span class="linenos">5460</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> @@ -67841,32 +67968,32 @@ special characters it is quoted.</li> </div> <a class="headerlink" href="#subquery"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="subquery-5460"><a href="#subquery-5460"><span class="linenos">5460</span></a><span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span> -</span><span id="subquery-5461"><a href="#subquery-5461"><span class="linenos">5461</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> -</span><span id="subquery-5462"><a href="#subquery-5462"><span class="linenos">5462</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="n">Identifier</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="subquery-5463"><a href="#subquery-5463"><span class="linenos">5463</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="subquery-5464"><a href="#subquery-5464"><span class="linenos">5464</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="subquery-5465"><a href="#subquery-5465"><span class="linenos">5465</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="subquery-5466"><a href="#subquery-5466"><span class="linenos">5466</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="subquery-5467"><a href="#subquery-5467"><span class="linenos">5467</span></a><span class="sd"> Build a subquery expression.</span> -</span><span id="subquery-5468"><a href="#subquery-5468"><span class="linenos">5468</span></a> -</span><span id="subquery-5469"><a href="#subquery-5469"><span class="linenos">5469</span></a><span class="sd"> Example:</span> -</span><span id="subquery-5470"><a href="#subquery-5470"><span class="linenos">5470</span></a><span class="sd"> >>> subquery('select x from tbl', 'bar').select('x').sql()</span> -</span><span id="subquery-5471"><a href="#subquery-5471"><span class="linenos">5471</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl) AS bar'</span> -</span><span id="subquery-5472"><a href="#subquery-5472"><span class="linenos">5472</span></a> -</span><span id="subquery-5473"><a href="#subquery-5473"><span class="linenos">5473</span></a><span class="sd"> Args:</span> -</span><span id="subquery-5474"><a href="#subquery-5474"><span class="linenos">5474</span></a><span class="sd"> expression: the SQL code strings to parse.</span> -</span><span id="subquery-5475"><a href="#subquery-5475"><span class="linenos">5475</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="subquery-5476"><a href="#subquery-5476"><span class="linenos">5476</span></a><span class="sd"> alias: the alias name to use.</span> -</span><span id="subquery-5477"><a href="#subquery-5477"><span class="linenos">5477</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="subquery-5478"><a href="#subquery-5478"><span class="linenos">5478</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="subquery-5479"><a href="#subquery-5479"><span class="linenos">5479</span></a> -</span><span id="subquery-5480"><a href="#subquery-5480"><span class="linenos">5480</span></a><span class="sd"> Returns:</span> -</span><span id="subquery-5481"><a href="#subquery-5481"><span class="linenos">5481</span></a><span class="sd"> A new Select instance with the subquery expression included.</span> -</span><span id="subquery-5482"><a href="#subquery-5482"><span class="linenos">5482</span></a><span class="sd"> """</span> -</span><span id="subquery-5483"><a href="#subquery-5483"><span class="linenos">5483</span></a> -</span><span id="subquery-5484"><a href="#subquery-5484"><span class="linenos">5484</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-5485"><a href="#subquery-5485"><span class="linenos">5485</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-5463"><a href="#subquery-5463"><span class="linenos">5463</span></a><span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span> +</span><span id="subquery-5464"><a href="#subquery-5464"><span class="linenos">5464</span></a> <span class="n">expression</span><span class="p">:</span> <span class="n">ExpOrStr</span><span class="p">,</span> +</span><span id="subquery-5465"><a href="#subquery-5465"><span class="linenos">5465</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="n">Identifier</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="subquery-5466"><a href="#subquery-5466"><span class="linenos">5466</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="subquery-5467"><a href="#subquery-5467"><span class="linenos">5467</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="subquery-5468"><a href="#subquery-5468"><span class="linenos">5468</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="subquery-5469"><a href="#subquery-5469"><span class="linenos">5469</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="subquery-5470"><a href="#subquery-5470"><span class="linenos">5470</span></a><span class="sd"> Build a subquery expression.</span> +</span><span id="subquery-5471"><a href="#subquery-5471"><span class="linenos">5471</span></a> +</span><span id="subquery-5472"><a href="#subquery-5472"><span class="linenos">5472</span></a><span class="sd"> Example:</span> +</span><span id="subquery-5473"><a href="#subquery-5473"><span class="linenos">5473</span></a><span class="sd"> >>> subquery('select x from tbl', 'bar').select('x').sql()</span> +</span><span id="subquery-5474"><a href="#subquery-5474"><span class="linenos">5474</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl) AS bar'</span> +</span><span id="subquery-5475"><a href="#subquery-5475"><span class="linenos">5475</span></a> +</span><span id="subquery-5476"><a href="#subquery-5476"><span class="linenos">5476</span></a><span class="sd"> Args:</span> +</span><span id="subquery-5477"><a href="#subquery-5477"><span class="linenos">5477</span></a><span class="sd"> expression: the SQL code strings to parse.</span> +</span><span id="subquery-5478"><a href="#subquery-5478"><span class="linenos">5478</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="subquery-5479"><a href="#subquery-5479"><span class="linenos">5479</span></a><span class="sd"> alias: the alias name to use.</span> +</span><span id="subquery-5480"><a href="#subquery-5480"><span class="linenos">5480</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="subquery-5481"><a href="#subquery-5481"><span class="linenos">5481</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="subquery-5482"><a href="#subquery-5482"><span class="linenos">5482</span></a> +</span><span id="subquery-5483"><a href="#subquery-5483"><span class="linenos">5483</span></a><span class="sd"> Returns:</span> +</span><span id="subquery-5484"><a href="#subquery-5484"><span class="linenos">5484</span></a><span class="sd"> A new Select instance with the subquery expression included.</span> +</span><span id="subquery-5485"><a href="#subquery-5485"><span class="linenos">5485</span></a><span class="sd"> """</span> +</span><span id="subquery-5486"><a href="#subquery-5486"><span class="linenos">5486</span></a> +</span><span id="subquery-5487"><a href="#subquery-5487"><span class="linenos">5487</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-5488"><a href="#subquery-5488"><span class="linenos">5488</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> @@ -67912,32 +68039,32 @@ 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-5488"><a href="#column-5488"><span class="linenos">5488</span></a><span class="k">def</span> <span class="nf">column</span><span class="p">(</span> -</span><span id="column-5489"><a href="#column-5489"><span class="linenos">5489</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-5490"><a href="#column-5490"><span class="linenos">5490</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-5491"><a href="#column-5491"><span class="linenos">5491</span></a> <span class="n">db</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-5492"><a href="#column-5492"><span class="linenos">5492</span></a> <span class="n">catalog</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-5493"><a href="#column-5493"><span class="linenos">5493</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-5494"><a href="#column-5494"><span class="linenos">5494</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Column</span><span class="p">:</span> -</span><span id="column-5495"><a href="#column-5495"><span class="linenos">5495</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="column-5496"><a href="#column-5496"><span class="linenos">5496</span></a><span class="sd"> Build a Column.</span> -</span><span id="column-5497"><a href="#column-5497"><span class="linenos">5497</span></a> -</span><span id="column-5498"><a href="#column-5498"><span class="linenos">5498</span></a><span class="sd"> Args:</span> -</span><span id="column-5499"><a href="#column-5499"><span class="linenos">5499</span></a><span class="sd"> col: Column name.</span> -</span><span id="column-5500"><a href="#column-5500"><span class="linenos">5500</span></a><span class="sd"> table: Table name.</span> -</span><span id="column-5501"><a href="#column-5501"><span class="linenos">5501</span></a><span class="sd"> db: Database name.</span> -</span><span id="column-5502"><a href="#column-5502"><span class="linenos">5502</span></a><span class="sd"> catalog: Catalog name.</span> -</span><span id="column-5503"><a href="#column-5503"><span class="linenos">5503</span></a><span class="sd"> quoted: Whether to force quotes on the column's identifiers.</span> -</span><span id="column-5504"><a href="#column-5504"><span class="linenos">5504</span></a> -</span><span id="column-5505"><a href="#column-5505"><span class="linenos">5505</span></a><span class="sd"> Returns:</span> -</span><span id="column-5506"><a href="#column-5506"><span class="linenos">5506</span></a><span class="sd"> The new Column instance.</span> -</span><span id="column-5507"><a href="#column-5507"><span class="linenos">5507</span></a><span class="sd"> """</span> -</span><span id="column-5508"><a href="#column-5508"><span class="linenos">5508</span></a> <span class="k">return</span> <span class="n">Column</span><span class="p">(</span> -</span><span id="column-5509"><a href="#column-5509"><span class="linenos">5509</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-5510"><a href="#column-5510"><span class="linenos">5510</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-5511"><a href="#column-5511"><span class="linenos">5511</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="column-5512"><a href="#column-5512"><span class="linenos">5512</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="column-5513"><a href="#column-5513"><span class="linenos">5513</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="column-5491"><a href="#column-5491"><span class="linenos">5491</span></a><span class="k">def</span> <span class="nf">column</span><span class="p">(</span> +</span><span id="column-5492"><a href="#column-5492"><span class="linenos">5492</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-5493"><a href="#column-5493"><span class="linenos">5493</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-5494"><a href="#column-5494"><span class="linenos">5494</span></a> <span class="n">db</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-5495"><a href="#column-5495"><span class="linenos">5495</span></a> <span class="n">catalog</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-5496"><a href="#column-5496"><span class="linenos">5496</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-5497"><a href="#column-5497"><span class="linenos">5497</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Column</span><span class="p">:</span> +</span><span id="column-5498"><a href="#column-5498"><span class="linenos">5498</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="column-5499"><a href="#column-5499"><span class="linenos">5499</span></a><span class="sd"> Build a Column.</span> +</span><span id="column-5500"><a href="#column-5500"><span class="linenos">5500</span></a> +</span><span id="column-5501"><a href="#column-5501"><span class="linenos">5501</span></a><span class="sd"> Args:</span> +</span><span id="column-5502"><a href="#column-5502"><span class="linenos">5502</span></a><span class="sd"> col: Column name.</span> +</span><span id="column-5503"><a href="#column-5503"><span class="linenos">5503</span></a><span class="sd"> table: Table name.</span> +</span><span id="column-5504"><a href="#column-5504"><span class="linenos">5504</span></a><span class="sd"> db: Database name.</span> +</span><span id="column-5505"><a href="#column-5505"><span class="linenos">5505</span></a><span class="sd"> catalog: Catalog name.</span> +</span><span id="column-5506"><a href="#column-5506"><span class="linenos">5506</span></a><span class="sd"> quoted: Whether to force quotes on the column's identifiers.</span> +</span><span id="column-5507"><a href="#column-5507"><span class="linenos">5507</span></a> +</span><span id="column-5508"><a href="#column-5508"><span class="linenos">5508</span></a><span class="sd"> Returns:</span> +</span><span id="column-5509"><a href="#column-5509"><span class="linenos">5509</span></a><span class="sd"> The new Column instance.</span> +</span><span id="column-5510"><a href="#column-5510"><span class="linenos">5510</span></a><span class="sd"> """</span> +</span><span id="column-5511"><a href="#column-5511"><span class="linenos">5511</span></a> <span class="k">return</span> <span class="n">Column</span><span class="p">(</span> +</span><span id="column-5512"><a href="#column-5512"><span class="linenos">5512</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-5513"><a href="#column-5513"><span class="linenos">5513</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-5514"><a href="#column-5514"><span class="linenos">5514</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="column-5515"><a href="#column-5515"><span class="linenos">5515</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="column-5516"><a href="#column-5516"><span class="linenos">5516</span></a> <span class="p">)</span> </span></pre></div> @@ -67973,22 +68100,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-5516"><a href="#cast-5516"><span class="linenos">5516</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="n">ExpOrStr</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-5517"><a href="#cast-5517"><span class="linenos">5517</span></a><span class="w"> </span><span class="sd">"""Cast an expression to a data type.</span> -</span><span id="cast-5518"><a href="#cast-5518"><span class="linenos">5518</span></a> -</span><span id="cast-5519"><a href="#cast-5519"><span class="linenos">5519</span></a><span class="sd"> Example:</span> -</span><span id="cast-5520"><a href="#cast-5520"><span class="linenos">5520</span></a><span class="sd"> >>> cast('x + 1', 'int').sql()</span> -</span><span id="cast-5521"><a href="#cast-5521"><span class="linenos">5521</span></a><span class="sd"> 'CAST(x + 1 AS INT)'</span> -</span><span id="cast-5522"><a href="#cast-5522"><span class="linenos">5522</span></a> -</span><span id="cast-5523"><a href="#cast-5523"><span class="linenos">5523</span></a><span class="sd"> Args:</span> -</span><span id="cast-5524"><a href="#cast-5524"><span class="linenos">5524</span></a><span class="sd"> expression: The expression to cast.</span> -</span><span id="cast-5525"><a href="#cast-5525"><span class="linenos">5525</span></a><span class="sd"> to: The datatype to cast to.</span> -</span><span id="cast-5526"><a href="#cast-5526"><span class="linenos">5526</span></a> -</span><span id="cast-5527"><a href="#cast-5527"><span class="linenos">5527</span></a><span class="sd"> Returns:</span> -</span><span id="cast-5528"><a href="#cast-5528"><span class="linenos">5528</span></a><span class="sd"> The new Cast instance.</span> -</span><span id="cast-5529"><a href="#cast-5529"><span class="linenos">5529</span></a><span class="sd"> """</span> -</span><span id="cast-5530"><a href="#cast-5530"><span class="linenos">5530</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-5531"><a href="#cast-5531"><span class="linenos">5531</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-5519"><a href="#cast-5519"><span class="linenos">5519</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="n">ExpOrStr</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-5520"><a href="#cast-5520"><span class="linenos">5520</span></a><span class="w"> </span><span class="sd">"""Cast an expression to a data type.</span> +</span><span id="cast-5521"><a href="#cast-5521"><span class="linenos">5521</span></a> +</span><span id="cast-5522"><a href="#cast-5522"><span class="linenos">5522</span></a><span class="sd"> Example:</span> +</span><span id="cast-5523"><a href="#cast-5523"><span class="linenos">5523</span></a><span class="sd"> >>> cast('x + 1', 'int').sql()</span> +</span><span id="cast-5524"><a href="#cast-5524"><span class="linenos">5524</span></a><span class="sd"> 'CAST(x + 1 AS INT)'</span> +</span><span id="cast-5525"><a href="#cast-5525"><span class="linenos">5525</span></a> +</span><span id="cast-5526"><a href="#cast-5526"><span class="linenos">5526</span></a><span class="sd"> Args:</span> +</span><span id="cast-5527"><a href="#cast-5527"><span class="linenos">5527</span></a><span class="sd"> expression: The expression to cast.</span> +</span><span id="cast-5528"><a href="#cast-5528"><span class="linenos">5528</span></a><span class="sd"> to: The datatype to cast to.</span> +</span><span id="cast-5529"><a href="#cast-5529"><span class="linenos">5529</span></a> +</span><span id="cast-5530"><a href="#cast-5530"><span class="linenos">5530</span></a><span class="sd"> Returns:</span> +</span><span id="cast-5531"><a href="#cast-5531"><span class="linenos">5531</span></a><span class="sd"> The new Cast instance.</span> +</span><span id="cast-5532"><a href="#cast-5532"><span class="linenos">5532</span></a><span class="sd"> """</span> +</span><span id="cast-5533"><a href="#cast-5533"><span class="linenos">5533</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-5534"><a href="#cast-5534"><span class="linenos">5534</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> @@ -68031,31 +68158,31 @@ 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_-5534"><a href="#table_-5534"><span class="linenos">5534</span></a><span class="k">def</span> <span class="nf">table_</span><span class="p">(</span> -</span><span id="table_-5535"><a href="#table_-5535"><span class="linenos">5535</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">Identifier</span> <span class="o">|</span> <span class="nb">str</span><span class="p">,</span> -</span><span id="table_-5536"><a href="#table_-5536"><span class="linenos">5536</span></a> <span class="n">db</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">Identifier</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="table_-5537"><a href="#table_-5537"><span class="linenos">5537</span></a> <span class="n">catalog</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">Identifier</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="table_-5538"><a href="#table_-5538"><span class="linenos">5538</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="table_-5539"><a href="#table_-5539"><span class="linenos">5539</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="n">Identifier</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="table_-5540"><a href="#table_-5540"><span class="linenos">5540</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Table</span><span class="p">:</span> -</span><span id="table_-5541"><a href="#table_-5541"><span class="linenos">5541</span></a><span class="w"> </span><span class="sd">"""Build a Table.</span> -</span><span id="table_-5542"><a href="#table_-5542"><span class="linenos">5542</span></a> -</span><span id="table_-5543"><a href="#table_-5543"><span class="linenos">5543</span></a><span class="sd"> Args:</span> -</span><span id="table_-5544"><a href="#table_-5544"><span class="linenos">5544</span></a><span class="sd"> table: Table name.</span> -</span><span id="table_-5545"><a href="#table_-5545"><span class="linenos">5545</span></a><span class="sd"> db: Database name.</span> -</span><span id="table_-5546"><a href="#table_-5546"><span class="linenos">5546</span></a><span class="sd"> catalog: Catalog name.</span> -</span><span id="table_-5547"><a href="#table_-5547"><span class="linenos">5547</span></a><span class="sd"> quote: Whether to force quotes on the table's identifiers.</span> -</span><span id="table_-5548"><a href="#table_-5548"><span class="linenos">5548</span></a><span class="sd"> alias: Table's alias.</span> -</span><span id="table_-5549"><a href="#table_-5549"><span class="linenos">5549</span></a> -</span><span id="table_-5550"><a href="#table_-5550"><span class="linenos">5550</span></a><span class="sd"> Returns:</span> -</span><span id="table_-5551"><a href="#table_-5551"><span class="linenos">5551</span></a><span class="sd"> The new Table instance.</span> -</span><span id="table_-5552"><a href="#table_-5552"><span class="linenos">5552</span></a><span class="sd"> """</span> -</span><span id="table_-5553"><a href="#table_-5553"><span class="linenos">5553</span></a> <span class="k">return</span> <span class="n">Table</span><span class="p">(</span> -</span><span id="table_-5554"><a href="#table_-5554"><span class="linenos">5554</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_-5555"><a href="#table_-5555"><span class="linenos">5555</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_-5556"><a href="#table_-5556"><span class="linenos">5556</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_-5557"><a href="#table_-5557"><span class="linenos">5557</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_-5558"><a href="#table_-5558"><span class="linenos">5558</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="table_-5537"><a href="#table_-5537"><span class="linenos">5537</span></a><span class="k">def</span> <span class="nf">table_</span><span class="p">(</span> +</span><span id="table_-5538"><a href="#table_-5538"><span class="linenos">5538</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">Identifier</span> <span class="o">|</span> <span class="nb">str</span><span class="p">,</span> +</span><span id="table_-5539"><a href="#table_-5539"><span class="linenos">5539</span></a> <span class="n">db</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">Identifier</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="table_-5540"><a href="#table_-5540"><span class="linenos">5540</span></a> <span class="n">catalog</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">Identifier</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="table_-5541"><a href="#table_-5541"><span class="linenos">5541</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="table_-5542"><a href="#table_-5542"><span class="linenos">5542</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="n">Identifier</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="table_-5543"><a href="#table_-5543"><span class="linenos">5543</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Table</span><span class="p">:</span> +</span><span id="table_-5544"><a href="#table_-5544"><span class="linenos">5544</span></a><span class="w"> </span><span class="sd">"""Build a Table.</span> +</span><span id="table_-5545"><a href="#table_-5545"><span class="linenos">5545</span></a> +</span><span id="table_-5546"><a href="#table_-5546"><span class="linenos">5546</span></a><span class="sd"> Args:</span> +</span><span id="table_-5547"><a href="#table_-5547"><span class="linenos">5547</span></a><span class="sd"> table: Table name.</span> +</span><span id="table_-5548"><a href="#table_-5548"><span class="linenos">5548</span></a><span class="sd"> db: Database name.</span> +</span><span id="table_-5549"><a href="#table_-5549"><span class="linenos">5549</span></a><span class="sd"> catalog: Catalog name.</span> +</span><span id="table_-5550"><a href="#table_-5550"><span class="linenos">5550</span></a><span class="sd"> quote: Whether to force quotes on the table's identifiers.</span> +</span><span id="table_-5551"><a href="#table_-5551"><span class="linenos">5551</span></a><span class="sd"> alias: Table's alias.</span> +</span><span id="table_-5552"><a href="#table_-5552"><span class="linenos">5552</span></a> +</span><span id="table_-5553"><a href="#table_-5553"><span class="linenos">5553</span></a><span class="sd"> Returns:</span> +</span><span id="table_-5554"><a href="#table_-5554"><span class="linenos">5554</span></a><span class="sd"> The new Table instance.</span> +</span><span id="table_-5555"><a href="#table_-5555"><span class="linenos">5555</span></a><span class="sd"> """</span> +</span><span id="table_-5556"><a href="#table_-5556"><span class="linenos">5556</span></a> <span class="k">return</span> <span class="n">Table</span><span class="p">(</span> +</span><span id="table_-5557"><a href="#table_-5557"><span class="linenos">5557</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_-5558"><a href="#table_-5558"><span class="linenos">5558</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_-5559"><a href="#table_-5559"><span class="linenos">5559</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_-5560"><a href="#table_-5560"><span class="linenos">5560</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_-5561"><a href="#table_-5561"><span class="linenos">5561</span></a> <span class="p">)</span> </span></pre></div> @@ -68091,37 +68218,37 @@ 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-5561"><a href="#values-5561"><span class="linenos">5561</span></a><span class="k">def</span> <span class="nf">values</span><span class="p">(</span> -</span><span id="values-5562"><a href="#values-5562"><span class="linenos">5562</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-5563"><a href="#values-5563"><span class="linenos">5563</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-5564"><a href="#values-5564"><span class="linenos">5564</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-5565"><a href="#values-5565"><span class="linenos">5565</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Values</span><span class="p">:</span> -</span><span id="values-5566"><a href="#values-5566"><span class="linenos">5566</span></a><span class="w"> </span><span class="sd">"""Build VALUES statement.</span> -</span><span id="values-5567"><a href="#values-5567"><span class="linenos">5567</span></a> -</span><span id="values-5568"><a href="#values-5568"><span class="linenos">5568</span></a><span class="sd"> Example:</span> -</span><span id="values-5569"><a href="#values-5569"><span class="linenos">5569</span></a><span class="sd"> >>> values([(1, '2')]).sql()</span> -</span><span id="values-5570"><a href="#values-5570"><span class="linenos">5570</span></a><span class="sd"> "VALUES (1, '2')"</span> -</span><span id="values-5571"><a href="#values-5571"><span class="linenos">5571</span></a> -</span><span id="values-5572"><a href="#values-5572"><span class="linenos">5572</span></a><span class="sd"> Args:</span> -</span><span id="values-5573"><a href="#values-5573"><span class="linenos">5573</span></a><span class="sd"> values: values statements that will be converted to SQL</span> -</span><span id="values-5574"><a href="#values-5574"><span class="linenos">5574</span></a><span class="sd"> alias: optional alias</span> -</span><span id="values-5575"><a href="#values-5575"><span class="linenos">5575</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-5576"><a href="#values-5576"><span class="linenos">5576</span></a><span class="sd"> If either are provided then an alias is also required.</span> -</span><span id="values-5577"><a href="#values-5577"><span class="linenos">5577</span></a> -</span><span id="values-5578"><a href="#values-5578"><span class="linenos">5578</span></a><span class="sd"> Returns:</span> -</span><span id="values-5579"><a href="#values-5579"><span class="linenos">5579</span></a><span class="sd"> Values: the Values expression object</span> -</span><span id="values-5580"><a href="#values-5580"><span class="linenos">5580</span></a><span class="sd"> """</span> -</span><span id="values-5581"><a href="#values-5581"><span class="linenos">5581</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-5582"><a href="#values-5582"><span class="linenos">5582</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-5583"><a href="#values-5583"><span class="linenos">5583</span></a> -</span><span id="values-5584"><a href="#values-5584"><span class="linenos">5584</span></a> <span class="k">return</span> <span class="n">Values</span><span class="p">(</span> -</span><span id="values-5585"><a href="#values-5585"><span class="linenos">5585</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-5586"><a href="#values-5586"><span class="linenos">5586</span></a> <span class="n">alias</span><span class="o">=</span><span class="p">(</span> -</span><span id="values-5587"><a href="#values-5587"><span class="linenos">5587</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-5588"><a href="#values-5588"><span class="linenos">5588</span></a> <span class="k">if</span> <span class="n">columns</span> -</span><span id="values-5589"><a href="#values-5589"><span class="linenos">5589</span></a> <span class="k">else</span> <span class="p">(</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-5590"><a href="#values-5590"><span class="linenos">5590</span></a> <span class="p">),</span> -</span><span id="values-5591"><a href="#values-5591"><span class="linenos">5591</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="values-5564"><a href="#values-5564"><span class="linenos">5564</span></a><span class="k">def</span> <span class="nf">values</span><span class="p">(</span> +</span><span id="values-5565"><a href="#values-5565"><span class="linenos">5565</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-5566"><a href="#values-5566"><span class="linenos">5566</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-5567"><a href="#values-5567"><span class="linenos">5567</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-5568"><a href="#values-5568"><span class="linenos">5568</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Values</span><span class="p">:</span> +</span><span id="values-5569"><a href="#values-5569"><span class="linenos">5569</span></a><span class="w"> </span><span class="sd">"""Build VALUES statement.</span> +</span><span id="values-5570"><a href="#values-5570"><span class="linenos">5570</span></a> +</span><span id="values-5571"><a href="#values-5571"><span class="linenos">5571</span></a><span class="sd"> Example:</span> +</span><span id="values-5572"><a href="#values-5572"><span class="linenos">5572</span></a><span class="sd"> >>> values([(1, '2')]).sql()</span> +</span><span id="values-5573"><a href="#values-5573"><span class="linenos">5573</span></a><span class="sd"> "VALUES (1, '2')"</span> +</span><span id="values-5574"><a href="#values-5574"><span class="linenos">5574</span></a> +</span><span id="values-5575"><a href="#values-5575"><span class="linenos">5575</span></a><span class="sd"> Args:</span> +</span><span id="values-5576"><a href="#values-5576"><span class="linenos">5576</span></a><span class="sd"> values: values statements that will be converted to SQL</span> +</span><span id="values-5577"><a href="#values-5577"><span class="linenos">5577</span></a><span class="sd"> alias: optional alias</span> +</span><span id="values-5578"><a href="#values-5578"><span class="linenos">5578</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-5579"><a href="#values-5579"><span class="linenos">5579</span></a><span class="sd"> If either are provided then an alias is also required.</span> +</span><span id="values-5580"><a href="#values-5580"><span class="linenos">5580</span></a> +</span><span id="values-5581"><a href="#values-5581"><span class="linenos">5581</span></a><span class="sd"> Returns:</span> +</span><span id="values-5582"><a href="#values-5582"><span class="linenos">5582</span></a><span class="sd"> Values: the Values expression object</span> +</span><span id="values-5583"><a href="#values-5583"><span class="linenos">5583</span></a><span class="sd"> """</span> +</span><span id="values-5584"><a href="#values-5584"><span class="linenos">5584</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-5585"><a href="#values-5585"><span class="linenos">5585</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-5586"><a href="#values-5586"><span class="linenos">5586</span></a> +</span><span id="values-5587"><a href="#values-5587"><span class="linenos">5587</span></a> <span class="k">return</span> <span class="n">Values</span><span class="p">(</span> +</span><span id="values-5588"><a href="#values-5588"><span class="linenos">5588</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-5589"><a href="#values-5589"><span class="linenos">5589</span></a> <span class="n">alias</span><span class="o">=</span><span class="p">(</span> +</span><span id="values-5590"><a href="#values-5590"><span class="linenos">5590</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-5591"><a href="#values-5591"><span class="linenos">5591</span></a> <span class="k">if</span> <span class="n">columns</span> +</span><span id="values-5592"><a href="#values-5592"><span class="linenos">5592</span></a> <span class="k">else</span> <span class="p">(</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-5593"><a href="#values-5593"><span class="linenos">5593</span></a> <span class="p">),</span> +</span><span id="values-5594"><a href="#values-5594"><span class="linenos">5594</span></a> <span class="p">)</span> </span></pre></div> @@ -68166,28 +68293,28 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#var"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="var-5594"><a href="#var-5594"><span class="linenos">5594</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="n">ExpOrStr</span><span class="p">])</span> <span class="o">-></span> <span class="n">Var</span><span class="p">:</span> -</span><span id="var-5595"><a href="#var-5595"><span class="linenos">5595</span></a><span class="w"> </span><span class="sd">"""Build a SQL variable.</span> -</span><span id="var-5596"><a href="#var-5596"><span class="linenos">5596</span></a> -</span><span id="var-5597"><a href="#var-5597"><span class="linenos">5597</span></a><span class="sd"> Example:</span> -</span><span id="var-5598"><a href="#var-5598"><span class="linenos">5598</span></a><span class="sd"> >>> repr(var('x'))</span> -</span><span id="var-5599"><a href="#var-5599"><span class="linenos">5599</span></a><span class="sd"> '(VAR this: x)'</span> -</span><span id="var-5600"><a href="#var-5600"><span class="linenos">5600</span></a> -</span><span id="var-5601"><a href="#var-5601"><span class="linenos">5601</span></a><span class="sd"> >>> repr(var(column('x', table='y')))</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="var-5597"><a href="#var-5597"><span class="linenos">5597</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="n">ExpOrStr</span><span class="p">])</span> <span class="o">-></span> <span class="n">Var</span><span class="p">:</span> +</span><span id="var-5598"><a href="#var-5598"><span class="linenos">5598</span></a><span class="w"> </span><span class="sd">"""Build a SQL variable.</span> +</span><span id="var-5599"><a href="#var-5599"><span class="linenos">5599</span></a> +</span><span id="var-5600"><a href="#var-5600"><span class="linenos">5600</span></a><span class="sd"> Example:</span> +</span><span id="var-5601"><a href="#var-5601"><span class="linenos">5601</span></a><span class="sd"> >>> repr(var('x'))</span> </span><span id="var-5602"><a href="#var-5602"><span class="linenos">5602</span></a><span class="sd"> '(VAR this: x)'</span> </span><span id="var-5603"><a href="#var-5603"><span class="linenos">5603</span></a> -</span><span id="var-5604"><a href="#var-5604"><span class="linenos">5604</span></a><span class="sd"> Args:</span> -</span><span id="var-5605"><a href="#var-5605"><span class="linenos">5605</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-5604"><a href="#var-5604"><span class="linenos">5604</span></a><span class="sd"> >>> repr(var(column('x', table='y')))</span> +</span><span id="var-5605"><a href="#var-5605"><span class="linenos">5605</span></a><span class="sd"> '(VAR this: x)'</span> </span><span id="var-5606"><a href="#var-5606"><span class="linenos">5606</span></a> -</span><span id="var-5607"><a href="#var-5607"><span class="linenos">5607</span></a><span class="sd"> Returns:</span> -</span><span id="var-5608"><a href="#var-5608"><span class="linenos">5608</span></a><span class="sd"> The new variable node.</span> -</span><span id="var-5609"><a href="#var-5609"><span class="linenos">5609</span></a><span class="sd"> """</span> -</span><span id="var-5610"><a href="#var-5610"><span class="linenos">5610</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-5611"><a href="#var-5611"><span class="linenos">5611</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Cannot convert empty name into var."</span><span class="p">)</span> -</span><span id="var-5612"><a href="#var-5612"><span class="linenos">5612</span></a> -</span><span id="var-5613"><a href="#var-5613"><span class="linenos">5613</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-5614"><a href="#var-5614"><span class="linenos">5614</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-5615"><a href="#var-5615"><span class="linenos">5615</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="var-5607"><a href="#var-5607"><span class="linenos">5607</span></a><span class="sd"> Args:</span> +</span><span id="var-5608"><a href="#var-5608"><span class="linenos">5608</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-5609"><a href="#var-5609"><span class="linenos">5609</span></a> +</span><span id="var-5610"><a href="#var-5610"><span class="linenos">5610</span></a><span class="sd"> Returns:</span> +</span><span id="var-5611"><a href="#var-5611"><span class="linenos">5611</span></a><span class="sd"> The new variable node.</span> +</span><span id="var-5612"><a href="#var-5612"><span class="linenos">5612</span></a><span class="sd"> """</span> +</span><span id="var-5613"><a href="#var-5613"><span class="linenos">5613</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-5614"><a href="#var-5614"><span class="linenos">5614</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Cannot convert empty name into var."</span><span class="p">)</span> +</span><span id="var-5615"><a href="#var-5615"><span class="linenos">5615</span></a> +</span><span id="var-5616"><a href="#var-5616"><span class="linenos">5616</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-5617"><a href="#var-5617"><span class="linenos">5617</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-5618"><a href="#var-5618"><span class="linenos">5618</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> @@ -68235,24 +68362,24 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#rename_table"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="rename_table-5618"><a href="#rename_table-5618"><span class="linenos">5618</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-5619"><a href="#rename_table-5619"><span class="linenos">5619</span></a><span class="w"> </span><span class="sd">"""Build ALTER TABLE... RENAME... expression</span> -</span><span id="rename_table-5620"><a href="#rename_table-5620"><span class="linenos">5620</span></a> -</span><span id="rename_table-5621"><a href="#rename_table-5621"><span class="linenos">5621</span></a><span class="sd"> Args:</span> -</span><span id="rename_table-5622"><a href="#rename_table-5622"><span class="linenos">5622</span></a><span class="sd"> old_name: The old name of the table</span> -</span><span id="rename_table-5623"><a href="#rename_table-5623"><span class="linenos">5623</span></a><span class="sd"> new_name: The new name of the table</span> -</span><span id="rename_table-5624"><a href="#rename_table-5624"><span class="linenos">5624</span></a> -</span><span id="rename_table-5625"><a href="#rename_table-5625"><span class="linenos">5625</span></a><span class="sd"> Returns:</span> -</span><span id="rename_table-5626"><a href="#rename_table-5626"><span class="linenos">5626</span></a><span class="sd"> Alter table expression</span> -</span><span id="rename_table-5627"><a href="#rename_table-5627"><span class="linenos">5627</span></a><span class="sd"> """</span> -</span><span id="rename_table-5628"><a href="#rename_table-5628"><span class="linenos">5628</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-5629"><a href="#rename_table-5629"><span class="linenos">5629</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-5630"><a href="#rename_table-5630"><span class="linenos">5630</span></a> <span class="k">return</span> <span class="n">AlterTable</span><span class="p">(</span> -</span><span id="rename_table-5631"><a href="#rename_table-5631"><span class="linenos">5631</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-5632"><a href="#rename_table-5632"><span class="linenos">5632</span></a> <span class="n">actions</span><span class="o">=</span><span class="p">[</span> -</span><span id="rename_table-5633"><a href="#rename_table-5633"><span class="linenos">5633</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-5634"><a href="#rename_table-5634"><span class="linenos">5634</span></a> <span class="p">],</span> -</span><span id="rename_table-5635"><a href="#rename_table-5635"><span class="linenos">5635</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="rename_table-5621"><a href="#rename_table-5621"><span class="linenos">5621</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-5622"><a href="#rename_table-5622"><span class="linenos">5622</span></a><span class="w"> </span><span class="sd">"""Build ALTER TABLE... RENAME... expression</span> +</span><span id="rename_table-5623"><a href="#rename_table-5623"><span class="linenos">5623</span></a> +</span><span id="rename_table-5624"><a href="#rename_table-5624"><span class="linenos">5624</span></a><span class="sd"> Args:</span> +</span><span id="rename_table-5625"><a href="#rename_table-5625"><span class="linenos">5625</span></a><span class="sd"> old_name: The old name of the table</span> +</span><span id="rename_table-5626"><a href="#rename_table-5626"><span class="linenos">5626</span></a><span class="sd"> new_name: The new name of the table</span> +</span><span id="rename_table-5627"><a href="#rename_table-5627"><span class="linenos">5627</span></a> +</span><span id="rename_table-5628"><a href="#rename_table-5628"><span class="linenos">5628</span></a><span class="sd"> Returns:</span> +</span><span id="rename_table-5629"><a href="#rename_table-5629"><span class="linenos">5629</span></a><span class="sd"> Alter table expression</span> +</span><span id="rename_table-5630"><a href="#rename_table-5630"><span class="linenos">5630</span></a><span class="sd"> """</span> +</span><span id="rename_table-5631"><a href="#rename_table-5631"><span class="linenos">5631</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-5632"><a href="#rename_table-5632"><span class="linenos">5632</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-5633"><a href="#rename_table-5633"><span class="linenos">5633</span></a> <span class="k">return</span> <span class="n">AlterTable</span><span class="p">(</span> +</span><span id="rename_table-5634"><a href="#rename_table-5634"><span class="linenos">5634</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-5635"><a href="#rename_table-5635"><span class="linenos">5635</span></a> <span class="n">actions</span><span class="o">=</span><span class="p">[</span> +</span><span id="rename_table-5636"><a href="#rename_table-5636"><span class="linenos">5636</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-5637"><a href="#rename_table-5637"><span class="linenos">5637</span></a> <span class="p">],</span> +</span><span id="rename_table-5638"><a href="#rename_table-5638"><span class="linenos">5638</span></a> <span class="p">)</span> </span></pre></div> @@ -68285,46 +68412,46 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#convert"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="convert-5638"><a href="#convert-5638"><span class="linenos">5638</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="n">t</span><span class="o">.</span><span class="n">Any</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">False</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="convert-5639"><a href="#convert-5639"><span class="linenos">5639</span></a><span class="w"> </span><span class="sd">"""Convert a python value into an expression object.</span> -</span><span id="convert-5640"><a href="#convert-5640"><span class="linenos">5640</span></a> -</span><span id="convert-5641"><a href="#convert-5641"><span class="linenos">5641</span></a><span class="sd"> Raises an error if a conversion is not possible.</span> -</span><span id="convert-5642"><a href="#convert-5642"><span class="linenos">5642</span></a> -</span><span id="convert-5643"><a href="#convert-5643"><span class="linenos">5643</span></a><span class="sd"> Args:</span> -</span><span id="convert-5644"><a href="#convert-5644"><span class="linenos">5644</span></a><span class="sd"> value: A python object.</span> -</span><span id="convert-5645"><a href="#convert-5645"><span class="linenos">5645</span></a><span class="sd"> copy: Whether or not to copy `value` (only applies to Expressions and collections).</span> -</span><span id="convert-5646"><a href="#convert-5646"><span class="linenos">5646</span></a> -</span><span id="convert-5647"><a href="#convert-5647"><span class="linenos">5647</span></a><span class="sd"> Returns:</span> -</span><span id="convert-5648"><a href="#convert-5648"><span class="linenos">5648</span></a><span class="sd"> Expression: the equivalent expression object.</span> -</span><span id="convert-5649"><a href="#convert-5649"><span class="linenos">5649</span></a><span class="sd"> """</span> -</span><span id="convert-5650"><a href="#convert-5650"><span class="linenos">5650</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-5651"><a href="#convert-5651"><span class="linenos">5651</span></a> <span class="k">return</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="convert-5652"><a href="#convert-5652"><span class="linenos">5652</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-5653"><a href="#convert-5653"><span class="linenos">5653</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-5654"><a href="#convert-5654"><span class="linenos">5654</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-5655"><a href="#convert-5655"><span class="linenos">5655</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-5656"><a href="#convert-5656"><span class="linenos">5656</span></a> <span class="k">if</span> <span class="n">value</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">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-5657"><a href="#convert-5657"><span class="linenos">5657</span></a> <span class="k">return</span> <span class="n">NULL</span> -</span><span id="convert-5658"><a href="#convert-5658"><span class="linenos">5658</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-5659"><a href="#convert-5659"><span class="linenos">5659</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-5660"><a href="#convert-5660"><span class="linenos">5660</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-5661"><a href="#convert-5661"><span class="linenos">5661</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-5662"><a href="#convert-5662"><span class="linenos">5662</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-5663"><a href="#convert-5663"><span class="linenos">5663</span></a> <span class="p">)</span> -</span><span id="convert-5664"><a href="#convert-5664"><span class="linenos">5664</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-5665"><a href="#convert-5665"><span class="linenos">5665</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-5666"><a href="#convert-5666"><span class="linenos">5666</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-5667"><a href="#convert-5667"><span class="linenos">5667</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-5668"><a href="#convert-5668"><span class="linenos">5668</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-5669"><a href="#convert-5669"><span class="linenos">5669</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5670"><a href="#convert-5670"><span class="linenos">5670</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-5671"><a href="#convert-5671"><span class="linenos">5671</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5672"><a href="#convert-5672"><span class="linenos">5672</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-5673"><a href="#convert-5673"><span class="linenos">5673</span></a> <span class="k">return</span> <span class="n">Map</span><span class="p">(</span> -</span><span id="convert-5674"><a href="#convert-5674"><span class="linenos">5674</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5675"><a href="#convert-5675"><span class="linenos">5675</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5676"><a href="#convert-5676"><span class="linenos">5676</span></a> <span class="p">)</span> -</span><span id="convert-5677"><a href="#convert-5677"><span class="linenos">5677</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-5641"><a href="#convert-5641"><span class="linenos">5641</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="n">t</span><span class="o">.</span><span class="n">Any</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">False</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="convert-5642"><a href="#convert-5642"><span class="linenos">5642</span></a><span class="w"> </span><span class="sd">"""Convert a python value into an expression object.</span> +</span><span id="convert-5643"><a href="#convert-5643"><span class="linenos">5643</span></a> +</span><span id="convert-5644"><a href="#convert-5644"><span class="linenos">5644</span></a><span class="sd"> Raises an error if a conversion is not possible.</span> +</span><span id="convert-5645"><a href="#convert-5645"><span class="linenos">5645</span></a> +</span><span id="convert-5646"><a href="#convert-5646"><span class="linenos">5646</span></a><span class="sd"> Args:</span> +</span><span id="convert-5647"><a href="#convert-5647"><span class="linenos">5647</span></a><span class="sd"> value: A python object.</span> +</span><span id="convert-5648"><a href="#convert-5648"><span class="linenos">5648</span></a><span class="sd"> copy: Whether or not to copy `value` (only applies to Expressions and collections).</span> +</span><span id="convert-5649"><a href="#convert-5649"><span class="linenos">5649</span></a> +</span><span id="convert-5650"><a href="#convert-5650"><span class="linenos">5650</span></a><span class="sd"> Returns:</span> +</span><span id="convert-5651"><a href="#convert-5651"><span class="linenos">5651</span></a><span class="sd"> Expression: the equivalent expression object.</span> +</span><span id="convert-5652"><a href="#convert-5652"><span class="linenos">5652</span></a><span class="sd"> """</span> +</span><span id="convert-5653"><a href="#convert-5653"><span class="linenos">5653</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-5654"><a href="#convert-5654"><span class="linenos">5654</span></a> <span class="k">return</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="convert-5655"><a href="#convert-5655"><span class="linenos">5655</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-5656"><a href="#convert-5656"><span class="linenos">5656</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-5657"><a href="#convert-5657"><span class="linenos">5657</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-5658"><a href="#convert-5658"><span class="linenos">5658</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-5659"><a href="#convert-5659"><span class="linenos">5659</span></a> <span class="k">if</span> <span class="n">value</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">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-5660"><a href="#convert-5660"><span class="linenos">5660</span></a> <span class="k">return</span> <span class="n">NULL</span> +</span><span id="convert-5661"><a href="#convert-5661"><span class="linenos">5661</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-5662"><a href="#convert-5662"><span class="linenos">5662</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-5663"><a href="#convert-5663"><span class="linenos">5663</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-5664"><a href="#convert-5664"><span class="linenos">5664</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-5665"><a href="#convert-5665"><span class="linenos">5665</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-5666"><a href="#convert-5666"><span class="linenos">5666</span></a> <span class="p">)</span> +</span><span id="convert-5667"><a href="#convert-5667"><span class="linenos">5667</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-5668"><a href="#convert-5668"><span class="linenos">5668</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-5669"><a href="#convert-5669"><span class="linenos">5669</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-5670"><a href="#convert-5670"><span class="linenos">5670</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-5671"><a href="#convert-5671"><span class="linenos">5671</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-5672"><a href="#convert-5672"><span class="linenos">5672</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5673"><a href="#convert-5673"><span class="linenos">5673</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-5674"><a href="#convert-5674"><span class="linenos">5674</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5675"><a href="#convert-5675"><span class="linenos">5675</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-5676"><a href="#convert-5676"><span class="linenos">5676</span></a> <span class="k">return</span> <span class="n">Map</span><span class="p">(</span> +</span><span id="convert-5677"><a href="#convert-5677"><span class="linenos">5677</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5678"><a href="#convert-5678"><span class="linenos">5678</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="n">copy</span><span class="o">=</span><span class="n">copy</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-5679"><a href="#convert-5679"><span class="linenos">5679</span></a> <span class="p">)</span> +</span><span id="convert-5680"><a href="#convert-5680"><span class="linenos">5680</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> @@ -68359,26 +68486,26 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#replace_children"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="replace_children-5680"><a href="#replace_children-5680"><span class="linenos">5680</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">Expression</span><span class="p">,</span> <span class="n">fun</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Callable</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 class="o">-></span> <span class="kc">None</span><span class="p">:</span> -</span><span id="replace_children-5681"><a href="#replace_children-5681"><span class="linenos">5681</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="replace_children-5682"><a href="#replace_children-5682"><span class="linenos">5682</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-5683"><a href="#replace_children-5683"><span class="linenos">5683</span></a><span class="sd"> """</span> -</span><span id="replace_children-5684"><a href="#replace_children-5684"><span class="linenos">5684</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-5685"><a href="#replace_children-5685"><span class="linenos">5685</span></a> <span class="n">is_list_arg</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span> -</span><span id="replace_children-5686"><a href="#replace_children-5686"><span class="linenos">5686</span></a> -</span><span id="replace_children-5687"><a href="#replace_children-5687"><span class="linenos">5687</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-5688"><a href="#replace_children-5688"><span class="linenos">5688</span></a> <span class="n">new_child_nodes</span> <span class="o">=</span> <span class="p">[]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="replace_children-5683"><a href="#replace_children-5683"><span class="linenos">5683</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">Expression</span><span class="p">,</span> <span class="n">fun</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Callable</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 class="o">-></span> <span class="kc">None</span><span class="p">:</span> +</span><span id="replace_children-5684"><a href="#replace_children-5684"><span class="linenos">5684</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="replace_children-5685"><a href="#replace_children-5685"><span class="linenos">5685</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-5686"><a href="#replace_children-5686"><span class="linenos">5686</span></a><span class="sd"> """</span> +</span><span id="replace_children-5687"><a href="#replace_children-5687"><span class="linenos">5687</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-5688"><a href="#replace_children-5688"><span class="linenos">5688</span></a> <span class="n">is_list_arg</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">list</span> </span><span id="replace_children-5689"><a href="#replace_children-5689"><span class="linenos">5689</span></a> -</span><span id="replace_children-5690"><a href="#replace_children-5690"><span class="linenos">5690</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-5691"><a href="#replace_children-5691"><span class="linenos">5691</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-5692"><a href="#replace_children-5692"><span class="linenos">5692</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 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_children-5693"><a href="#replace_children-5693"><span class="linenos">5693</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-5694"><a href="#replace_children-5694"><span class="linenos">5694</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-5695"><a href="#replace_children-5695"><span class="linenos">5695</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-5696"><a href="#replace_children-5696"><span class="linenos">5696</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="replace_children-5697"><a href="#replace_children-5697"><span class="linenos">5697</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-5698"><a href="#replace_children-5698"><span class="linenos">5698</span></a> -</span><span id="replace_children-5699"><a href="#replace_children-5699"><span class="linenos">5699</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="replace_children-5690"><a href="#replace_children-5690"><span class="linenos">5690</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-5691"><a href="#replace_children-5691"><span class="linenos">5691</span></a> <span class="n">new_child_nodes</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="replace_children-5692"><a href="#replace_children-5692"><span class="linenos">5692</span></a> +</span><span id="replace_children-5693"><a href="#replace_children-5693"><span class="linenos">5693</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-5694"><a href="#replace_children-5694"><span class="linenos">5694</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-5695"><a href="#replace_children-5695"><span class="linenos">5695</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 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_children-5696"><a href="#replace_children-5696"><span class="linenos">5696</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-5697"><a href="#replace_children-5697"><span class="linenos">5697</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-5698"><a href="#replace_children-5698"><span class="linenos">5698</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-5699"><a href="#replace_children-5699"><span class="linenos">5699</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="replace_children-5700"><a href="#replace_children-5700"><span class="linenos">5700</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-5701"><a href="#replace_children-5701"><span class="linenos">5701</span></a> +</span><span id="replace_children-5702"><a href="#replace_children-5702"><span class="linenos">5702</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> @@ -68398,27 +68525,27 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#column_table_names"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="column_table_names-5702"><a href="#column_table_names-5702"><span class="linenos">5702</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 class="n">Expression</span><span class="p">,</span> <span class="n">exclude</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">""</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Set</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> -</span><span id="column_table_names-5703"><a href="#column_table_names-5703"><span class="linenos">5703</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="column_table_names-5704"><a href="#column_table_names-5704"><span class="linenos">5704</span></a><span class="sd"> Return all table names referenced through columns in an expression.</span> -</span><span id="column_table_names-5705"><a href="#column_table_names-5705"><span class="linenos">5705</span></a> -</span><span id="column_table_names-5706"><a href="#column_table_names-5706"><span class="linenos">5706</span></a><span class="sd"> Example:</span> -</span><span id="column_table_names-5707"><a href="#column_table_names-5707"><span class="linenos">5707</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="column_table_names-5708"><a href="#column_table_names-5708"><span class="linenos">5708</span></a><span class="sd"> >>> sorted(column_table_names(sqlglot.parse_one("a.b AND c.d AND c.e")))</span> -</span><span id="column_table_names-5709"><a href="#column_table_names-5709"><span class="linenos">5709</span></a><span class="sd"> ['a', 'c']</span> -</span><span id="column_table_names-5710"><a href="#column_table_names-5710"><span class="linenos">5710</span></a> -</span><span id="column_table_names-5711"><a href="#column_table_names-5711"><span class="linenos">5711</span></a><span class="sd"> Args:</span> -</span><span id="column_table_names-5712"><a href="#column_table_names-5712"><span class="linenos">5712</span></a><span class="sd"> expression: expression to find table names.</span> -</span><span id="column_table_names-5713"><a href="#column_table_names-5713"><span class="linenos">5713</span></a><span class="sd"> exclude: a table name to exclude</span> -</span><span id="column_table_names-5714"><a href="#column_table_names-5714"><span class="linenos">5714</span></a> -</span><span id="column_table_names-5715"><a href="#column_table_names-5715"><span class="linenos">5715</span></a><span class="sd"> Returns:</span> -</span><span id="column_table_names-5716"><a href="#column_table_names-5716"><span class="linenos">5716</span></a><span class="sd"> A list of unique names.</span> -</span><span id="column_table_names-5717"><a href="#column_table_names-5717"><span class="linenos">5717</span></a><span class="sd"> """</span> -</span><span id="column_table_names-5718"><a href="#column_table_names-5718"><span class="linenos">5718</span></a> <span class="k">return</span> <span class="p">{</span> -</span><span id="column_table_names-5719"><a href="#column_table_names-5719"><span class="linenos">5719</span></a> <span class="n">table</span> -</span><span id="column_table_names-5720"><a href="#column_table_names-5720"><span class="linenos">5720</span></a> <span class="k">for</span> <span class="n">table</span> <span class="ow">in</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="column_table_names-5721"><a href="#column_table_names-5721"><span class="linenos">5721</span></a> <span class="k">if</span> <span class="n">table</span> <span class="ow">and</span> <span class="n">table</span> <span class="o">!=</span> <span class="n">exclude</span> -</span><span id="column_table_names-5722"><a href="#column_table_names-5722"><span class="linenos">5722</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="column_table_names-5705"><a href="#column_table_names-5705"><span class="linenos">5705</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 class="n">Expression</span><span class="p">,</span> <span class="n">exclude</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">""</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Set</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> +</span><span id="column_table_names-5706"><a href="#column_table_names-5706"><span class="linenos">5706</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="column_table_names-5707"><a href="#column_table_names-5707"><span class="linenos">5707</span></a><span class="sd"> Return all table names referenced through columns in an expression.</span> +</span><span id="column_table_names-5708"><a href="#column_table_names-5708"><span class="linenos">5708</span></a> +</span><span id="column_table_names-5709"><a href="#column_table_names-5709"><span class="linenos">5709</span></a><span class="sd"> Example:</span> +</span><span id="column_table_names-5710"><a href="#column_table_names-5710"><span class="linenos">5710</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="column_table_names-5711"><a href="#column_table_names-5711"><span class="linenos">5711</span></a><span class="sd"> >>> sorted(column_table_names(sqlglot.parse_one("a.b AND c.d AND c.e")))</span> +</span><span id="column_table_names-5712"><a href="#column_table_names-5712"><span class="linenos">5712</span></a><span class="sd"> ['a', 'c']</span> +</span><span id="column_table_names-5713"><a href="#column_table_names-5713"><span class="linenos">5713</span></a> +</span><span id="column_table_names-5714"><a href="#column_table_names-5714"><span class="linenos">5714</span></a><span class="sd"> Args:</span> +</span><span id="column_table_names-5715"><a href="#column_table_names-5715"><span class="linenos">5715</span></a><span class="sd"> expression: expression to find table names.</span> +</span><span id="column_table_names-5716"><a href="#column_table_names-5716"><span class="linenos">5716</span></a><span class="sd"> exclude: a table name to exclude</span> +</span><span id="column_table_names-5717"><a href="#column_table_names-5717"><span class="linenos">5717</span></a> +</span><span id="column_table_names-5718"><a href="#column_table_names-5718"><span class="linenos">5718</span></a><span class="sd"> Returns:</span> +</span><span id="column_table_names-5719"><a href="#column_table_names-5719"><span class="linenos">5719</span></a><span class="sd"> A list of unique names.</span> +</span><span id="column_table_names-5720"><a href="#column_table_names-5720"><span class="linenos">5720</span></a><span class="sd"> """</span> +</span><span id="column_table_names-5721"><a href="#column_table_names-5721"><span class="linenos">5721</span></a> <span class="k">return</span> <span class="p">{</span> +</span><span id="column_table_names-5722"><a href="#column_table_names-5722"><span class="linenos">5722</span></a> <span class="n">table</span> +</span><span id="column_table_names-5723"><a href="#column_table_names-5723"><span class="linenos">5723</span></a> <span class="k">for</span> <span class="n">table</span> <span class="ow">in</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="column_table_names-5724"><a href="#column_table_names-5724"><span class="linenos">5724</span></a> <span class="k">if</span> <span class="n">table</span> <span class="ow">and</span> <span class="n">table</span> <span class="o">!=</span> <span class="n">exclude</span> +</span><span id="column_table_names-5725"><a href="#column_table_names-5725"><span class="linenos">5725</span></a> <span class="p">}</span> </span></pre></div> @@ -68462,31 +68589,31 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#table_name"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="table_name-5725"><a href="#table_name-5725"><span class="linenos">5725</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="n">Table</span> <span class="o">|</span> <span class="nb">str</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="nb">str</span><span class="p">:</span> -</span><span id="table_name-5726"><a href="#table_name-5726"><span class="linenos">5726</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-5727"><a href="#table_name-5727"><span class="linenos">5727</span></a> -</span><span id="table_name-5728"><a href="#table_name-5728"><span class="linenos">5728</span></a><span class="sd"> Args:</span> -</span><span id="table_name-5729"><a href="#table_name-5729"><span class="linenos">5729</span></a><span class="sd"> table: Table expression node or string.</span> -</span><span id="table_name-5730"><a href="#table_name-5730"><span class="linenos">5730</span></a><span class="sd"> dialect: The dialect to generate the table name for.</span> -</span><span id="table_name-5731"><a href="#table_name-5731"><span class="linenos">5731</span></a> -</span><span id="table_name-5732"><a href="#table_name-5732"><span class="linenos">5732</span></a><span class="sd"> Examples:</span> -</span><span id="table_name-5733"><a href="#table_name-5733"><span class="linenos">5733</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> -</span><span id="table_name-5734"><a href="#table_name-5734"><span class="linenos">5734</span></a><span class="sd"> >>> table_name(parse_one("select * from a.b.c").find(exp.Table))</span> -</span><span id="table_name-5735"><a href="#table_name-5735"><span class="linenos">5735</span></a><span class="sd"> 'a.b.c'</span> -</span><span id="table_name-5736"><a href="#table_name-5736"><span class="linenos">5736</span></a> -</span><span id="table_name-5737"><a href="#table_name-5737"><span class="linenos">5737</span></a><span class="sd"> Returns:</span> -</span><span id="table_name-5738"><a href="#table_name-5738"><span class="linenos">5738</span></a><span class="sd"> The table name.</span> -</span><span id="table_name-5739"><a href="#table_name-5739"><span class="linenos">5739</span></a><span class="sd"> """</span> -</span><span id="table_name-5740"><a href="#table_name-5740"><span class="linenos">5740</span></a> -</span><span id="table_name-5741"><a href="#table_name-5741"><span class="linenos">5741</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-5742"><a href="#table_name-5742"><span class="linenos">5742</span></a> -</span><span id="table_name-5743"><a href="#table_name-5743"><span class="linenos">5743</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-5744"><a href="#table_name-5744"><span class="linenos">5744</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> + <div class="pdoc-code codehilite"><pre><span></span><span id="table_name-5728"><a href="#table_name-5728"><span class="linenos">5728</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="n">Table</span> <span class="o">|</span> <span class="nb">str</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="nb">str</span><span class="p">:</span> +</span><span id="table_name-5729"><a href="#table_name-5729"><span class="linenos">5729</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-5730"><a href="#table_name-5730"><span class="linenos">5730</span></a> +</span><span id="table_name-5731"><a href="#table_name-5731"><span class="linenos">5731</span></a><span class="sd"> Args:</span> +</span><span id="table_name-5732"><a href="#table_name-5732"><span class="linenos">5732</span></a><span class="sd"> table: Table expression node or string.</span> +</span><span id="table_name-5733"><a href="#table_name-5733"><span class="linenos">5733</span></a><span class="sd"> dialect: The dialect to generate the table name for.</span> +</span><span id="table_name-5734"><a href="#table_name-5734"><span class="linenos">5734</span></a> +</span><span id="table_name-5735"><a href="#table_name-5735"><span class="linenos">5735</span></a><span class="sd"> Examples:</span> +</span><span id="table_name-5736"><a href="#table_name-5736"><span class="linenos">5736</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> +</span><span id="table_name-5737"><a href="#table_name-5737"><span class="linenos">5737</span></a><span class="sd"> >>> table_name(parse_one("select * from a.b.c").find(exp.Table))</span> +</span><span id="table_name-5738"><a href="#table_name-5738"><span class="linenos">5738</span></a><span class="sd"> 'a.b.c'</span> +</span><span id="table_name-5739"><a href="#table_name-5739"><span class="linenos">5739</span></a> +</span><span id="table_name-5740"><a href="#table_name-5740"><span class="linenos">5740</span></a><span class="sd"> Returns:</span> +</span><span id="table_name-5741"><a href="#table_name-5741"><span class="linenos">5741</span></a><span class="sd"> The table name.</span> +</span><span id="table_name-5742"><a href="#table_name-5742"><span class="linenos">5742</span></a><span class="sd"> """</span> +</span><span id="table_name-5743"><a href="#table_name-5743"><span class="linenos">5743</span></a> +</span><span id="table_name-5744"><a href="#table_name-5744"><span class="linenos">5744</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-5745"><a href="#table_name-5745"><span class="linenos">5745</span></a> -</span><span id="table_name-5746"><a href="#table_name-5746"><span class="linenos">5746</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-5747"><a href="#table_name-5747"><span class="linenos">5747</span></a> <span class="n">part</span><span class="o">.</span><span class="n">sql</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="k">if</span> <span class="ow">not</span> <span class="n">SAFE_IDENTIFIER_RE</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">part</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> <span class="k">else</span> <span class="n">part</span><span class="o">.</span><span class="n">name</span> -</span><span id="table_name-5748"><a href="#table_name-5748"><span class="linenos">5748</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="n">table</span><span class="o">.</span><span class="n">parts</span> -</span><span id="table_name-5749"><a href="#table_name-5749"><span class="linenos">5749</span></a> <span class="p">)</span> +</span><span id="table_name-5746"><a href="#table_name-5746"><span class="linenos">5746</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-5747"><a href="#table_name-5747"><span class="linenos">5747</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-5748"><a href="#table_name-5748"><span class="linenos">5748</span></a> +</span><span id="table_name-5749"><a href="#table_name-5749"><span class="linenos">5749</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-5750"><a href="#table_name-5750"><span class="linenos">5750</span></a> <span class="n">part</span><span class="o">.</span><span class="n">sql</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="k">if</span> <span class="ow">not</span> <span class="n">SAFE_IDENTIFIER_RE</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">part</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> <span class="k">else</span> <span class="n">part</span><span class="o">.</span><span class="n">name</span> +</span><span id="table_name-5751"><a href="#table_name-5751"><span class="linenos">5751</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="n">table</span><span class="o">.</span><span class="n">parts</span> +</span><span id="table_name-5752"><a href="#table_name-5752"><span class="linenos">5752</span></a> <span class="p">)</span> </span></pre></div> @@ -68530,34 +68657,34 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#replace_tables"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="replace_tables-5752"><a href="#replace_tables-5752"><span class="linenos">5752</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">E</span><span class="p">,</span> <span class="n">mapping</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="nb">str</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">E</span><span class="p">:</span> -</span><span id="replace_tables-5753"><a href="#replace_tables-5753"><span class="linenos">5753</span></a><span class="w"> </span><span class="sd">"""Replace all tables in expression according to the mapping.</span> -</span><span id="replace_tables-5754"><a href="#replace_tables-5754"><span class="linenos">5754</span></a> -</span><span id="replace_tables-5755"><a href="#replace_tables-5755"><span class="linenos">5755</span></a><span class="sd"> Args:</span> -</span><span id="replace_tables-5756"><a href="#replace_tables-5756"><span class="linenos">5756</span></a><span class="sd"> expression: expression node to be transformed and replaced.</span> -</span><span id="replace_tables-5757"><a href="#replace_tables-5757"><span class="linenos">5757</span></a><span class="sd"> mapping: mapping of table names.</span> -</span><span id="replace_tables-5758"><a href="#replace_tables-5758"><span class="linenos">5758</span></a><span class="sd"> copy: whether or not to copy the expression.</span> -</span><span id="replace_tables-5759"><a href="#replace_tables-5759"><span class="linenos">5759</span></a> -</span><span id="replace_tables-5760"><a href="#replace_tables-5760"><span class="linenos">5760</span></a><span class="sd"> Examples:</span> -</span><span id="replace_tables-5761"><a href="#replace_tables-5761"><span class="linenos">5761</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> -</span><span id="replace_tables-5762"><a href="#replace_tables-5762"><span class="linenos">5762</span></a><span class="sd"> >>> replace_tables(parse_one("select * from a.b"), {"a.b": "c"}).sql()</span> -</span><span id="replace_tables-5763"><a href="#replace_tables-5763"><span class="linenos">5763</span></a><span class="sd"> 'SELECT * FROM c'</span> -</span><span id="replace_tables-5764"><a href="#replace_tables-5764"><span class="linenos">5764</span></a> -</span><span id="replace_tables-5765"><a href="#replace_tables-5765"><span class="linenos">5765</span></a><span class="sd"> Returns:</span> -</span><span id="replace_tables-5766"><a href="#replace_tables-5766"><span class="linenos">5766</span></a><span class="sd"> The mapped expression.</span> -</span><span id="replace_tables-5767"><a href="#replace_tables-5767"><span class="linenos">5767</span></a><span class="sd"> """</span> -</span><span id="replace_tables-5768"><a href="#replace_tables-5768"><span class="linenos">5768</span></a> -</span><span id="replace_tables-5769"><a href="#replace_tables-5769"><span class="linenos">5769</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 class="n">Expression</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="replace_tables-5770"><a href="#replace_tables-5770"><span class="linenos">5770</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-5771"><a href="#replace_tables-5771"><span class="linenos">5771</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-5772"><a href="#replace_tables-5772"><span class="linenos">5772</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> -</span><span id="replace_tables-5773"><a href="#replace_tables-5773"><span class="linenos">5773</span></a> <span class="k">return</span> <span class="n">to_table</span><span class="p">(</span> -</span><span id="replace_tables-5774"><a href="#replace_tables-5774"><span class="linenos">5774</span></a> <span class="n">new_name</span><span class="p">,</span> -</span><span id="replace_tables-5775"><a href="#replace_tables-5775"><span class="linenos">5775</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-5776"><a href="#replace_tables-5776"><span class="linenos">5776</span></a> <span class="p">)</span> -</span><span id="replace_tables-5777"><a href="#replace_tables-5777"><span class="linenos">5777</span></a> <span class="k">return</span> <span class="n">node</span> -</span><span id="replace_tables-5778"><a href="#replace_tables-5778"><span class="linenos">5778</span></a> -</span><span id="replace_tables-5779"><a href="#replace_tables-5779"><span class="linenos">5779</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 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="replace_tables-5755"><a href="#replace_tables-5755"><span class="linenos">5755</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">E</span><span class="p">,</span> <span class="n">mapping</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="nb">str</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">E</span><span class="p">:</span> +</span><span id="replace_tables-5756"><a href="#replace_tables-5756"><span class="linenos">5756</span></a><span class="w"> </span><span class="sd">"""Replace all tables in expression according to the mapping.</span> +</span><span id="replace_tables-5757"><a href="#replace_tables-5757"><span class="linenos">5757</span></a> +</span><span id="replace_tables-5758"><a href="#replace_tables-5758"><span class="linenos">5758</span></a><span class="sd"> Args:</span> +</span><span id="replace_tables-5759"><a href="#replace_tables-5759"><span class="linenos">5759</span></a><span class="sd"> expression: expression node to be transformed and replaced.</span> +</span><span id="replace_tables-5760"><a href="#replace_tables-5760"><span class="linenos">5760</span></a><span class="sd"> mapping: mapping of table names.</span> +</span><span id="replace_tables-5761"><a href="#replace_tables-5761"><span class="linenos">5761</span></a><span class="sd"> copy: whether or not to copy the expression.</span> +</span><span id="replace_tables-5762"><a href="#replace_tables-5762"><span class="linenos">5762</span></a> +</span><span id="replace_tables-5763"><a href="#replace_tables-5763"><span class="linenos">5763</span></a><span class="sd"> Examples:</span> +</span><span id="replace_tables-5764"><a href="#replace_tables-5764"><span class="linenos">5764</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> +</span><span id="replace_tables-5765"><a href="#replace_tables-5765"><span class="linenos">5765</span></a><span class="sd"> >>> replace_tables(parse_one("select * from a.b"), {"a.b": "c"}).sql()</span> +</span><span id="replace_tables-5766"><a href="#replace_tables-5766"><span class="linenos">5766</span></a><span class="sd"> 'SELECT * FROM c'</span> +</span><span id="replace_tables-5767"><a href="#replace_tables-5767"><span class="linenos">5767</span></a> +</span><span id="replace_tables-5768"><a href="#replace_tables-5768"><span class="linenos">5768</span></a><span class="sd"> Returns:</span> +</span><span id="replace_tables-5769"><a href="#replace_tables-5769"><span class="linenos">5769</span></a><span class="sd"> The mapped expression.</span> +</span><span id="replace_tables-5770"><a href="#replace_tables-5770"><span class="linenos">5770</span></a><span class="sd"> """</span> +</span><span id="replace_tables-5771"><a href="#replace_tables-5771"><span class="linenos">5771</span></a> +</span><span id="replace_tables-5772"><a href="#replace_tables-5772"><span class="linenos">5772</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 class="n">Expression</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="replace_tables-5773"><a href="#replace_tables-5773"><span class="linenos">5773</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-5774"><a href="#replace_tables-5774"><span class="linenos">5774</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-5775"><a href="#replace_tables-5775"><span class="linenos">5775</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> +</span><span id="replace_tables-5776"><a href="#replace_tables-5776"><span class="linenos">5776</span></a> <span class="k">return</span> <span class="n">to_table</span><span class="p">(</span> +</span><span id="replace_tables-5777"><a href="#replace_tables-5777"><span class="linenos">5777</span></a> <span class="n">new_name</span><span class="p">,</span> +</span><span id="replace_tables-5778"><a href="#replace_tables-5778"><span class="linenos">5778</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-5779"><a href="#replace_tables-5779"><span class="linenos">5779</span></a> <span class="p">)</span> +</span><span id="replace_tables-5780"><a href="#replace_tables-5780"><span class="linenos">5780</span></a> <span class="k">return</span> <span class="n">node</span> +</span><span id="replace_tables-5781"><a href="#replace_tables-5781"><span class="linenos">5781</span></a> +</span><span id="replace_tables-5782"><a href="#replace_tables-5782"><span class="linenos">5782</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 class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> </span></pre></div> @@ -68602,40 +68729,40 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#replace_placeholders"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="replace_placeholders-5782"><a href="#replace_placeholders-5782"><span class="linenos">5782</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="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 class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="replace_placeholders-5783"><a href="#replace_placeholders-5783"><span class="linenos">5783</span></a><span class="w"> </span><span class="sd">"""Replace placeholders in an expression.</span> -</span><span id="replace_placeholders-5784"><a href="#replace_placeholders-5784"><span class="linenos">5784</span></a> -</span><span id="replace_placeholders-5785"><a href="#replace_placeholders-5785"><span class="linenos">5785</span></a><span class="sd"> Args:</span> -</span><span id="replace_placeholders-5786"><a href="#replace_placeholders-5786"><span class="linenos">5786</span></a><span class="sd"> expression: expression node to be transformed and replaced.</span> -</span><span id="replace_placeholders-5787"><a href="#replace_placeholders-5787"><span class="linenos">5787</span></a><span class="sd"> args: positional names that will substitute unnamed placeholders in the given order.</span> -</span><span id="replace_placeholders-5788"><a href="#replace_placeholders-5788"><span class="linenos">5788</span></a><span class="sd"> kwargs: keyword arguments that will substitute named placeholders.</span> -</span><span id="replace_placeholders-5789"><a href="#replace_placeholders-5789"><span class="linenos">5789</span></a> -</span><span id="replace_placeholders-5790"><a href="#replace_placeholders-5790"><span class="linenos">5790</span></a><span class="sd"> Examples:</span> -</span><span id="replace_placeholders-5791"><a href="#replace_placeholders-5791"><span class="linenos">5791</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> -</span><span id="replace_placeholders-5792"><a href="#replace_placeholders-5792"><span class="linenos">5792</span></a><span class="sd"> >>> replace_placeholders(</span> -</span><span id="replace_placeholders-5793"><a href="#replace_placeholders-5793"><span class="linenos">5793</span></a><span class="sd"> ... parse_one("select * from :tbl where ? = ?"),</span> -</span><span id="replace_placeholders-5794"><a href="#replace_placeholders-5794"><span class="linenos">5794</span></a><span class="sd"> ... exp.to_identifier("str_col"), "b", tbl=exp.to_identifier("foo")</span> -</span><span id="replace_placeholders-5795"><a href="#replace_placeholders-5795"><span class="linenos">5795</span></a><span class="sd"> ... ).sql()</span> -</span><span id="replace_placeholders-5796"><a href="#replace_placeholders-5796"><span class="linenos">5796</span></a><span class="sd"> "SELECT * FROM foo WHERE str_col = 'b'"</span> -</span><span id="replace_placeholders-5797"><a href="#replace_placeholders-5797"><span class="linenos">5797</span></a> -</span><span id="replace_placeholders-5798"><a href="#replace_placeholders-5798"><span class="linenos">5798</span></a><span class="sd"> Returns:</span> -</span><span id="replace_placeholders-5799"><a href="#replace_placeholders-5799"><span class="linenos">5799</span></a><span class="sd"> The mapped expression.</span> -</span><span id="replace_placeholders-5800"><a href="#replace_placeholders-5800"><span class="linenos">5800</span></a><span class="sd"> """</span> -</span><span id="replace_placeholders-5801"><a href="#replace_placeholders-5801"><span class="linenos">5801</span></a> -</span><span id="replace_placeholders-5802"><a href="#replace_placeholders-5802"><span class="linenos">5802</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">Expression</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 class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="replace_placeholders-5803"><a href="#replace_placeholders-5803"><span class="linenos">5803</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-5804"><a href="#replace_placeholders-5804"><span class="linenos">5804</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-5805"><a href="#replace_placeholders-5805"><span class="linenos">5805</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-5806"><a href="#replace_placeholders-5806"><span class="linenos">5806</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> -</span><span id="replace_placeholders-5807"><a href="#replace_placeholders-5807"><span class="linenos">5807</span></a> <span class="k">return</span> <span class="n">convert</span><span class="p">(</span><span class="n">new_name</span><span class="p">)</span> -</span><span id="replace_placeholders-5808"><a href="#replace_placeholders-5808"><span class="linenos">5808</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="replace_placeholders-5809"><a href="#replace_placeholders-5809"><span class="linenos">5809</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="replace_placeholders-5810"><a href="#replace_placeholders-5810"><span class="linenos">5810</span></a> <span class="k">return</span> <span class="n">convert</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-5811"><a href="#replace_placeholders-5811"><span class="linenos">5811</span></a> <span class="k">except</span> <span class="ne">StopIteration</span><span class="p">:</span> -</span><span id="replace_placeholders-5812"><a href="#replace_placeholders-5812"><span class="linenos">5812</span></a> <span class="k">pass</span> -</span><span id="replace_placeholders-5813"><a href="#replace_placeholders-5813"><span class="linenos">5813</span></a> <span class="k">return</span> <span class="n">node</span> -</span><span id="replace_placeholders-5814"><a href="#replace_placeholders-5814"><span class="linenos">5814</span></a> -</span><span id="replace_placeholders-5815"><a href="#replace_placeholders-5815"><span class="linenos">5815</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-5785"><a href="#replace_placeholders-5785"><span class="linenos">5785</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="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 class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="replace_placeholders-5786"><a href="#replace_placeholders-5786"><span class="linenos">5786</span></a><span class="w"> </span><span class="sd">"""Replace placeholders in an expression.</span> +</span><span id="replace_placeholders-5787"><a href="#replace_placeholders-5787"><span class="linenos">5787</span></a> +</span><span id="replace_placeholders-5788"><a href="#replace_placeholders-5788"><span class="linenos">5788</span></a><span class="sd"> Args:</span> +</span><span id="replace_placeholders-5789"><a href="#replace_placeholders-5789"><span class="linenos">5789</span></a><span class="sd"> expression: expression node to be transformed and replaced.</span> +</span><span id="replace_placeholders-5790"><a href="#replace_placeholders-5790"><span class="linenos">5790</span></a><span class="sd"> args: positional names that will substitute unnamed placeholders in the given order.</span> +</span><span id="replace_placeholders-5791"><a href="#replace_placeholders-5791"><span class="linenos">5791</span></a><span class="sd"> kwargs: keyword arguments that will substitute named placeholders.</span> +</span><span id="replace_placeholders-5792"><a href="#replace_placeholders-5792"><span class="linenos">5792</span></a> +</span><span id="replace_placeholders-5793"><a href="#replace_placeholders-5793"><span class="linenos">5793</span></a><span class="sd"> Examples:</span> +</span><span id="replace_placeholders-5794"><a href="#replace_placeholders-5794"><span class="linenos">5794</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> +</span><span id="replace_placeholders-5795"><a href="#replace_placeholders-5795"><span class="linenos">5795</span></a><span class="sd"> >>> replace_placeholders(</span> +</span><span id="replace_placeholders-5796"><a href="#replace_placeholders-5796"><span class="linenos">5796</span></a><span class="sd"> ... parse_one("select * from :tbl where ? = ?"),</span> +</span><span id="replace_placeholders-5797"><a href="#replace_placeholders-5797"><span class="linenos">5797</span></a><span class="sd"> ... exp.to_identifier("str_col"), "b", tbl=exp.to_identifier("foo")</span> +</span><span id="replace_placeholders-5798"><a href="#replace_placeholders-5798"><span class="linenos">5798</span></a><span class="sd"> ... ).sql()</span> +</span><span id="replace_placeholders-5799"><a href="#replace_placeholders-5799"><span class="linenos">5799</span></a><span class="sd"> "SELECT * FROM foo WHERE str_col = 'b'"</span> +</span><span id="replace_placeholders-5800"><a href="#replace_placeholders-5800"><span class="linenos">5800</span></a> +</span><span id="replace_placeholders-5801"><a href="#replace_placeholders-5801"><span class="linenos">5801</span></a><span class="sd"> Returns:</span> +</span><span id="replace_placeholders-5802"><a href="#replace_placeholders-5802"><span class="linenos">5802</span></a><span class="sd"> The mapped expression.</span> +</span><span id="replace_placeholders-5803"><a href="#replace_placeholders-5803"><span class="linenos">5803</span></a><span class="sd"> """</span> +</span><span id="replace_placeholders-5804"><a href="#replace_placeholders-5804"><span class="linenos">5804</span></a> +</span><span id="replace_placeholders-5805"><a href="#replace_placeholders-5805"><span class="linenos">5805</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">Expression</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 class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="replace_placeholders-5806"><a href="#replace_placeholders-5806"><span class="linenos">5806</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-5807"><a href="#replace_placeholders-5807"><span class="linenos">5807</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-5808"><a href="#replace_placeholders-5808"><span class="linenos">5808</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-5809"><a href="#replace_placeholders-5809"><span class="linenos">5809</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> +</span><span id="replace_placeholders-5810"><a href="#replace_placeholders-5810"><span class="linenos">5810</span></a> <span class="k">return</span> <span class="n">convert</span><span class="p">(</span><span class="n">new_name</span><span class="p">)</span> +</span><span id="replace_placeholders-5811"><a href="#replace_placeholders-5811"><span class="linenos">5811</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="replace_placeholders-5812"><a href="#replace_placeholders-5812"><span class="linenos">5812</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="replace_placeholders-5813"><a href="#replace_placeholders-5813"><span class="linenos">5813</span></a> <span class="k">return</span> <span class="n">convert</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-5814"><a href="#replace_placeholders-5814"><span class="linenos">5814</span></a> <span class="k">except</span> <span class="ne">StopIteration</span><span class="p">:</span> +</span><span id="replace_placeholders-5815"><a href="#replace_placeholders-5815"><span class="linenos">5815</span></a> <span class="k">pass</span> +</span><span id="replace_placeholders-5816"><a href="#replace_placeholders-5816"><span class="linenos">5816</span></a> <span class="k">return</span> <span class="n">node</span> +</span><span id="replace_placeholders-5817"><a href="#replace_placeholders-5817"><span class="linenos">5817</span></a> +</span><span id="replace_placeholders-5818"><a href="#replace_placeholders-5818"><span class="linenos">5818</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> @@ -68683,39 +68810,39 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#expand"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="expand-5818"><a href="#expand-5818"><span class="linenos">5818</span></a><span class="k">def</span> <span class="nf">expand</span><span class="p">(</span> -</span><span id="expand-5819"><a href="#expand-5819"><span class="linenos">5819</span></a> <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="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="expand-5820"><a href="#expand-5820"><span class="linenos">5820</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="expand-5821"><a href="#expand-5821"><span class="linenos">5821</span></a><span class="w"> </span><span class="sd">"""Transforms an expression by expanding all referenced sources into subqueries.</span> -</span><span id="expand-5822"><a href="#expand-5822"><span class="linenos">5822</span></a> -</span><span id="expand-5823"><a href="#expand-5823"><span class="linenos">5823</span></a><span class="sd"> Examples:</span> -</span><span id="expand-5824"><a href="#expand-5824"><span class="linenos">5824</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="expand-5825"><a href="#expand-5825"><span class="linenos">5825</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-5826"><a href="#expand-5826"><span class="linenos">5826</span></a><span class="sd"> 'SELECT * FROM (SELECT * FROM y) AS z /* source: x */'</span> -</span><span id="expand-5827"><a href="#expand-5827"><span class="linenos">5827</span></a> -</span><span id="expand-5828"><a href="#expand-5828"><span class="linenos">5828</span></a><span class="sd"> >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y"), "y": parse_one("select * from z")}).sql()</span> -</span><span id="expand-5829"><a href="#expand-5829"><span class="linenos">5829</span></a><span class="sd"> 'SELECT * FROM (SELECT * FROM (SELECT * FROM z) AS y /* source: y */) AS z /* source: x */'</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="expand-5821"><a href="#expand-5821"><span class="linenos">5821</span></a><span class="k">def</span> <span class="nf">expand</span><span class="p">(</span> +</span><span id="expand-5822"><a href="#expand-5822"><span class="linenos">5822</span></a> <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="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="expand-5823"><a href="#expand-5823"><span class="linenos">5823</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="expand-5824"><a href="#expand-5824"><span class="linenos">5824</span></a><span class="w"> </span><span class="sd">"""Transforms an expression by expanding all referenced sources into subqueries.</span> +</span><span id="expand-5825"><a href="#expand-5825"><span class="linenos">5825</span></a> +</span><span id="expand-5826"><a href="#expand-5826"><span class="linenos">5826</span></a><span class="sd"> Examples:</span> +</span><span id="expand-5827"><a href="#expand-5827"><span class="linenos">5827</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="expand-5828"><a href="#expand-5828"><span class="linenos">5828</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-5829"><a href="#expand-5829"><span class="linenos">5829</span></a><span class="sd"> 'SELECT * FROM (SELECT * FROM y) AS z /* source: x */'</span> </span><span id="expand-5830"><a href="#expand-5830"><span class="linenos">5830</span></a> -</span><span id="expand-5831"><a href="#expand-5831"><span class="linenos">5831</span></a><span class="sd"> Args:</span> -</span><span id="expand-5832"><a href="#expand-5832"><span class="linenos">5832</span></a><span class="sd"> expression: The expression to expand.</span> -</span><span id="expand-5833"><a href="#expand-5833"><span class="linenos">5833</span></a><span class="sd"> sources: A dictionary of name to Subqueryables.</span> -</span><span id="expand-5834"><a href="#expand-5834"><span class="linenos">5834</span></a><span class="sd"> copy: Whether or not to copy the expression during transformation. Defaults to True.</span> -</span><span id="expand-5835"><a href="#expand-5835"><span class="linenos">5835</span></a> -</span><span id="expand-5836"><a href="#expand-5836"><span class="linenos">5836</span></a><span class="sd"> Returns:</span> -</span><span id="expand-5837"><a href="#expand-5837"><span class="linenos">5837</span></a><span class="sd"> The transformed expression.</span> -</span><span id="expand-5838"><a href="#expand-5838"><span class="linenos">5838</span></a><span class="sd"> """</span> -</span><span id="expand-5839"><a href="#expand-5839"><span class="linenos">5839</span></a> -</span><span id="expand-5840"><a href="#expand-5840"><span class="linenos">5840</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-5841"><a href="#expand-5841"><span class="linenos">5841</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-5842"><a href="#expand-5842"><span class="linenos">5842</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-5843"><a href="#expand-5843"><span class="linenos">5843</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-5844"><a href="#expand-5844"><span class="linenos">5844</span></a> <span class="k">if</span> <span class="n">source</span><span class="p">:</span> -</span><span id="expand-5845"><a href="#expand-5845"><span class="linenos">5845</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-5846"><a href="#expand-5846"><span class="linenos">5846</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-5847"><a href="#expand-5847"><span class="linenos">5847</span></a> <span class="k">return</span> <span class="n">subquery</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="kc">False</span><span class="p">)</span> -</span><span id="expand-5848"><a href="#expand-5848"><span class="linenos">5848</span></a> <span class="k">return</span> <span class="n">node</span> -</span><span id="expand-5849"><a href="#expand-5849"><span class="linenos">5849</span></a> -</span><span id="expand-5850"><a href="#expand-5850"><span class="linenos">5850</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="expand-5831"><a href="#expand-5831"><span class="linenos">5831</span></a><span class="sd"> >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y"), "y": parse_one("select * from z")}).sql()</span> +</span><span id="expand-5832"><a href="#expand-5832"><span class="linenos">5832</span></a><span class="sd"> 'SELECT * FROM (SELECT * FROM (SELECT * FROM z) AS y /* source: y */) AS z /* source: x */'</span> +</span><span id="expand-5833"><a href="#expand-5833"><span class="linenos">5833</span></a> +</span><span id="expand-5834"><a href="#expand-5834"><span class="linenos">5834</span></a><span class="sd"> Args:</span> +</span><span id="expand-5835"><a href="#expand-5835"><span class="linenos">5835</span></a><span class="sd"> expression: The expression to expand.</span> +</span><span id="expand-5836"><a href="#expand-5836"><span class="linenos">5836</span></a><span class="sd"> sources: A dictionary of name to Subqueryables.</span> +</span><span id="expand-5837"><a href="#expand-5837"><span class="linenos">5837</span></a><span class="sd"> copy: Whether or not to copy the expression during transformation. Defaults to True.</span> +</span><span id="expand-5838"><a href="#expand-5838"><span class="linenos">5838</span></a> +</span><span id="expand-5839"><a href="#expand-5839"><span class="linenos">5839</span></a><span class="sd"> Returns:</span> +</span><span id="expand-5840"><a href="#expand-5840"><span class="linenos">5840</span></a><span class="sd"> The transformed expression.</span> +</span><span id="expand-5841"><a href="#expand-5841"><span class="linenos">5841</span></a><span class="sd"> """</span> +</span><span id="expand-5842"><a href="#expand-5842"><span class="linenos">5842</span></a> +</span><span id="expand-5843"><a href="#expand-5843"><span class="linenos">5843</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-5844"><a href="#expand-5844"><span class="linenos">5844</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-5845"><a href="#expand-5845"><span class="linenos">5845</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-5846"><a href="#expand-5846"><span class="linenos">5846</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-5847"><a href="#expand-5847"><span class="linenos">5847</span></a> <span class="k">if</span> <span class="n">source</span><span class="p">:</span> +</span><span id="expand-5848"><a href="#expand-5848"><span class="linenos">5848</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-5849"><a href="#expand-5849"><span class="linenos">5849</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-5850"><a href="#expand-5850"><span class="linenos">5850</span></a> <span class="k">return</span> <span class="n">subquery</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="kc">False</span><span class="p">)</span> +</span><span id="expand-5851"><a href="#expand-5851"><span class="linenos">5851</span></a> <span class="k">return</span> <span class="n">node</span> +</span><span id="expand-5852"><a href="#expand-5852"><span class="linenos">5852</span></a> +</span><span id="expand-5853"><a href="#expand-5853"><span class="linenos">5853</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> @@ -68766,51 +68893,51 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#func"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="func-5853"><a href="#func-5853"><span class="linenos">5853</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-5854"><a href="#func-5854"><span class="linenos">5854</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="func-5855"><a href="#func-5855"><span class="linenos">5855</span></a><span class="sd"> Returns a Func expression.</span> -</span><span id="func-5856"><a href="#func-5856"><span class="linenos">5856</span></a> -</span><span id="func-5857"><a href="#func-5857"><span class="linenos">5857</span></a><span class="sd"> Examples:</span> -</span><span id="func-5858"><a href="#func-5858"><span class="linenos">5858</span></a><span class="sd"> >>> func("abs", 5).sql()</span> -</span><span id="func-5859"><a href="#func-5859"><span class="linenos">5859</span></a><span class="sd"> 'ABS(5)'</span> -</span><span id="func-5860"><a href="#func-5860"><span class="linenos">5860</span></a> -</span><span id="func-5861"><a href="#func-5861"><span class="linenos">5861</span></a><span class="sd"> >>> func("cast", this=5, to=DataType.build("DOUBLE")).sql()</span> -</span><span id="func-5862"><a href="#func-5862"><span class="linenos">5862</span></a><span class="sd"> 'CAST(5 AS DOUBLE)'</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="func-5856"><a href="#func-5856"><span class="linenos">5856</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-5857"><a href="#func-5857"><span class="linenos">5857</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="func-5858"><a href="#func-5858"><span class="linenos">5858</span></a><span class="sd"> Returns a Func expression.</span> +</span><span id="func-5859"><a href="#func-5859"><span class="linenos">5859</span></a> +</span><span id="func-5860"><a href="#func-5860"><span class="linenos">5860</span></a><span class="sd"> Examples:</span> +</span><span id="func-5861"><a href="#func-5861"><span class="linenos">5861</span></a><span class="sd"> >>> func("abs", 5).sql()</span> +</span><span id="func-5862"><a href="#func-5862"><span class="linenos">5862</span></a><span class="sd"> 'ABS(5)'</span> </span><span id="func-5863"><a href="#func-5863"><span class="linenos">5863</span></a> -</span><span id="func-5864"><a href="#func-5864"><span class="linenos">5864</span></a><span class="sd"> Args:</span> -</span><span id="func-5865"><a href="#func-5865"><span class="linenos">5865</span></a><span class="sd"> name: the name of the function to build.</span> -</span><span id="func-5866"><a href="#func-5866"><span class="linenos">5866</span></a><span class="sd"> args: the args used to instantiate the function of interest.</span> -</span><span id="func-5867"><a href="#func-5867"><span class="linenos">5867</span></a><span class="sd"> dialect: the source dialect.</span> -</span><span id="func-5868"><a href="#func-5868"><span class="linenos">5868</span></a><span class="sd"> kwargs: the kwargs used to instantiate the function of interest.</span> -</span><span id="func-5869"><a href="#func-5869"><span class="linenos">5869</span></a> -</span><span id="func-5870"><a href="#func-5870"><span class="linenos">5870</span></a><span class="sd"> Note:</span> -</span><span id="func-5871"><a href="#func-5871"><span class="linenos">5871</span></a><span class="sd"> The arguments `args` and `kwargs` are mutually exclusive.</span> +</span><span id="func-5864"><a href="#func-5864"><span class="linenos">5864</span></a><span class="sd"> >>> func("cast", this=5, to=DataType.build("DOUBLE")).sql()</span> +</span><span id="func-5865"><a href="#func-5865"><span class="linenos">5865</span></a><span class="sd"> 'CAST(5 AS DOUBLE)'</span> +</span><span id="func-5866"><a href="#func-5866"><span class="linenos">5866</span></a> +</span><span id="func-5867"><a href="#func-5867"><span class="linenos">5867</span></a><span class="sd"> Args:</span> +</span><span id="func-5868"><a href="#func-5868"><span class="linenos">5868</span></a><span class="sd"> name: the name of the function to build.</span> +</span><span id="func-5869"><a href="#func-5869"><span class="linenos">5869</span></a><span class="sd"> args: the args used to instantiate the function of interest.</span> +</span><span id="func-5870"><a href="#func-5870"><span class="linenos">5870</span></a><span class="sd"> dialect: the source dialect.</span> +</span><span id="func-5871"><a href="#func-5871"><span class="linenos">5871</span></a><span class="sd"> kwargs: the kwargs used to instantiate the function of interest.</span> </span><span id="func-5872"><a href="#func-5872"><span class="linenos">5872</span></a> -</span><span id="func-5873"><a href="#func-5873"><span class="linenos">5873</span></a><span class="sd"> Returns:</span> -</span><span id="func-5874"><a href="#func-5874"><span class="linenos">5874</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-5875"><a href="#func-5875"><span class="linenos">5875</span></a><span class="sd"> correspond to an existing `sqlglot.expressions.Func` class.</span> -</span><span id="func-5876"><a href="#func-5876"><span class="linenos">5876</span></a><span class="sd"> """</span> -</span><span id="func-5877"><a href="#func-5877"><span class="linenos">5877</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-5878"><a href="#func-5878"><span class="linenos">5878</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-5879"><a href="#func-5879"><span class="linenos">5879</span></a> -</span><span id="func-5880"><a href="#func-5880"><span class="linenos">5880</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-5881"><a href="#func-5881"><span class="linenos">5881</span></a> -</span><span id="func-5882"><a href="#func-5882"><span class="linenos">5882</span></a> <span class="n">converted</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="n">Expression</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">arg</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="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-5883"><a href="#func-5883"><span class="linenos">5883</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">maybe_parse</span><span class="p">(</span><span class="n">value</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="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-5873"><a href="#func-5873"><span class="linenos">5873</span></a><span class="sd"> Note:</span> +</span><span id="func-5874"><a href="#func-5874"><span class="linenos">5874</span></a><span class="sd"> The arguments `args` and `kwargs` are mutually exclusive.</span> +</span><span id="func-5875"><a href="#func-5875"><span class="linenos">5875</span></a> +</span><span id="func-5876"><a href="#func-5876"><span class="linenos">5876</span></a><span class="sd"> Returns:</span> +</span><span id="func-5877"><a href="#func-5877"><span class="linenos">5877</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-5878"><a href="#func-5878"><span class="linenos">5878</span></a><span class="sd"> correspond to an existing `sqlglot.expressions.Func` class.</span> +</span><span id="func-5879"><a href="#func-5879"><span class="linenos">5879</span></a><span class="sd"> """</span> +</span><span id="func-5880"><a href="#func-5880"><span class="linenos">5880</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-5881"><a href="#func-5881"><span class="linenos">5881</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-5882"><a href="#func-5882"><span class="linenos">5882</span></a> +</span><span id="func-5883"><a href="#func-5883"><span class="linenos">5883</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-5884"><a href="#func-5884"><span class="linenos">5884</span></a> -</span><span id="func-5885"><a href="#func-5885"><span class="linenos">5885</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-5886"><a href="#func-5886"><span class="linenos">5886</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-5885"><a href="#func-5885"><span class="linenos">5885</span></a> <span class="n">converted</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="n">Expression</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">arg</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="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-5886"><a href="#func-5886"><span class="linenos">5886</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">maybe_parse</span><span class="p">(</span><span class="n">value</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="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-5887"><a href="#func-5887"><span class="linenos">5887</span></a> -</span><span id="func-5888"><a href="#func-5888"><span class="linenos">5888</span></a> <span class="k">if</span> <span class="n">from_args_list</span><span class="p">:</span> -</span><span id="func-5889"><a href="#func-5889"><span class="linenos">5889</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">converted</span><span class="p">)</span> <span class="k">if</span> <span class="n">converted</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-5890"><a href="#func-5890"><span class="linenos">5890</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="func-5891"><a href="#func-5891"><span class="linenos">5891</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">converted</span><span class="p">}</span> -</span><span id="func-5892"><a href="#func-5892"><span class="linenos">5892</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-5893"><a href="#func-5893"><span class="linenos">5893</span></a> -</span><span id="func-5894"><a href="#func-5894"><span class="linenos">5894</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">converted</span><span class="p">):</span> -</span><span id="func-5895"><a href="#func-5895"><span class="linenos">5895</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-5888"><a href="#func-5888"><span class="linenos">5888</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-5889"><a href="#func-5889"><span class="linenos">5889</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-5890"><a href="#func-5890"><span class="linenos">5890</span></a> +</span><span id="func-5891"><a href="#func-5891"><span class="linenos">5891</span></a> <span class="k">if</span> <span class="n">from_args_list</span><span class="p">:</span> +</span><span id="func-5892"><a href="#func-5892"><span class="linenos">5892</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">converted</span><span class="p">)</span> <span class="k">if</span> <span class="n">converted</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-5893"><a href="#func-5893"><span class="linenos">5893</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="func-5894"><a href="#func-5894"><span class="linenos">5894</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">converted</span><span class="p">}</span> +</span><span id="func-5895"><a href="#func-5895"><span class="linenos">5895</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-5896"><a href="#func-5896"><span class="linenos">5896</span></a> -</span><span id="func-5897"><a href="#func-5897"><span class="linenos">5897</span></a> <span class="k">return</span> <span class="n">function</span> +</span><span id="func-5897"><a href="#func-5897"><span class="linenos">5897</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">converted</span><span class="p">):</span> +</span><span id="func-5898"><a href="#func-5898"><span class="linenos">5898</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-5899"><a href="#func-5899"><span class="linenos">5899</span></a> +</span><span id="func-5900"><a href="#func-5900"><span class="linenos">5900</span></a> <span class="k">return</span> <span class="n">function</span> </span></pre></div> @@ -68868,11 +68995,11 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#true"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="true-5900"><a href="#true-5900"><span class="linenos">5900</span></a><span class="k">def</span> <span class="nf">true</span><span class="p">()</span> <span class="o">-></span> <span class="n">Boolean</span><span class="p">:</span> -</span><span id="true-5901"><a href="#true-5901"><span class="linenos">5901</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="true-5902"><a href="#true-5902"><span class="linenos">5902</span></a><span class="sd"> Returns a true Boolean expression.</span> -</span><span id="true-5903"><a href="#true-5903"><span class="linenos">5903</span></a><span class="sd"> """</span> -</span><span id="true-5904"><a href="#true-5904"><span class="linenos">5904</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-5903"><a href="#true-5903"><span class="linenos">5903</span></a><span class="k">def</span> <span class="nf">true</span><span class="p">()</span> <span class="o">-></span> <span class="n">Boolean</span><span class="p">:</span> +</span><span id="true-5904"><a href="#true-5904"><span class="linenos">5904</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="true-5905"><a href="#true-5905"><span class="linenos">5905</span></a><span class="sd"> Returns a true Boolean expression.</span> +</span><span id="true-5906"><a href="#true-5906"><span class="linenos">5906</span></a><span class="sd"> """</span> +</span><span id="true-5907"><a href="#true-5907"><span class="linenos">5907</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> @@ -68892,11 +69019,11 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#false"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="false-5907"><a href="#false-5907"><span class="linenos">5907</span></a><span class="k">def</span> <span class="nf">false</span><span class="p">()</span> <span class="o">-></span> <span class="n">Boolean</span><span class="p">:</span> -</span><span id="false-5908"><a href="#false-5908"><span class="linenos">5908</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="false-5909"><a href="#false-5909"><span class="linenos">5909</span></a><span class="sd"> Returns a false Boolean expression.</span> -</span><span id="false-5910"><a href="#false-5910"><span class="linenos">5910</span></a><span class="sd"> """</span> -</span><span id="false-5911"><a href="#false-5911"><span class="linenos">5911</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-5910"><a href="#false-5910"><span class="linenos">5910</span></a><span class="k">def</span> <span class="nf">false</span><span class="p">()</span> <span class="o">-></span> <span class="n">Boolean</span><span class="p">:</span> +</span><span id="false-5911"><a href="#false-5911"><span class="linenos">5911</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="false-5912"><a href="#false-5912"><span class="linenos">5912</span></a><span class="sd"> Returns a false Boolean expression.</span> +</span><span id="false-5913"><a href="#false-5913"><span class="linenos">5913</span></a><span class="sd"> """</span> +</span><span id="false-5914"><a href="#false-5914"><span class="linenos">5914</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> @@ -68916,11 +69043,11 @@ If either are provided then an alias is also required.</li> </div> <a class="headerlink" href="#null"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="null-5914"><a href="#null-5914"><span class="linenos">5914</span></a><span class="k">def</span> <span class="nf">null</span><span class="p">()</span> <span class="o">-></span> <span class="n">Null</span><span class="p">:</span> -</span><span id="null-5915"><a href="#null-5915"><span class="linenos">5915</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="null-5916"><a href="#null-5916"><span class="linenos">5916</span></a><span class="sd"> Returns a Null expression.</span> -</span><span id="null-5917"><a href="#null-5917"><span class="linenos">5917</span></a><span class="sd"> """</span> -</span><span id="null-5918"><a href="#null-5918"><span class="linenos">5918</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-5917"><a href="#null-5917"><span class="linenos">5917</span></a><span class="k">def</span> <span class="nf">null</span><span class="p">()</span> <span class="o">-></span> <span class="n">Null</span><span class="p">:</span> +</span><span id="null-5918"><a href="#null-5918"><span class="linenos">5918</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="null-5919"><a href="#null-5919"><span class="linenos">5919</span></a><span class="sd"> Returns a Null expression.</span> +</span><span id="null-5920"><a href="#null-5920"><span class="linenos">5920</span></a><span class="sd"> """</span> +</span><span id="null-5921"><a href="#null-5921"><span class="linenos">5921</span></a> <span class="k">return</span> <span class="n">Null</span><span class="p">()</span> </span></pre></div> |