sqlglotc 30.2.1__tar.gz → 30.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. {sqlglotc-30.2.1/sqlglotc.egg-info → sqlglotc-30.3.0}/PKG-INFO +2 -2
  2. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/pyproject.toml +2 -2
  3. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/errors.py +10 -10
  4. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/executor/table.py +4 -4
  5. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/array.py +5 -6
  6. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/builders.py +25 -27
  7. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/core.py +174 -128
  8. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/ddl.py +7 -7
  9. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/dml.py +8 -8
  10. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/functions.py +35 -0
  11. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/properties.py +10 -5
  12. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/query.py +48 -50
  13. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/string.py +2 -2
  14. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generator.py +108 -69
  15. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/athena.py +7 -7
  16. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/bigquery.py +2 -2
  17. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/clickhouse.py +5 -4
  18. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/databricks.py +1 -2
  19. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/dremio.py +1 -1
  20. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/drill.py +1 -2
  21. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/druid.py +1 -2
  22. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/duckdb.py +84 -40
  23. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/exasol.py +1 -1
  24. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/hive.py +7 -4
  25. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/mysql.py +8 -7
  26. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/oracle.py +1 -2
  27. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/postgres.py +3 -3
  28. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/presto.py +6 -6
  29. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/redshift.py +2 -3
  30. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/singlestore.py +2 -2
  31. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/snowflake.py +36 -20
  32. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/spark2.py +1 -2
  33. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/sqlite.py +3 -3
  34. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/starrocks.py +1 -2
  35. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/tableau.py +1 -2
  36. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/teradata.py +5 -4
  37. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/tsql.py +5 -5
  38. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/helper.py +7 -7
  39. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/optimizer/annotate_types.py +27 -32
  40. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/optimizer/isolate_table_selects.py +1 -1
  41. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/optimizer/qualify.py +6 -6
  42. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/optimizer/qualify_columns.py +23 -25
  43. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/optimizer/qualify_tables.py +8 -8
  44. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/optimizer/resolver.py +14 -14
  45. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/optimizer/scope.py +70 -70
  46. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/optimizer/simplify.py +84 -59
  47. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parser.py +424 -429
  48. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/athena.py +6 -6
  49. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/bigquery.py +87 -32
  50. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/clickhouse.py +38 -40
  51. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/doris.py +3 -4
  52. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/dremio.py +4 -4
  53. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/duckdb.py +16 -16
  54. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/exasol.py +3 -4
  55. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/hive.py +19 -11
  56. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/materialize.py +1 -2
  57. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/mysql.py +10 -10
  58. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/oracle.py +8 -8
  59. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/postgres.py +9 -9
  60. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/presto.py +3 -4
  61. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/prql.py +14 -16
  62. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/redshift.py +5 -5
  63. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/risingwave.py +5 -6
  64. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/singlestore.py +2 -5
  65. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/snowflake.py +89 -55
  66. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/spark.py +4 -4
  67. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/spark2.py +3 -3
  68. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/sqlite.py +19 -1
  69. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/starrocks.py +2 -3
  70. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/teradata.py +4 -4
  71. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/trino.py +1 -2
  72. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/tsql.py +35 -37
  73. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/schema.py +85 -73
  74. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/serde.py +7 -9
  75. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/time.py +1 -1
  76. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/tokenizer_core.py +29 -29
  77. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/trie.py +1 -1
  78. {sqlglotc-30.2.1 → sqlglotc-30.3.0/sqlglotc.egg-info}/PKG-INFO +2 -2
  79. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglotc.egg-info/requires.txt +1 -1
  80. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/MANIFEST.in +0 -0
  81. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/setup.cfg +0 -0
  82. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/setup.py +0 -0
  83. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/aggregate.py +0 -0
  84. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/constraints.py +0 -0
  85. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/datatypes.py +0 -0
  86. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/json.py +0 -0
  87. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/math.py +0 -0
  88. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/expressions/temporal.py +0 -0
  89. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/doris.py +0 -0
  90. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/dune.py +0 -0
  91. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/fabric.py +0 -0
  92. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/materialize.py +0 -0
  93. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/prql.py +0 -0
  94. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/risingwave.py +0 -0
  95. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/solr.py +0 -0
  96. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/spark.py +0 -0
  97. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/generators/trino.py +0 -0
  98. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/optimizer/normalize_identifiers.py +0 -0
  99. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/base.py +0 -0
  100. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/databricks.py +0 -0
  101. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/drill.py +0 -0
  102. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/druid.py +0 -0
  103. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/dune.py +0 -0
  104. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/fabric.py +0 -0
  105. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/solr.py +0 -0
  106. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglot/parsers/tableau.py +0 -0
  107. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglotc.egg-info/SOURCES.txt +0 -0
  108. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglotc.egg-info/dependency_links.txt +0 -0
  109. {sqlglotc-30.2.1 → sqlglotc-30.3.0}/sqlglotc.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlglotc
