__init__.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # sql/__init__.py
  2. # Copyright (C) 2005-2017 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: http://www.opensource.org/licenses/mit-license.php
  7. from .expression import (
  8. Alias,
  9. ClauseElement,
  10. ColumnCollection,
  11. ColumnElement,
  12. CompoundSelect,
  13. Delete,
  14. FromClause,
  15. Insert,
  16. Join,
  17. Select,
  18. Selectable,
  19. TableClause,
  20. TableSample,
  21. Update,
  22. alias,
  23. and_,
  24. any_,
  25. all_,
  26. asc,
  27. between,
  28. bindparam,
  29. case,
  30. cast,
  31. collate,
  32. column,
  33. delete,
  34. desc,
  35. distinct,
  36. except_,
  37. except_all,
  38. exists,
  39. extract,
  40. false,
  41. False_,
  42. func,
  43. funcfilter,
  44. insert,
  45. intersect,
  46. intersect_all,
  47. join,
  48. label,
  49. lateral,
  50. literal,
  51. literal_column,
  52. modifier,
  53. not_,
  54. null,
  55. or_,
  56. outerjoin,
  57. outparam,
  58. over,
  59. select,
  60. subquery,
  61. table,
  62. tablesample,
  63. text,
  64. true,
  65. True_,
  66. tuple_,
  67. type_coerce,
  68. union,
  69. union_all,
  70. update,
  71. within_group
  72. )
  73. from .visitors import ClauseVisitor
  74. def __go(lcls):
  75. global __all__
  76. from .. import util as _sa_util
  77. import inspect as _inspect
  78. __all__ = sorted(name for name, obj in lcls.items()
  79. if not (name.startswith('_') or _inspect.ismodule(obj)))
  80. from .annotation import _prepare_annotations, Annotated
  81. from .elements import AnnotatedColumnElement, ClauseList
  82. from .selectable import AnnotatedFromClause
  83. _prepare_annotations(ColumnElement, AnnotatedColumnElement)
  84. _prepare_annotations(FromClause, AnnotatedFromClause)
  85. _prepare_annotations(ClauseList, Annotated)
  86. _sa_util.dependencies.resolve_all("sqlalchemy.sql")
  87. from . import naming
  88. __go(locals())