__init__.py 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. # sql/__init__.py
  2. # Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
  3. # <see AUTHORS file>
  4. #
  5. # This module is part of SQLAlchemy and is released under
  6. # the MIT License: https://www.opensource.org/licenses/mit-license.php
  7. from .base import Executable
  8. from .compiler import COLLECT_CARTESIAN_PRODUCTS
  9. from .compiler import FROM_LINTING
  10. from .compiler import NO_LINTING
  11. from .compiler import WARN_LINTING
  12. from .expression import Alias
  13. from .expression import alias
  14. from .expression import all_
  15. from .expression import and_
  16. from .expression import any_
  17. from .expression import asc
  18. from .expression import between
  19. from .expression import bindparam
  20. from .expression import case
  21. from .expression import cast
  22. from .expression import ClauseElement
  23. from .expression import collate
  24. from .expression import column
  25. from .expression import ColumnCollection
  26. from .expression import ColumnElement
  27. from .expression import CompoundSelect
  28. from .expression import cte
  29. from .expression import Delete
  30. from .expression import delete
  31. from .expression import desc
  32. from .expression import distinct
  33. from .expression import except_
  34. from .expression import except_all
  35. from .expression import exists
  36. from .expression import extract
  37. from .expression import false
  38. from .expression import False_
  39. from .expression import FromClause
  40. from .expression import func
  41. from .expression import funcfilter
  42. from .expression import Insert
  43. from .expression import insert
  44. from .expression import intersect
  45. from .expression import intersect_all
  46. from .expression import Join
  47. from .expression import join
  48. from .expression import label
  49. from .expression import LABEL_STYLE_DEFAULT
  50. from .expression import LABEL_STYLE_DISAMBIGUATE_ONLY
  51. from .expression import LABEL_STYLE_NONE
  52. from .expression import LABEL_STYLE_TABLENAME_PLUS_COL
  53. from .expression import lambda_stmt
  54. from .expression import LambdaElement
  55. from .expression import lateral
  56. from .expression import literal
  57. from .expression import literal_column
  58. from .expression import modifier
  59. from .expression import not_
  60. from .expression import null
  61. from .expression import nulls_first
  62. from .expression import nulls_last
  63. from .expression import nullsfirst
  64. from .expression import nullslast
  65. from .expression import or_
  66. from .expression import outerjoin
  67. from .expression import outparam
  68. from .expression import over
  69. from .expression import quoted_name
  70. from .expression import Select
  71. from .expression import select
  72. from .expression import Selectable
  73. from .expression import StatementLambdaElement
  74. from .expression import Subquery
  75. from .expression import subquery
  76. from .expression import table
  77. from .expression import TableClause
  78. from .expression import TableSample
  79. from .expression import tablesample
  80. from .expression import text
  81. from .expression import true
  82. from .expression import True_
  83. from .expression import tuple_
  84. from .expression import type_coerce
  85. from .expression import union
  86. from .expression import union_all
  87. from .expression import Update
  88. from .expression import update
  89. from .expression import Values
  90. from .expression import values
  91. from .expression import within_group
  92. from .visitors import ClauseVisitor
  93. def __go(lcls):
  94. global __all__
  95. from .. import util as _sa_util
  96. import inspect as _inspect
  97. __all__ = sorted(
  98. name
  99. for name, obj in lcls.items()
  100. if not (name.startswith("_") or _inspect.ismodule(obj))
  101. )
  102. from .annotation import _prepare_annotations
  103. from .annotation import Annotated
  104. from .elements import AnnotatedColumnElement
  105. from .elements import ClauseList
  106. from .selectable import AnnotatedFromClause
  107. # from .traversals import _preconfigure_traversals
  108. from . import base
  109. from . import coercions
  110. from . import elements
  111. from . import events
  112. from . import lambdas
  113. from . import selectable
  114. from . import schema
  115. from . import sqltypes
  116. from . import traversals
  117. from . import type_api
  118. base.coercions = elements.coercions = coercions
  119. base.elements = elements
  120. base.type_api = type_api
  121. coercions.elements = elements
  122. coercions.lambdas = lambdas
  123. coercions.schema = schema
  124. coercions.selectable = selectable
  125. coercions.sqltypes = sqltypes
  126. coercions.traversals = traversals
  127. _prepare_annotations(ColumnElement, AnnotatedColumnElement)
  128. _prepare_annotations(FromClause, AnnotatedFromClause)
  129. _prepare_annotations(ClauseList, Annotated)
  130. # this is expensive at import time; elements that are used can create
  131. # their traversals on demand
  132. # _preconfigure_traversals(ClauseElement)
  133. _sa_util.preloaded.import_prefix("sqlalchemy.sql")
  134. from . import naming
  135. __go(locals())