3
- Version: 30.2.1
3
+ Version: 30.3.0
4
4
  Summary: mypyc-compiled extensions for sqlglot
5
5
  Author-email: Toby Mao <toby.mao@gmail.com>
6
6
  License-Expression: MIT
@@ -10,4 +10,4 @@ Requires-Python: >=3.9
10
10
  Provides-Extra: dev
11
11
  Requires-Dist: setuptools>=61.0; extra == "dev"
12
12
  Requires-Dist: setuptools_scm; extra == "dev"
13
- Requires-Dist: sqlglot-mypy>=1.19.1.post1; extra == "dev"
13
+ Requires-Dist: sqlglot-mypy; extra == "dev"
@@ -7,14 +7,14 @@ license = "MIT"
7
7
  requires-python = ">= 3.9"
8
8
 
9
9
  [project.optional-dependencies]
10
- dev = ["setuptools >= 61.0", "setuptools_scm", "sqlglot-mypy>=1.19.1.post1"]
10
+ dev = ["setuptools >= 61.0", "setuptools_scm", "sqlglot-mypy"]
11
11
 
12
12
  [project.urls]
13
13
  Homepage = "https://sqlglot.com/"
14
14
  Repository = "https://github.com/tobymao/sqlglot"
15
15
 
16
16
  [build-system]
17
- requires = ["setuptools >= 61.0", "setuptools_scm", "sqlglot-mypy>=1.19.1.post1", "types-python-dateutil", "sqlglot"]
17
+ requires = ["setuptools >= 61.0", "setuptools_scm", "sqlglot-mypy", "types-python-dateutil", "sqlglot"]
18
18
  build-backend = "setuptools.build_meta"
19
19
 
20
20
  [tool.setuptools]
@@ -38,7 +38,7 @@ class ParseError(SqlglotError):
38
38
  def __init__(
39
39
  self,
40
40
  message: str,
41
- errors: t.Optional[t.List[t.Dict[str, t.Any]]] = None,
41
+ errors: list[dict[str, t.Any]] | None = None,
42
42
  ):
43
43
  super().__init__(message)
44
44
  self.errors = errors or []
@@ -47,13 +47,13 @@ class ParseError(SqlglotError):
47
47
  def new(
48
48
  cls,
49
49
  message: str,
50
- description: t.Optional[str] = None,
51
- line: t.Optional[int] = None,
52
- col: t.Optional[int] = None,
53
- start_context: t.Optional[str] = None,
54
- highlight: t.Optional[str] = None,
55
- end_context: t.Optional[str] = None,
56
- into_expression: t.Optional[str] = None,
50
+ description: str | None = None,
51
+ line: int | None = None,
52
+ col: int | None = None,
53
+ start_context: str | None = None,
54
+ highlight: str | None = None,
55
+ end_context: str | None = None,
56
+ into_expression: str | None = None,
57
57
  ) -> ParseError:
58
58
  return cls(
59
59
  message,
@@ -89,9 +89,9 @@ class ExecuteError(SqlglotError):
89
89
 
90
90
  def highlight_sql(
91
91
  sql: str,
92
- positions: t.List[t.Tuple[int, int]],
92
+ positions: list[tuple[int, int]],
93
93
  context_length: int = ERROR_MESSAGE_CONTEXT_DEFAULT,
94
- ) -> t.Tuple[str, str, str, str]:
94
+ ) -> tuple[str, str, str, str]:
95
95
  """
96
96
  Highlight a SQL string using ANSI codes at the given positions.
97
97
 
@@ -12,7 +12,7 @@ class Table:
12
12
  self,
13
13
  columns: t.Any = None,
14
14
  rows: t.Any = None,
15
- column_range: t.Optional[range] = None,
15
+ column_range: range | None = None,
16
16
  ) -> None:
17
17
  self.columns: t.Any = tuple(columns) if columns is not None else ()
18
18
  self.column_range = column_range
@@ -37,7 +37,7 @@ class Table:
37
37
  def pop(self) -> None:
38
38
  self.rows.pop()
39
39
 
40
- def to_pylist(self) -> t.List:
40
+ def to_pylist(self) -> list:
41
41
  return [dict(zip(self.columns, row)) for row in self.rows]
42
42
 
43
43
  @property
@@ -119,11 +119,11 @@ class Tables(AbstractMappingSchema):
119
119
  pass
120
120
 
121
121
 
122
- def ensure_tables(d: t.Optional[t.Dict], dialect: DialectType = None) -> Tables:
122
+ def ensure_tables(d: dict | None, dialect: DialectType = None) -> Tables:
123
123
  return Tables(_ensure_tables(d, dialect=dialect))
124
124
 
125
125
 
126
- def _ensure_tables(d: t.Optional[t.Dict], dialect: DialectType = None) -> t.Dict:
126
+ def _ensure_tables(d: dict | None, dialect: DialectType = None) -> dict:
127
127
  if not d:
128
128
  return {}
129
129
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- import typing as t
6
5
 
7
6
  from sqlglot.expressions.core import (
8
7
  Expression,
@@ -262,7 +261,7 @@ class Unnest(Expression, Func, UDTF):
262
261
  }
263
262
 
264
263
  @property
265
- def selects(self) -> t.List[Expr]:
264
+ def selects(self) -> list[Expr]:
266
265
  columns = super().selects
267
266
  offset = self.args.get("offset")
268
267
  if offset:
@@ -277,12 +276,12 @@ class Map(Expression, Func):
277
276
  arg_types = {"keys": False, "values": False}
278
277
 
279
278
  @property
280
- def keys(self) -> t.List[Expr]:
279
+ def keys(self) -> list[Expr]:
281
280
  keys = self.args.get("keys")
282
281
  return keys.expressions if keys else []
283
282
 
284
283
  @property
285
- def values(self) -> t.List[Expr]:
284
+ def values(self) -> list[Expr]:
286
285
  values = self.args.get("values")
287
286
  return values.expressions if values else []
288
287
 
@@ -334,11 +333,11 @@ class VarMap(Expression, Func):
334
333
  is_var_len_args = True
335
334
 
336
335
  @property
337
- def keys(self) -> t.List[Expr]:
336
+ def keys(self) -> list[Expr]:
338
337
  return self.args["keys"].expressions
339
338
 
340
339
  @property
341
- def values(self) -> t.List[Expr]:
340
+ def values(self) -> list[Expr]:
342
341
  return self.args["values"].expressions
343
342
 
344
343
 
@@ -55,12 +55,10 @@ if t.TYPE_CHECKING:
55
55
  from sqlglot.dialects.dialect import DialectType
56
56
  from sqlglot.expressions.core import ExpOrStr, Func
57
57
  from sqlglot.expressions.datatypes import DATA_TYPE
58
- from sqlglot._typing import ParserArgs, ParserNoDialectArgs, E
59
- from typing_extensions import Unpack, ParamSpec, Concatenate
58
+ from sqlglot._typing import ParserArgs, ParserNoDialectArgs, E, P
59
+ from typing_extensions import Unpack, Concatenate
60
60
  from sqlglot.expressions.core import Dot
61
61
 
62
- P = ParamSpec("P")
63
-
64
62
 
65
63
  def select(
66
64
  *expressions: ExpOrStr,
@@ -118,10 +116,10 @@ def from_(
118
116
 
119
117
  def update(
120
118
  table: str | Table,
121
- properties: t.Optional[dict[str, object]] = None,
122
- where: t.Optional[ExpOrStr] = None,
123
- from_: t.Optional[ExpOrStr] = None,
124
- with_: t.Optional[dict[str, ExpOrStr]] = None,
119
+ properties: dict[str, object] | None = None,
120
+ where: ExpOrStr | None = None,
121
+ from_: ExpOrStr | None = None,
122
+ with_: dict[str, ExpOrStr] | None = None,
125
123
  dialect: DialectType = None,
126
124
  copy: bool = True,
127
125
  **opts: Unpack[ParserNoDialectArgs],
@@ -183,8 +181,8 @@ def update(
183
181
 
184
182
  def delete(
185
183
  table: ExpOrStr,
186
- where: t.Optional[ExpOrStr] = None,
187
- returning: t.Optional[ExpOrStr] = None,
184
+ where: ExpOrStr | None = None,
185
+ returning: ExpOrStr | None = None,
188
186
  dialect: DialectType = None,
189
187
  **opts: Unpack[ParserNoDialectArgs],
190
188
  ) -> Delete:
@@ -215,9 +213,9 @@ def delete(
215
213
  def insert(
216
214
  expression: ExpOrStr,
217
215
  into: str | Table,
218
- columns: t.Optional[Sequence[str | Identifier]] = None,
219
- overwrite: t.Optional[bool] = None,
220
- returning: t.Optional[ExpOrStr] = None,
216
+ columns: Sequence[str | Identifier] | None = None,
217
+ overwrite: bool | None = None,
218
+ returning: ExpOrStr | None = None,
221
219
  dialect: DialectType = None,
222
220
  copy: bool = True,
223
221
  **opts: Unpack[ParserNoDialectArgs],
@@ -261,7 +259,7 @@ def merge(
261
259
  into: ExpOrStr,
262
260
  using: ExpOrStr,
263
261
  on: ExpOrStr,
264
- returning: t.Optional[ExpOrStr] = None,
262
+ returning: ExpOrStr | None = None,
265
263
  dialect: DialectType = None,
266
264
  copy: bool = True,
267
265
  **opts: Unpack[ParserNoDialectArgs],
@@ -384,11 +382,11 @@ def to_table(
384
382
 
385
383
  def to_column(
386
384
  sql_path: str | Column,
387
- quoted: t.Optional[bool] = None,
385
+ quoted: bool | None = None,
388
386
  dialect: DialectType = None,
389
387
  copy: bool = True,
390
388
  **kwargs: t.Any,
391
- ) -> t.Union[Column, Dot]:
389
+ ) -> Column | Dot:
392
390
  """
393
391
  Create a column from a `[table].[column]` sql path. Table is optional.
394
392
  If a column is passed in then that column is returned.
@@ -423,7 +421,7 @@ def to_column(
423
421
 
424
422
  def subquery(
425
423
  expression: ExpOrStr,
426
- alias: t.Optional[Identifier | str] = None,
424
+ alias: Identifier | str | None = None,
427
425
  dialect: DialectType = None,
428
426
  copy: bool = True,
429
427
  **opts: Unpack[ParserNoDialectArgs],
@@ -509,10 +507,10 @@ def cast(
509
507
 
510
508
  def table_(
511
509
  table: Identifier | str,
512
- db: t.Optional[Identifier | str] = None,
513
- catalog: t.Optional[Identifier | str] = None,
514
- quoted: t.Optional[bool] = None,
515
- alias: t.Optional[Identifier | str] = None,
510
+ db: Identifier | str | None = None,
511
+ catalog: Identifier | str | None = None,
512
+ quoted: bool | None = None,
513
+ alias: Identifier | str | None = None,
516
514
  ) -> Table:
517
515
  """Build a Table.
518
516
 
@@ -536,8 +534,8 @@ def table_(
536
534
 
537
535
  def values(
538
536
  values: Iterable[tuple[object, ...] | Tuple],
539
- alias: t.Optional[str] = None,
540
- columns: t.Optional[Iterable[str] | dict[str, DataType]] = None,
537
+ alias: str | None = None,
538
+ columns: Iterable[str] | dict[str, DataType] | None = None,
541
539
  ) -> Values:
542
540
  """Build VALUES statement.
543
541
 
@@ -567,7 +565,7 @@ def values(
567
565
  )
568
566
 
569
567
 
570
- def var(name: t.Optional[ExpOrStr]) -> Var:
568
+ def var(name: ExpOrStr | None) -> Var:
571
569
  """Build a SQL variable.
572
570
 
573
571
  Example:
@@ -621,7 +619,7 @@ def rename_column(
621
619
  table_name: str | Table,
622
620
  old_column_name: str | Column,
623
621
  new_column_name: str | Column,
624
- exists: t.Optional[bool] = None,
622
+ exists: bool | None = None,
625
623
  dialect: DialectType = None,
626
624
  ) -> Alter:
627
625
  """Build ALTER TABLE... RENAME COLUMN... expression
@@ -679,7 +677,7 @@ def replace_children(
679
677
  def replace_tree(
680
678
  expression: Expr,
681
679
  fun: t.Callable[[Expr], Expr],
682
- prune: t.Optional[t.Callable[[Expr], bool]] = None,
680
+ prune: t.Callable[[Expr], bool] | None = None,
683
681
  ) -> Expr:
684
682
  """
685
683
  Replace an entire tree with the result of function calls on each node.
@@ -991,7 +989,7 @@ def func(
991
989
 
992
990
 
993
991
  def case(
994
- expression: t.Optional[ExpOrStr] = None,
992
+ expression: ExpOrStr | None = None,
995
993
  copy: bool = True,
996
994
  **opts: Unpack[ParserArgs],
997
995
  ) -> Case: