diff --git a/README.md b/README.md index 2091e12a..b3c97b89 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ and are no longer maintained here: - pywin32 (pythonwin, win32 and win32com packages) - retry - slugify +- SQLAlchemy (see for SQLAlchemy 1.4; 2.0.0 and above include type annotations) # Trademarks diff --git a/sqlalchemy/LICENSE b/sqlalchemy/LICENSE deleted file mode 100644 index 57bc88a1..00000000 --- a/sqlalchemy/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/sqlalchemy/__init__.pyi b/sqlalchemy/__init__.pyi deleted file mode 100644 index fbed2943..00000000 --- a/sqlalchemy/__init__.pyi +++ /dev/null @@ -1,142 +0,0 @@ -from .sql import ( - alias as alias, - all_ as all_, - and_ as and_, - any_ as any_, - asc as asc, - between as between, - bindparam as bindparam, - case as case, - cast as cast, - collate as collate, - column as column, - delete as delete, - desc as desc, - distinct as distinct, - except_ as except_, - except_all as except_all, - exists as exists, - extract as extract, - false as false, - func as func, - funcfilter as funcfilter, - insert as insert, - intersect as intersect, - intersect_all as intersect_all, - join as join, - lateral as lateral, - literal as literal, - literal_column as literal_column, - modifier as modifier, - not_ as not_, - null as null, - or_ as or_, - outerjoin as outerjoin, - outparam as outparam, - over as over, - select as select, - subquery as subquery, - table as table, - tablesample as tablesample, - text as text, - true as true, - tuple_ as tuple_, - type_coerce as type_coerce, - union as union, - union_all as union_all, - update as update, - within_group as within_group -) - -from .types import ( - ARRAY as ARRAY, - BIGINT as BIGINT, - BINARY as BINARY, - BLOB as BLOB, - BOOLEAN as BOOLEAN, - BigInteger as BigInteger, - Binary as Binary, - Boolean as Boolean, - CHAR as CHAR, - CLOB as CLOB, - DATE as DATE, - DATETIME as DATETIME, - DECIMAL as DECIMAL, - Date as Date, - DateTime as DateTime, - Enum as Enum, - FLOAT as FLOAT, - Float as Float, - INT as INT, - INTEGER as INTEGER, - Integer as Integer, - Interval as Interval, - JSON as JSON, - LargeBinary as LargeBinary, - NCHAR as NCHAR, - NVARCHAR as NVARCHAR, - NUMERIC as NUMERIC, - Numeric as Numeric, - PickleType as PickleType, - REAL as REAL, - SMALLINT as SMALLINT, - SmallInteger as SmallInteger, - String as String, - TEXT as TEXT, - TIME as TIME, - TIMESTAMP as TIMESTAMP, - Text as Text, - Time as Time, - TypeDecorator as TypeDecorator, - Unicode as Unicode, - UnicodeText as UnicodeText, - VARBINARY as VARBINARY, - VARCHAR as VARCHAR -) - -from .schema import ( - CheckConstraint as CheckConstraint, - Column as Column, - ColumnDefault as ColumnDefault, - Constraint as Constraint, - DefaultClause as DefaultClause, - FetchedValue as FetchedValue, - ForeignKey as ForeignKey, - ForeignKeyConstraint as ForeignKeyConstraint, - Index as Index, - MetaData as MetaData, - PassiveDefault as PassiveDefault, - PrimaryKeyConstraint as PrimaryKeyConstraint, - Sequence as Sequence, - Table as Table, - ThreadLocalMetaData as ThreadLocalMetaData, - UniqueConstraint as UniqueConstraint, - DDL as DDL, - BLANK_SCHEMA as BLANK_SCHEMA -) - -from .inspection import inspect as inspect - -from .engine import ( - create_engine as create_engine, - engine_from_config as engine_from_config -) - -from . import connectors as connectors -from . import databases as databases -from . import dialects as dialects -from . import engine as engine -from . import event as event -from . import ext as ext -from . import orm as orm -from . import sql as sql -from . import util as util -from . import events as events -from . import exc as exc -from . import inspection as inspection -from . import interfaces as interfaces -from . import log as log -from . import pool as pool -from . import processors as processors -from . import schema as schema -from . import types as types diff --git a/sqlalchemy/commit.txt b/sqlalchemy/commit.txt deleted file mode 100644 index 9ca55fbf..00000000 --- a/sqlalchemy/commit.txt +++ /dev/null @@ -1 +0,0 @@ -80f89322c3a58c1a8c19588b17869c5f49a1e72b diff --git a/sqlalchemy/connectors/__init__.pyi b/sqlalchemy/connectors/__init__.pyi deleted file mode 100644 index 1282a657..00000000 --- a/sqlalchemy/connectors/__init__.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from typing import Any - -class Connector(object): ... - -def __getattr__(attr: str) -> Any: ... diff --git a/sqlalchemy/databases/__init__.pyi b/sqlalchemy/databases/__init__.pyi deleted file mode 100644 index 6dfb3808..00000000 --- a/sqlalchemy/databases/__init__.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from ..dialects.sqlite import base as sqlite -from ..dialects.postgresql import base as postgresql -from ..dialects.postgresql import base as postgres -from ..dialects.mysql import base as mysql -from ..dialects.oracle import base as oracle -from ..dialects.firebird import base as firebird -from ..dialects.mssql import base as mssql -from ..dialects.sybase import base as sybase diff --git a/sqlalchemy/dialects/__init__.pyi b/sqlalchemy/dialects/__init__.pyi deleted file mode 100644 index e15e738a..00000000 --- a/sqlalchemy/dialects/__init__.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from . import ( - firebird as firebird, - mssql as mssql, - mysql as mysql, - oracle as oracle, - postgresql as postgresql, - sqlite as sqlite, - sybase as sybase -) - -from .. import util - -registry: util.PluginLoader -plugins: util.PluginLoader diff --git a/sqlalchemy/dialects/firebird/__init__.pyi b/sqlalchemy/dialects/firebird/__init__.pyi deleted file mode 100644 index 6059ba87..00000000 --- a/sqlalchemy/dialects/firebird/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from typing import Any - -def __getattr__(attr: str) -> Any: ... diff --git a/sqlalchemy/dialects/mssql/__init__.pyi b/sqlalchemy/dialects/mssql/__init__.pyi deleted file mode 100644 index 54a15abb..00000000 --- a/sqlalchemy/dialects/mssql/__init__.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from .base import ( - BIGINT as BIGINT, - BINARY as BINARY, - BIT as BIT, - CHAR as CHAR, - DATE as DATE, - DATETIME as DATETIME, - DATETIME2 as DATETIME2, - DATETIMEOFFSET as DATETIMEOFFSET, - DECIMAL as DECIMAL, - FLOAT as FLOAT, - IMAGE as IMAGE, - INTEGER as INTEGER, - MONEY as MONEY, - NCHAR as NCHAR, - NTEXT as NTEXT, - NVARCHAR as NVARCHAR, - NUMERIC as NUMERIC, - SMALLDATETIME as SMALLDATETIME, - SMALLINT as SMALLINT, - SMALLMONEY as SMALLMONEY, - REAL as REAL, - ROWVERSION as ROWVERSION, - SQL_VARIANT as SQL_VARIANT, - TEXT as TEXT, - TIME as TIME, - TIMESTAMP as TIMESTAMP, - TINYINT as TINYINT, - UNIQUEIDENTIFIER as UNIQUEIDENTIFIER, - VARBINARY as VARBINARY, - VARCHAR as VARCHAR, - XML as XML -) diff --git a/sqlalchemy/dialects/mssql/base.pyi b/sqlalchemy/dialects/mssql/base.pyi deleted file mode 100644 index 204eb46d..00000000 --- a/sqlalchemy/dialects/mssql/base.pyi +++ /dev/null @@ -1,62 +0,0 @@ -from typing import Any, Optional -from ... import types as _sqltypes -from ...types import INTEGER as INTEGER, BIGINT as BIGINT, SMALLINT as SMALLINT, DECIMAL as DECIMAL, NUMERIC as NUMERIC, \ - FLOAT as FLOAT, DATETIME as DATETIME, DATE as DATE, BINARY as BINARY, \ - TEXT as TEXT, VARCHAR as VARCHAR, NVARCHAR as NVARCHAR, CHAR as CHAR, NCHAR as NCHAR - -class REAL(_sqltypes.REAL): - __visit_name__: str = ... - -class TINYINT(_sqltypes.Integer): - __visit_name__: str = ... - -class TIME(_sqltypes.TIME): - __visit_name__: str = ... - -class _DateTimeBase(object): ... - -class SMALLDATETIME(_DateTimeBase, _sqltypes.DateTime): - __visit_name__: str = ... - -class DATETIME2(_DateTimeBase, _sqltypes.DateTime): - __visit_name__: str = ... - -class DATETIMEOFFSET(_sqltypes.TypeEngine[Any]): - __visit_name__: str = ... - - def __init__(self, precision: Optional[int] = ..., **kwargs: Any) -> None: ... - -class TIMESTAMP(_sqltypes._Binary): - __visit_name__: str = ... - - def __init__(self, convert_int: bool = ...) -> None: ... - -class ROWVERSION(TIMESTAMP): - __visit_name__: str = ... - -class NTEXT(_sqltypes.UnicodeText): - __visit_name__: str = ... - -class VARBINARY(_sqltypes.VARBINARY, _sqltypes.LargeBinary): - __visit_name__: str = ... - -class IMAGE(_sqltypes.LargeBinary): - __visit_name__: str = ... - -class XML(_sqltypes.Text): - __visit_name__: str = ... - -class BIT(_sqltypes.TypeEngine[int]): - __visit_name__: str = ... - -class MONEY(_sqltypes.TypeEngine[Any]): - __visit_name__: str = ... - -class SMALLMONEY(_sqltypes.TypeEngine[Any]): - __visit_name__: str = ... - -class UNIQUEIDENTIFIER(_sqltypes.TypeEngine[str]): - __visit_name__: str = ... - -class SQL_VARIANT(_sqltypes.TypeEngine[Any]): - __visit_name__: str = ... diff --git a/sqlalchemy/dialects/mysql/__init__.pyi b/sqlalchemy/dialects/mysql/__init__.pyi deleted file mode 100644 index 1fce1886..00000000 --- a/sqlalchemy/dialects/mysql/__init__.pyi +++ /dev/null @@ -1,46 +0,0 @@ -from typing import Any - -from .base import ( - BIGINT as BIGINT, - BINARY as BINARY, - BIT as BIT, - BLOB as BLOB, - BOOLEAN as BOOLEAN, - CHAR as CHAR, - DATE as DATE, - DATETIME as DATETIME, - DECIMAL as DECIMAL, - DOUBLE as DOUBLE, - ENUM as ENUM, - DECIMAL as DECIMAL, - FLOAT as FLOAT, - INTEGER as INTEGER, - INTEGER as INTEGER, - JSON as JSON, - LONGBLOB as LONGBLOB, - LONGTEXT as LONGTEXT, - MEDIUMBLOB as MEDIUMBLOB, - MEDIUMINT as MEDIUMINT, - MEDIUMTEXT as MEDIUMTEXT, - NCHAR as NCHAR, - NVARCHAR as NVARCHAR, - NUMERIC as NUMERIC, - SET as SET, - SMALLINT as SMALLINT, - REAL as REAL, - TEXT as TEXT, - TIME as TIME, - TIMESTAMP as TIMESTAMP, - TINYBLOB as TINYBLOB, - TINYINT as TINYINT, - TINYTEXT as TINYTEXT, - VARBINARY as VARBINARY, - VARCHAR as VARCHAR, - YEAR as YEAR, -) - -from .mysqldb import dialect as dialect - -# This should stay here until we are sure we added all submodules, -# to avoid false positives. -def __getattr__(attr: str) -> Any: ... diff --git a/sqlalchemy/dialects/mysql/base.pyi b/sqlalchemy/dialects/mysql/base.pyi deleted file mode 100644 index c22188ed..00000000 --- a/sqlalchemy/dialects/mysql/base.pyi +++ /dev/null @@ -1,197 +0,0 @@ -# Stubs for sqlalchemy.dialects.mysql.base (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from sqlalchemy.sql import compiler -from ... import schema as sa_schema -from ...sql import compiler as compiler, elements as elements -from array import array as _array -from ...engine import reflection as reflection -from ...engine import default as default -from ... import types as sqltypes -from ...util import topological as topological -from ...types import DATE as DATE, BOOLEAN as BOOLEAN, BLOB as BLOB, BINARY as BINARY, VARBINARY as VARBINARY -from . import reflection as _reflection -from .types import ( - BIGINT as BIGINT, BIT as BIT, CHAR as CHAR, DECIMAL as DECIMAL, DATETIME as DATETIME, - DOUBLE as DOUBLE, FLOAT as FLOAT, INTEGER as INTEGER, LONGBLOB as LONGBLOB, - LONGTEXT as LONGTEXT, MEDIUMBLOB as MEDIUMBLOB, MEDIUMINT as MEDIUMINT, - MEDIUMTEXT as MEDIUMTEXT, NCHAR as NCHAR, NUMERIC as NUMERIC, NVARCHAR as NVARCHAR, - REAL as REAL, SMALLINT as SMALLINT, TEXT as TEXT, TIME as TIME, TIMESTAMP as TIMESTAMP, - TINYBLOB as TINYBLOB, TINYINT as TINYINT, TINYTEXT as TINYTEXT, - VARCHAR as VARCHAR, YEAR as YEAR -) -from .types import ( - _StringType as _StringType, _IntegerType as _IntegerType, - _NumericType as _NumericType, _FloatType as _FloatType, _MatchType as _MatchType -) -from .enumerated import ENUM as ENUM, SET as SET -from .json import JSON as JSON, JSONIndexType as JSONIndexType, JSONPathType as JSONPathType - -RESERVED_WORDS: Any = ... -AUTOCOMMIT_RE: Any = ... -SET_RE: Any = ... -MSTime: Any = ... -MSSet: Any = ... -MSEnum: Any = ... -MSLongBlob: Any = ... -MSMediumBlob: Any = ... -MSTinyBlob: Any = ... -MSBlob: Any = ... -MSBinary: Any = ... -MSVarBinary: Any = ... -MSNChar: Any = ... -MSNVarChar: Any = ... -MSChar: Any = ... -MSString: Any = ... -MSLongText: Any = ... -MSMediumText: Any = ... -MSTinyText: Any = ... -MSText: Any = ... -MSYear: Any = ... -MSTimeStamp: Any = ... -MSBit: Any = ... -MSSmallInteger: Any = ... -MSTinyInteger: Any = ... -MSMediumInteger: Any = ... -MSBigInteger: Any = ... -MSNumeric: Any = ... -MSDecimal: Any = ... -MSDouble: Any = ... -MSReal: Any = ... -MSFloat: Any = ... -MSInteger: Any = ... -colspecs: Any = ... -ischema_names: Any = ... - -class MySQLExecutionContext(default.DefaultExecutionContext): - def should_autocommit_text(self, statement): ... - def create_server_side_cursor(self): ... - -class MySQLCompiler(compiler.SQLCompiler): - render_table_with_column_in_update_from: bool = ... - extract_map: Any = ... - def visit_random_func(self, fn, **kw): ... - def visit_utc_timestamp_func(self, fn, **kw): ... - def visit_sysdate_func(self, fn, **kw): ... - def visit_json_getitem_op_binary(self, binary, operator, **kw): ... - def visit_json_path_getitem_op_binary(self, binary, operator, **kw): ... - def visit_concat_op_binary(self, binary, operator, **kw): ... - def visit_match_op_binary(self, binary, operator, **kw): ... - def get_from_hint_text(self, table, text): ... - def visit_typeclause(self, *args, **kw): ... - def visit_cast(self, cast, **kw): ... - def render_literal_value(self, value, type_): ... - def visit_true(self, element, **kw): ... - def visit_false(self, element, **kw): ... - def get_select_precolumns(self, select, **kw): ... - def visit_join(self, join, asfrom: bool = ..., **kwargs): ... - def for_update_clause(self, select, **kw): ... - def limit_clause(self, select, **kw): ... - def update_limit_clause(self, update_stmt): ... - def update_tables_clause(self, update_stmt, from_table, extra_froms, **kw): ... - def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw): ... - -class MySQLDDLCompiler(compiler.DDLCompiler): - def get_column_specification(self, column, **kw): ... - def post_create_table(self, table): ... - def visit_create_index(self, create): ... - def visit_primary_key_constraint(self, constraint): ... - def visit_drop_index(self, drop): ... - def visit_drop_constraint(self, drop): ... - def define_constraint_match(self, constraint): ... - -class MySQLTypeCompiler(compiler.GenericTypeCompiler): - def visit_NUMERIC(self, type_, **kw): ... - def visit_DECIMAL(self, type_, **kw): ... - def visit_DOUBLE(self, type_, **kw): ... - def visit_REAL(self, type_, **kw): ... - def visit_FLOAT(self, type_, **kw): ... - def visit_INTEGER(self, type_, **kw): ... - def visit_BIGINT(self, type_, **kw): ... - def visit_MEDIUMINT(self, type_, **kw): ... - def visit_TINYINT(self, type_, **kw): ... - def visit_SMALLINT(self, type_, **kw): ... - def visit_BIT(self, type_, **kw): ... - def visit_DATETIME(self, type_, **kw): ... - def visit_DATE(self, type_, **kw): ... - def visit_TIME(self, type_, **kw): ... - def visit_TIMESTAMP(self, type_, **kw): ... - def visit_YEAR(self, type_, **kw): ... - def visit_TEXT(self, type_, **kw): ... - def visit_TINYTEXT(self, type_, **kw): ... - def visit_MEDIUMTEXT(self, type_, **kw): ... - def visit_LONGTEXT(self, type_, **kw): ... - def visit_VARCHAR(self, type_, **kw): ... - def visit_CHAR(self, type_, **kw): ... - def visit_NVARCHAR(self, type_, **kw): ... - def visit_NCHAR(self, type_, **kw): ... - def visit_VARBINARY(self, type_, **kw): ... - def visit_JSON(self, type_, **kw): ... - def visit_large_binary(self, type_, **kw): ... - def visit_enum(self, type_, **kw): ... - def visit_BLOB(self, type_, **kw): ... - def visit_TINYBLOB(self, type_, **kw): ... - def visit_MEDIUMBLOB(self, type_, **kw): ... - def visit_LONGBLOB(self, type_, **kw): ... - def visit_ENUM(self, type_, **kw): ... - def visit_SET(self, type_, **kw): ... - def visit_BOOLEAN(self, type, **kw): ... - -class MySQLIdentifierPreparer(compiler.IdentifierPreparer): - reserved_words: Any = ... - def __init__(self, dialect, server_ansiquotes: bool = ..., **kw) -> None: ... - -class MySQLDialect(default.DefaultDialect): - name: str = ... - supports_alter: bool = ... - supports_native_boolean: bool = ... - max_identifier_length: int = ... - max_index_name_length: int = ... - supports_native_enum: bool = ... - supports_sane_rowcount: bool = ... - supports_sane_multi_rowcount: bool = ... - supports_multivalues_insert: bool = ... - default_paramstyle: str = ... - colspecs: Any = ... - statement_compiler: Any = ... - ddl_compiler: Any = ... - type_compiler: Any = ... - ischema_names: Any = ... - preparer: Any = ... - construct_arguments: Any = ... - isolation_level: Any = ... - def __init__(self, isolation_level: Optional[Any] = ..., json_serializer: Optional[Any] = ..., - json_deserializer: Optional[Any] = ..., **kwargs) -> None: ... - def on_connect(self): ... - def set_isolation_level(self, connection, level): ... - def get_isolation_level(self, connection): ... - def do_commit(self, dbapi_connection): ... - def do_rollback(self, dbapi_connection): ... - def do_begin_twophase(self, connection, xid): ... - def do_prepare_twophase(self, connection, xid): ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...): ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...): ... - def do_recover_twophase(self, connection): ... - def is_disconnect(self, e, connection, cursor): ... - def has_table(self, connection, table_name, schema: Optional[Any] = ...): ... - identifier_preparer: Any = ... - def initialize(self, connection): ... - def get_schema_names(self, connection, **kw): ... - def get_table_names(self, connection, schema: Optional[Any] = ..., **kw): ... - def get_view_names(self, connection, schema: Optional[Any] = ..., **kw): ... - def get_table_options(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Optional[Any] = ..., **kw): ... - -class _DecodingRowProxy(object): - rowproxy: Any = ... - charset: Any = ... - def __init__(self, rowproxy, charset) -> None: ... - def __getitem__(self, index): ... - def __getattr__(self, attr): ... diff --git a/sqlalchemy/dialects/mysql/cymysql.pyi b/sqlalchemy/dialects/mysql/cymysql.pyi deleted file mode 100644 index 6307d9ba..00000000 --- a/sqlalchemy/dialects/mysql/cymysql.pyi +++ /dev/null @@ -1,23 +0,0 @@ -# Stubs for sqlalchemy.dialects.mysql.cymysql (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .mysqldb import MySQLDialect_mysqldb as MySQLDialect_mysqldb -from .base import BIT as BIT - -class _cymysqlBIT(BIT): - def result_processor(self, dialect, coltype): ... - -class MySQLDialect_cymysql(MySQLDialect_mysqldb): - driver: str = ... - description_encoding: Any = ... - supports_sane_rowcount: bool = ... - supports_sane_multi_rowcount: bool = ... - supports_unicode_statements: bool = ... - colspecs: Any = ... - @classmethod - def dbapi(cls): ... - def is_disconnect(self, e, connection, cursor): ... - -dialect: Any = ... diff --git a/sqlalchemy/dialects/mysql/enumerated.pyi b/sqlalchemy/dialects/mysql/enumerated.pyi deleted file mode 100644 index 84a1c1c2..00000000 --- a/sqlalchemy/dialects/mysql/enumerated.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# Stubs for sqlalchemy.dialects.mysql.enumerated (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .types import _StringType as _StringType -from ... import types as sqltypes - -class _EnumeratedValues(_StringType): ... - -class ENUM(sqltypes.Enum, _EnumeratedValues): - __visit_name__: str = ... - def __init__(self, *enums, **kw) -> None: ... - def adapt(self, cls, **kw): ... - -class SET(_EnumeratedValues): - __visit_name__: str = ... - retrieve_as_bitwise: Any = ... - values: Any = ... - def __init__(self, *values, **kw) -> None: ... - def column_expression(self, colexpr): ... - def result_processor(self, dialect, coltype): ... - def bind_processor(self, dialect): ... - def adapt(self, impltype, **kw): ... diff --git a/sqlalchemy/dialects/mysql/gaerdbms.pyi b/sqlalchemy/dialects/mysql/gaerdbms.pyi deleted file mode 100644 index 667372e8..00000000 --- a/sqlalchemy/dialects/mysql/gaerdbms.pyi +++ /dev/null @@ -1,15 +0,0 @@ -# Stubs for sqlalchemy.dialects.mysql.gaerdbms (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .mysqldb import MySQLDialect_mysqldb as MySQLDialect_mysqldb - -class MySQLDialect_gaerdbms(MySQLDialect_mysqldb): - @classmethod - def dbapi(cls): ... - @classmethod - def get_pool_class(cls, url): ... - def create_connect_args(self, url): ... - -dialect: Any = ... diff --git a/sqlalchemy/dialects/mysql/json.pyi b/sqlalchemy/dialects/mysql/json.pyi deleted file mode 100644 index cec00ab9..00000000 --- a/sqlalchemy/dialects/mysql/json.pyi +++ /dev/null @@ -1,14 +0,0 @@ -# Stubs for sqlalchemy.dialects.mysql.json (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from ... import types as sqltypes - -class JSON(sqltypes.JSON): ... - -class _FormatTypeMixin(object): - def bind_processor(self, dialect): ... - def literal_processor(self, dialect): ... - -class JSONIndexType(_FormatTypeMixin, sqltypes.JSON.JSONIndexType): ... -class JSONPathType(_FormatTypeMixin, sqltypes.JSON.JSONPathType): ... diff --git a/sqlalchemy/dialects/mysql/mysqlconnector.pyi b/sqlalchemy/dialects/mysql/mysqlconnector.pyi deleted file mode 100644 index 05889d18..00000000 --- a/sqlalchemy/dialects/mysql/mysqlconnector.pyi +++ /dev/null @@ -1,42 +0,0 @@ -# Stubs for sqlalchemy.dialects.mysql.mysqlconnector (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .base import ( - MySQLDialect as MySQLDialect, MySQLExecutionContext as MySQLExecutionContext, - MySQLCompiler as MySQLCompiler, MySQLIdentifierPreparer as MySQLIdentifierPreparer, BIT as BIT -) - -class MySQLExecutionContext_mysqlconnector(MySQLExecutionContext): - def get_lastrowid(self): ... - -class MySQLCompiler_mysqlconnector(MySQLCompiler): - def visit_mod_binary(self, binary, operator, **kw): ... - def post_process_text(self, text): ... - def escape_literal_column(self, text): ... - -class MySQLIdentifierPreparer_mysqlconnector(MySQLIdentifierPreparer): ... - -class _myconnpyBIT(BIT): - def result_processor(self, dialect, coltype): ... - -class MySQLDialect_mysqlconnector(MySQLDialect): - driver: str = ... - supports_unicode_binds: bool = ... - supports_sane_rowcount: bool = ... - supports_sane_multi_rowcount: bool = ... - supports_native_decimal: bool = ... - default_paramstyle: str = ... - execution_ctx_cls: Any = ... - statement_compiler: Any = ... - preparer: Any = ... - colspecs: Any = ... - @property - def supports_unicode_statements(self): ... - @classmethod - def dbapi(cls): ... - def create_connect_args(self, url): ... - def is_disconnect(self, e, connection, cursor): ... - -dialect: Any = ... diff --git a/sqlalchemy/dialects/mysql/mysqldb.pyi b/sqlalchemy/dialects/mysql/mysqldb.pyi deleted file mode 100644 index f66208bb..00000000 --- a/sqlalchemy/dialects/mysql/mysqldb.pyi +++ /dev/null @@ -1,36 +0,0 @@ -from typing import Any, Optional -from .base import ( - MySQLDialect as MySQLDialect, - MySQLExecutionContext as MySQLExecutionContext, - MySQLCompiler as MySQLCompiler, - MySQLIdentifierPreparer as MySQLIdentifierPreparer -) -class MySQLExecutionContext_mysqldb(MySQLExecutionContext): - @property - def rowcount(self) -> int: ... - -class MySQLCompiler_mysqldb(MySQLCompiler): - def visit_mod_binary(self, binary, operator, **kw): ... - def post_process_text(self, text): ... - -class MySQLIdentifierPreparer_mysqldb(MySQLIdentifierPreparer): ... - -class MySQLDialect_mysqldb(MySQLDialect): - driver: str = ... - supports_unicode_statements: bool = ... - supports_sane_rowcount: bool = ... - supports_sane_multi_rowcount: bool = ... - supports_native_decimal: bool = ... - default_paramstyle: str = ... - execution_ctx_cls: Any = ... - statement_compiler: Any = ... - preparer: Any = ... - server_side_cursors: Any = ... - def __init__(self, server_side_cursors: bool = ..., **kwargs) -> None: ... - def supports_server_side_cursors(self): ... - @classmethod - def dbapi(cls): ... - def do_executemany(self, cursor, statement, parameters, context: Optional[Any] = ...): ... - def create_connect_args(self, url): ... - -dialect: Any = ... diff --git a/sqlalchemy/dialects/mysql/oursql.pyi b/sqlalchemy/dialects/mysql/oursql.pyi deleted file mode 100644 index d33aa7b7..00000000 --- a/sqlalchemy/dialects/mysql/oursql.pyi +++ /dev/null @@ -1,42 +0,0 @@ -# Stubs for sqlalchemy.dialects.mysql.oursql (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from .base import BIT as BIT, MySQLDialect as MySQLDialect, MySQLExecutionContext as MySQLExecutionContext - -class _oursqlBIT(BIT): - def result_processor(self, dialect, coltype): ... - -class MySQLExecutionContext_oursql(MySQLExecutionContext): - @property - def plain_query(self): ... - -class MySQLDialect_oursql(MySQLDialect): - driver: str = ... - supports_unicode_binds: bool = ... - supports_unicode_statements: bool = ... - supports_native_decimal: bool = ... - supports_sane_rowcount: bool = ... - supports_sane_multi_rowcount: bool = ... - execution_ctx_cls: Any = ... - colspecs: Any = ... - @classmethod - def dbapi(cls): ... - def do_execute(self, cursor, statement, parameters, context: Optional[Any] = ...): ... - def do_begin(self, connection): ... - def do_begin_twophase(self, connection, xid): ... - def do_prepare_twophase(self, connection, xid): ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...): ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...): ... - def has_table(self, connection, table_name, schema: Optional[Any] = ...): ... - def get_table_options(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_columns(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_view_names(self, connection, schema: Optional[Any] = ..., **kw): ... - def get_table_names(self, connection, schema: Optional[Any] = ..., **kw): ... - def get_schema_names(self, connection, **kw): ... - def initialize(self, connection): ... - def is_disconnect(self, e, connection, cursor): ... - def create_connect_args(self, url): ... - -dialect: Any = ... diff --git a/sqlalchemy/dialects/mysql/pymysql.pyi b/sqlalchemy/dialects/mysql/pymysql.pyi deleted file mode 100644 index c32cff18..00000000 --- a/sqlalchemy/dialects/mysql/pymysql.pyi +++ /dev/null @@ -1,19 +0,0 @@ -# Stubs for sqlalchemy.dialects.mysql.pymysql (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .mysqldb import MySQLDialect_mysqldb as MySQLDialect_mysqldb - -class MySQLDialect_pymysql(MySQLDialect_mysqldb): - driver: str = ... - description_encoding: Any = ... - supports_unicode_statements: bool = ... - supports_unicode_binds: bool = ... - server_side_cursors: Any = ... - def __init__(self, server_side_cursors: bool = ..., **kwargs) -> None: ... - def supports_server_side_cursors(self): ... - @classmethod - def dbapi(cls): ... - -dialect: Any = ... diff --git a/sqlalchemy/dialects/mysql/pyodbc.pyi b/sqlalchemy/dialects/mysql/pyodbc.pyi deleted file mode 100644 index c6a942d2..00000000 --- a/sqlalchemy/dialects/mysql/pyodbc.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for sqlalchemy.dialects.mysql.pyodbc (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .base import MySQLDialect as MySQLDialect, MySQLExecutionContext as MySQLExecutionContext -from ...connectors.pyodbc import PyODBCConnector as PyODBCConnector - -class MySQLExecutionContext_pyodbc(MySQLExecutionContext): - def get_lastrowid(self): ... - -class MySQLDialect_pyodbc(PyODBCConnector, MySQLDialect): - supports_unicode_statements: bool = ... - execution_ctx_cls: Any = ... - pyodbc_driver_name: str = ... - def __init__(self, **kw) -> None: ... - -dialect: Any = ... diff --git a/sqlalchemy/dialects/mysql/reflection.pyi b/sqlalchemy/dialects/mysql/reflection.pyi deleted file mode 100644 index 746581a0..00000000 --- a/sqlalchemy/dialects/mysql/reflection.pyi +++ /dev/null @@ -1,19 +0,0 @@ -# Stubs for sqlalchemy.dialects.mysql.reflection (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class ReflectedState(object): - columns: Any = ... - table_options: Any = ... - table_name: Any = ... - keys: Any = ... - constraints: Any = ... - def __init__(self) -> None: ... - -class MySQLTableDefinitionParser(object): - dialect: Any = ... - preparer: Any = ... - def __init__(self, dialect, preparer) -> None: ... - def parse(self, show_create, charset): ... diff --git a/sqlalchemy/dialects/mysql/types.pyi b/sqlalchemy/dialects/mysql/types.pyi deleted file mode 100644 index 444022d5..00000000 --- a/sqlalchemy/dialects/mysql/types.pyi +++ /dev/null @@ -1,147 +0,0 @@ -# Stubs for sqlalchemy.dialects.mysql.types (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from ... import types as sqltypes - -class _NumericType(object): - unsigned: Any = ... - zerofill: Any = ... - def __init__(self, unsigned: bool = ..., zerofill: bool = ..., **kw) -> None: ... - -class _FloatType(_NumericType, sqltypes.Float): - scale: Any = ... - def __init__(self, precision: Optional[Any] = ..., - scale: Optional[Any] = ..., asdecimal: bool = ..., **kw) -> None: ... - -class _IntegerType(_NumericType, sqltypes.Integer): - display_width: Any = ... - def __init__(self, display_width: Optional[Any] = ..., **kw) -> None: ... - -class _StringType(sqltypes.String): - charset: Any = ... - ascii: Any = ... - unicode: Any = ... - binary: Any = ... - national: Any = ... - def __init__(self, charset: Optional[Any] = ..., collation: Optional[Any] = ..., - ascii: bool = ..., binary: bool = ..., - unicode: bool = ..., national: bool = ..., **kw) -> None: ... - -class _MatchType(sqltypes.Float, sqltypes.MatchType): # type: ignore # Float has incompatible members with MatchType - def __init__(self, **kw) -> None: ... - -class NUMERIC(_NumericType, sqltypes.NUMERIC): - __visit_name__: str = ... - def __init__(self, precision: Optional[Any] = ..., - scale: Optional[Any] = ..., asdecimal: bool = ..., **kw) -> None: ... - -class DECIMAL(_NumericType, sqltypes.DECIMAL): - __visit_name__: str = ... - def __init__(self, precision: Optional[Any] = ..., - scale: Optional[Any] = ..., asdecimal: bool = ..., **kw) -> None: ... - -class DOUBLE(_FloatType): - __visit_name__: str = ... - def __init__(self, precision: Optional[Any] = ..., - scale: Optional[Any] = ..., asdecimal: bool = ..., **kw) -> None: ... - -class REAL(_FloatType, sqltypes.REAL): - __visit_name__: str = ... - def __init__(self, precision: Optional[Any] = ..., - scale: Optional[Any] = ..., asdecimal: bool = ..., **kw) -> None: ... - -class FLOAT(_FloatType, sqltypes.FLOAT): - __visit_name__: str = ... - def __init__(self, precision: Optional[Any] = ..., - scale: Optional[Any] = ..., asdecimal: bool = ..., **kw) -> None: ... - def bind_processor(self, dialect): ... - -class INTEGER(_IntegerType, sqltypes.INTEGER): - __visit_name__: str = ... - def __init__(self, display_width: Optional[Any] = ..., **kw) -> None: ... - -class BIGINT(_IntegerType, sqltypes.BIGINT): - __visit_name__: str = ... - def __init__(self, display_width: Optional[Any] = ..., **kw) -> None: ... - -class MEDIUMINT(_IntegerType): - __visit_name__: str = ... - def __init__(self, display_width: Optional[Any] = ..., **kw) -> None: ... - -class TINYINT(_IntegerType): - __visit_name__: str = ... - def __init__(self, display_width: Optional[Any] = ..., **kw) -> None: ... - -class SMALLINT(_IntegerType, sqltypes.SMALLINT): - __visit_name__: str = ... - def __init__(self, display_width: Optional[Any] = ..., **kw) -> None: ... - -class BIT(sqltypes.TypeEngine): - __visit_name__: str = ... - length: Any = ... - def __init__(self, length: Optional[Any] = ...) -> None: ... - def result_processor(self, dialect, coltype): ... - -class TIME(sqltypes.TIME): - __visit_name__: str = ... - fsp: Any = ... - def __init__(self, timezone: bool = ..., fsp: Optional[Any] = ...) -> None: ... - def result_processor(self, dialect, coltype): ... - -class TIMESTAMP(sqltypes.TIMESTAMP): - __visit_name__: str = ... - fsp: Any = ... - def __init__(self, timezone: bool = ..., fsp: Optional[Any] = ...) -> None: ... - -class DATETIME(sqltypes.DATETIME): - __visit_name__: str = ... - fsp: Any = ... - def __init__(self, timezone: bool = ..., fsp: Optional[Any] = ...) -> None: ... - -class YEAR(sqltypes.TypeEngine): - __visit_name__: str = ... - display_width: Any = ... - def __init__(self, display_width: Optional[Any] = ...) -> None: ... - -class TEXT(_StringType, sqltypes.TEXT): - __visit_name__: str = ... - def __init__(self, length: Optional[Any] = ..., **kw) -> None: ... - -class TINYTEXT(_StringType): - __visit_name__: str = ... - def __init__(self, **kwargs) -> None: ... - -class MEDIUMTEXT(_StringType): - __visit_name__: str = ... - def __init__(self, **kwargs) -> None: ... - -class LONGTEXT(_StringType): - __visit_name__: str = ... - def __init__(self, **kwargs) -> None: ... - -class VARCHAR(_StringType, sqltypes.VARCHAR): - __visit_name__: str = ... - def __init__(self, length: Optional[Any] = ..., **kwargs) -> None: ... - -class CHAR(_StringType, sqltypes.CHAR): - __visit_name__: str = ... - def __init__(self, length: Optional[Any] = ..., **kwargs) -> None: ... - -class NVARCHAR(_StringType, sqltypes.NVARCHAR): - __visit_name__: str = ... - def __init__(self, length: Optional[Any] = ..., **kwargs) -> None: ... - -class NCHAR(_StringType, sqltypes.NCHAR): - __visit_name__: str = ... - def __init__(self, length: Optional[Any] = ..., **kwargs) -> None: ... - -class TINYBLOB(sqltypes._Binary): - __visit_name__: str = ... - -class MEDIUMBLOB(sqltypes._Binary): - __visit_name__: str = ... - -class LONGBLOB(sqltypes._Binary): - __visit_name__: str = ... diff --git a/sqlalchemy/dialects/mysql/zxjdbc.pyi b/sqlalchemy/dialects/mysql/zxjdbc.pyi deleted file mode 100644 index 3923705a..00000000 --- a/sqlalchemy/dialects/mysql/zxjdbc.pyi +++ /dev/null @@ -1,21 +0,0 @@ -# Stubs for sqlalchemy.dialects.mysql.zxjdbc (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from ...connectors.zxJDBC import ZxJDBCConnector as ZxJDBCConnector -from .base import BIT as BIT, MySQLDialect as MySQLDialect, MySQLExecutionContext as MySQLExecutionContext - -class _ZxJDBCBit(BIT): - def result_processor(self, dialect, coltype): ... - -class MySQLExecutionContext_zxjdbc(MySQLExecutionContext): - def get_lastrowid(self): ... - -class MySQLDialect_zxjdbc(ZxJDBCConnector, MySQLDialect): - jdbc_db_name: str = ... - jdbc_driver_name: str = ... - execution_ctx_cls: Any = ... - colspecs: Any = ... - -dialect: Any = ... diff --git a/sqlalchemy/dialects/oracle/__init__.pyi b/sqlalchemy/dialects/oracle/__init__.pyi deleted file mode 100644 index 6059ba87..00000000 --- a/sqlalchemy/dialects/oracle/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from typing import Any - -def __getattr__(attr: str) -> Any: ... diff --git a/sqlalchemy/dialects/postgresql/__init__.pyi b/sqlalchemy/dialects/postgresql/__init__.pyi deleted file mode 100644 index c215327d..00000000 --- a/sqlalchemy/dialects/postgresql/__init__.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from typing import Any as _AnyType - -from .base import ( - INTEGER as INTEGER, BIGINT as BIGINT, SMALLINT as SMALLINT, VARCHAR as VARCHAR, CHAR as CHAR, - TEXT as TEXT, NUMERIC as NUMERIC, FLOAT as FLOAT, REAL as REAL, INET as INET, CIDR as CIDR, - UUID as UUID, BIT as BIT, MACADDR as MACADDR, MONEY as MONEY, OID as OID, REGCLASS as REGCLASS, - DOUBLE_PRECISION as DOUBLE_PRECISION, TIMESTAMP as TIMESTAMP, TIME as TIME, DATE as DATE, - BYTEA as BYTEA, BOOLEAN as BOOLEAN, INTERVAL as INTERVAL, ENUM as ENUM, TSVECTOR as TSVECTOR, - DropEnumType as DropEnumType, CreateEnumType as CreateEnumType -) -from .hstore import HSTORE as HSTORE, hstore as hstore -from .json import JSON as JSON, JSONB as JSONB, json as json -from .array import array as array, ARRAY as ARRAY, Any as Any, All as All -from .ext import ( - aggregate_order_by as aggregate_order_by, ExcludeConstraint as ExcludeConstraint, - array_agg as array_agg -) -from .dml import insert as insert, Insert as Insert - -from .ranges import ( - INT4RANGE as INT4RANGE, INT8RANGE as INT8RANGE, NUMRANGE as NUMRANGE, DATERANGE as DATERANGE, - TSRANGE as TSRANGE, TSTZRANGE as TSTZRANGE -) - -def __getattr__(attr: str) -> _AnyType: ... diff --git a/sqlalchemy/dialects/postgresql/array.pyi b/sqlalchemy/dialects/postgresql/array.pyi deleted file mode 100644 index 03f72472..00000000 --- a/sqlalchemy/dialects/postgresql/array.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from typing import Any as _AnyType, Optional, TypeVar, Type, Callable, overload -from ...sql import expression -from ...sql.type_api import TypeEngine -from ... import types as _sqltypes - -_T = TypeVar('_T') - -def Any(other: _AnyType, arrexpr: _AnyType, operator: Callable[..., _AnyType] = ...) -> _AnyType: ... -def All(other: _AnyType, arrexpr: _AnyType, operator: Callable[..., _AnyType] = ...) -> _AnyType: ... - -class array(expression.Tuple): ... -class ARRAY(_sqltypes.ARRAY[_T]): - @overload - def __init__(self, item_type: TypeEngine[_T], as_tuple: bool = ..., dimensions: Optional[_AnyType] = ..., - zero_indexes: bool = ...) -> None: ... - @overload - def __init__(self, item_type: Type[TypeEngine[_T]], as_tuple: bool = ..., dimensions: Optional[_AnyType] = ..., - zero_indexes: bool = ...) -> None: ... diff --git a/sqlalchemy/dialects/postgresql/base.pyi b/sqlalchemy/dialects/postgresql/base.pyi deleted file mode 100644 index d910e5c8..00000000 --- a/sqlalchemy/dialects/postgresql/base.pyi +++ /dev/null @@ -1,236 +0,0 @@ -from ... import schema -from ...engine import default, reflection -from ...sql import compiler, expression, sqltypes, type_api -from typing import Any, Optional, Set, Type, Text, Pattern, Dict -from datetime import timedelta - -from sqlalchemy.types import INTEGER as INTEGER, BIGINT as BIGINT, SMALLINT as SMALLINT, VARCHAR as VARCHAR, \ - CHAR as CHAR, TEXT as TEXT, FLOAT as FLOAT, NUMERIC as NUMERIC, \ - DATE as DATE, BOOLEAN as BOOLEAN, REAL as REAL - -AUTOCOMMIT_REGEXP: Pattern[Text] -RESERVED_WORDS: Set[str] - -class BYTEA(sqltypes.LargeBinary): - __visit_name__: str = ... - -class DOUBLE_PRECISION(sqltypes.Float): - __visit_name__: str = ... - -class INET(sqltypes.TypeEngine[str]): - __visit_name__: str = ... -PGInet = INET - -class CIDR(sqltypes.TypeEngine[str]): - __visit_name__: str = ... -PGCidr = CIDR - -class MACADDR(sqltypes.TypeEngine[str]): - __visit_name__: str = ... -PGMacAddr = MACADDR - -class MONEY(sqltypes.TypeEngine[float]): - __visit_name__: str = ... - -class OID(sqltypes.TypeEngine[int]): - __visit_name__: str = ... - -class REGCLASS(sqltypes.TypeEngine[str]): - __visit_name__: str = ... - -class TIMESTAMP(sqltypes.TIMESTAMP): - precision: Optional[int] = ... - def __init__(self, timezone: bool = ..., precision: Optional[int] = ...) -> None: ... - -class TIME(sqltypes.TIME): - precision: Optional[int] = ... - def __init__(self, timezone: bool = ..., precision: Optional[int] = ...) -> None: ... - -class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval[timedelta]): - __visit_name__: str = ... - native: bool = ... - precision: Optional[int] = ... - fields: Optional[str] = ... - def __init__(self, precision: Optional[int] = ..., fields: Optional[str] = ...) -> None: ... - # Return value of adapt_emulated_to_native incompatible with supertype "NativeForEmulated" - @classmethod - def adapt_emulated_to_native(cls, interval: Any, **kw: Any) -> INTERVAL: ... # type: ignore - @property - def python_type(self) -> Type[timedelta]: ... -PGInterval = INTERVAL - -class BIT(sqltypes.TypeEngine[str]): - __visit_name__: str = ... - length: Optional[int] = ... - varying: bool = ... - def __init__(self, length: Optional[int] = ..., varying: bool = ...) -> None: ... -PGBit = BIT - -class UUID(sqltypes.TypeEngine[str]): - __visit_name__: str = ... - as_uuid: bool = ... - def __init__(self, as_uuid: bool = ...) -> None: ... - def bind_processor(self, dialect: Any): ... - def result_processor(self, dialect: Any, coltype: Any): ... -PGUuid = UUID - -class TSVECTOR(sqltypes.TypeEngine[str]): - __visit_name__: str = ... - -class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): - native_enum: bool = ... - create_type: Any = ... - def __init__(self, *enums: Any, **kw: Any) -> None: ... - @classmethod - def adapt_emulated_to_native(cls, impl: Any, **kw: Any): ... - def create(self, bind: Optional[Any] = ..., checkfirst: bool = ...): ... - def drop(self, bind: Optional[Any] = ..., checkfirst: bool = ...): ... - -colspecs: Dict[type_api.TypeEngine[Any], type_api.TypeEngine[Any]] -ischema_names: Dict[str, type_api.TypeEngine[Any]] - -class PGCompiler(compiler.SQLCompiler): - def visit_array(self, element: Any, **kw: Any): ... - def visit_slice(self, element: Any, **kw: Any): ... - def visit_json_getitem_op_binary(self, binary: Any, operator: Any, **kw: Any): ... - def visit_json_path_getitem_op_binary(self, binary: Any, operator: Any, **kw: Any): ... - def visit_getitem_binary(self, binary: Any, operator: Any, **kw: Any): ... - def visit_aggregate_order_by(self, element: Any, **kw: Any): ... - def visit_match_op_binary(self, binary: Any, operator: Any, **kw: Any): ... - def visit_ilike_op_binary(self, binary: Any, operator: Any, **kw: Any): ... - def visit_notilike_op_binary(self, binary: Any, operator: Any, **kw: Any): ... - def render_literal_value(self, value: Any, type_: Any): ... - def visit_sequence(self, sequence: Any, **kw: Any) -> str: ... - def limit_clause(self, select: Any, **kw: Any): ... - def format_from_hint_text(self, sqltext: Any, table: Any, hint: Any, iscrud: Any): ... - def get_select_precolumns(self, select: Any, **kw: Any): ... - def for_update_clause(self, select: Any, **kw: Any): ... - def returning_clause(self, stmt: Any, returning_cols: Any): ... - def visit_substring_func(self, func: Any, **kw: Any): ... - def visit_on_conflict_do_nothing(self, on_conflict: Any, **kw: Any): ... - def visit_on_conflict_do_update(self, on_conflict: Any, **kw: Any): ... - def update_from_clause(self, update_stmt: Any, from_table: Any, extra_froms: Any, from_hints: Any, **kw: Any): ... - def delete_extra_from_clause(self, update_stmt: Any, from_table: Any, extra_froms: Any, from_hints: Any, - **kw: Any) -> str: ... - -class PGDDLCompiler(compiler.DDLCompiler): - def get_column_specification(self, column: Any, **kwargs: Any): ... - def visit_create_enum_type(self, create: Any): ... - def visit_drop_enum_type(self, drop: Any): ... - # Signature of visit_create_index incompatible with supertype "DDLCompiler" - def visit_create_index(self, create: Any) -> str: ... # type: ignore - def visit_drop_index(self, drop: Any): ... - def visit_exclude_constraint(self, constraint: Any, **kw: Any): ... - def post_create_table(self, table: Any): ... - -class PGTypeCompiler(compiler.GenericTypeCompiler): - def visit_TSVECTOR(self, type: Any, **kw: Any): ... - def visit_INET(self, type_: Any, **kw: Any): ... - def visit_CIDR(self, type_: Any, **kw: Any): ... - def visit_MACADDR(self, type_: Any, **kw: Any): ... - def visit_MONEY(self, type_: Any, **kw: Any): ... - def visit_OID(self, type_: Any, **kw: Any): ... - def visit_REGCLASS(self, type_: Any, **kw: Any): ... - def visit_FLOAT(self, type_: Any, **kw: Any): ... - def visit_DOUBLE_PRECISION(self, type_: Any, **kw: Any): ... - def visit_BIGINT(self, type_: Any, **kw: Any): ... - def visit_HSTORE(self, type_: Any, **kw: Any): ... - def visit_JSON(self, type_: Any, **kw: Any): ... - def visit_JSONB(self, type_: Any, **kw: Any): ... - def visit_INT4RANGE(self, type_: Any, **kw: Any): ... - def visit_INT8RANGE(self, type_: Any, **kw: Any): ... - def visit_NUMRANGE(self, type_: Any, **kw: Any): ... - def visit_DATERANGE(self, type_: Any, **kw: Any): ... - def visit_TSRANGE(self, type_: Any, **kw: Any): ... - def visit_TSTZRANGE(self, type_: Any, **kw: Any): ... - def visit_datetime(self, type_: Any, **kw: Any): ... - def visit_enum(self, type_: Any, **kw: Any): ... - def visit_ENUM(self, type_: Any, **kw: Any): ... - def visit_TIMESTAMP(self, type_: Any, **kw: Any): ... - def visit_TIME(self, type_: Any, **kw: Any): ... - def visit_INTERVAL(self, type_: Any, **kw: Any): ... - def visit_BIT(self, type_: Any, **kw: Any): ... - def visit_UUID(self, type_: Any, **kw: Any): ... - def visit_large_binary(self, type_: Any, **kw: Any): ... - def visit_BYTEA(self, type_: Any, **kw: Any): ... - def visit_ARRAY(self, type_: Any, **kw: Any): ... - -class PGIdentifierPreparer(compiler.IdentifierPreparer): - reserved_words: Any = ... - def format_type(self, type_: Any, use_schema: bool = ...): ... - -class PGInspector(reflection.Inspector): - def __init__(self, conn: Any) -> None: ... - def get_table_oid(self, table_name: Any, schema: Optional[Any] = ...): ... - def get_enums(self, schema: Optional[Any] = ...): ... - def get_foreign_table_names(self, schema: Optional[Any] = ...): ... - def get_view_names(self, schema: Optional[Any] = ..., include: Any = ...): ... - -class CreateEnumType(schema._CreateDropBase[str]): - __visit_name__: str = ... - -class DropEnumType(schema._CreateDropBase[str]): - __visit_name__: str = ... - -class PGExecutionContext(default.DefaultExecutionContext): - def fire_sequence(self, seq: Any, type_: Any): ... - def get_insert_default(self, column: Any): ... - def should_autocommit_text(self, statement: Any): ... - -class PGDialect(default.DefaultDialect): - name: str = ... - supports_alter: bool = ... - max_identifier_length: int = ... - supports_sane_rowcount: bool = ... - supports_native_enum: bool = ... - supports_native_boolean: bool = ... - supports_smallserial: bool = ... - supports_sequences: bool = ... - sequences_optional: bool = ... - preexecute_autoincrement_sequences: bool = ... - postfetch_lastrowid: bool = ... - supports_comments: bool = ... - supports_default_values: bool = ... - supports_empty_insert: bool = ... - supports_multivalues_insert: bool = ... - default_paramstyle: str = ... - ischema_names: Any = ... - colspecs: Any = ... - statement_compiler: Any = ... - ddl_compiler: Any = ... - type_compiler: Any = ... - preparer: Any = ... - execution_ctx_cls: Any = ... - inspector: Any = ... - isolation_level: Any = ... - construct_arguments: Any = ... - reflection_options: Any = ... - def __init__(self, isolation_level: Optional[Any] = ..., json_serializer: Optional[Any] = ..., - json_deserializer: Optional[Any] = ..., **kwargs: Any) -> None: ... - implicit_returning: Any = ... - def initialize(self, connection: Any) -> None: ... - def on_connect(self): ... - def set_isolation_level(self, connection: Any, level: Any) -> None: ... - def get_isolation_level(self, connection: Any): ... - def do_begin_twophase(self, connection: Any, xid: Any) -> None: ... - def do_prepare_twophase(self, connection: Any, xid: Any) -> None: ... - def do_rollback_twophase(self, connection: Any, xid: Any, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_commit_twophase(self, connection: Any, xid: Any, is_prepared: bool = ..., recover: bool = ...) -> None: ... - def do_recover_twophase(self, connection: Any): ... - def has_schema(self, connection: Any, schema: Any): ... - def has_table(self, connection: Any, table_name: Any, schema: Optional[Any] = ...): ... - def has_sequence(self, connection: Any, sequence_name: Any, schema: Optional[Any] = ...): ... - def has_type(self, connection: Any, type_name: Any, schema: Optional[Any] = ...): ... - def get_table_oid(self, connection: Any, table_name: Any, schema: Optional[Any] = ..., **kw: Any): ... - def get_schema_names(self, connection: Any, **kw: Any): ... - def get_table_names(self, connection: Any, schema: Optional[Any] = ..., **kw: Any): ... - def get_view_names(self, connection: Any, schema: Optional[Any] = ..., include: Any = ..., **kw: Any): ... - def get_view_definition(self, connection: Any, view_name: Any, schema: Optional[Any] = ..., **kw: Any): ... - def get_columns(self, connection: Any, table_name: Any, schema: Optional[Any] = ..., **kw: Any): ... - def get_pk_constraint(self, connection: Any, table_name: Any, schema: Optional[Any] = ..., **kw: Any): ... - def get_foreign_keys(self, connection: Any, table_name: Any, schema: Optional[Any] = ..., - postgresql_ignore_search_path: bool = ..., **kw: Any): ... - def get_indexes(self, connection: Any, table_name: Any, schema: Optional[Any] = ..., **kw: Any): ... - def get_unique_constraints(self, connection: Any, table_name: Any, schema: Optional[Any] = ..., **kw: Any): ... - def get_table_comment(self, connection: Any, table_name: Any, schema: Optional[Any] = ..., **kw: Any): ... - def get_check_constraints(self, connection: Any, table_name: Any, schema: Optional[Any] = ..., **kw: Any): ... diff --git a/sqlalchemy/dialects/postgresql/dml.pyi b/sqlalchemy/dialects/postgresql/dml.pyi deleted file mode 100644 index 35916cd0..00000000 --- a/sqlalchemy/dialects/postgresql/dml.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from ...sql.dml import Insert as _StandardInsert -from ...sql.elements import ClauseElement -from typing import Any, Optional - -class Insert(_StandardInsert): - def excluded(self): ... - def on_conflict_do_update(self, constraint: Optional[Any] = ..., index_elements: Optional[Any] = ..., - index_where: Optional[Any] = ..., set_: Optional[Any] = ..., - where: Optional[Any] = ...): ... - def on_conflict_do_nothing(self, constraint: Optional[Any] = ..., index_elements: Optional[Any] = ..., - index_where: Optional[Any] = ...): ... - -insert: Any - -class OnConflictClause(ClauseElement): - constraint_target: Any = ... - inferred_target_elements: Any = ... - inferred_target_whereclause: Any = ... - def __init__(self, constraint: Optional[Any] = ..., index_elements: Optional[Any] = ..., - index_where: Optional[Any] = ...) -> None: ... - -class OnConflictDoNothing(OnConflictClause): - __visit_name__: str = ... - -class OnConflictDoUpdate(OnConflictClause): - __visit_name__: str = ... - update_values_to_set: Any = ... - update_whereclause: Any = ... - def __init__(self, constraint: Optional[Any] = ..., index_elements: Optional[Any] = ..., - index_where: Optional[Any] = ..., set_: Optional[Any] = ..., - where: Optional[Any] = ...) -> None: ... diff --git a/sqlalchemy/dialects/postgresql/ext.pyi b/sqlalchemy/dialects/postgresql/ext.pyi deleted file mode 100644 index f8e17474..00000000 --- a/sqlalchemy/dialects/postgresql/ext.pyi +++ /dev/null @@ -1,38 +0,0 @@ -from ...sql import expression, functions, visitors -from ...sql.schema import ColumnCollectionConstraint -from ...sql.elements import ColumnElement -from ...sql.type_api import TypeEngine -from ...engine.base import Engine, Connection -from .array import ARRAY -from typing import Any, Optional, Union, TypeVar, Dict, Tuple, Type, overload - -_T = TypeVar('_T') -_AOB = TypeVar('_AOB', bound=aggregate_order_by) - -class aggregate_order_by(expression.ColumnElement[Any]): - __visit_name__: str = ... - target: expression.ColumnElement[Any] = ... - order_by: Any = ... - def __init__(self, target: expression.ColumnElement[Any], *order_by: expression.ClauseElement) -> None: ... - def self_group(self: _AOB, against: Optional[Any] = ...) -> _AOB: ... - def get_children(self, **kwargs: Any) -> Tuple[expression.ColumnElement[Any], Any]: ... - -_EC = TypeVar('_EC', bound=ExcludeConstraint) - -class ExcludeConstraint(ColumnCollectionConstraint): - __visit_name__: str = ... - where: Optional[visitors.Visitable] = ... - operators: Dict[str, Any] = ... - using: str = ... - def __init__(self, *elements: Any, name: str = ..., deferrable: bool = ..., initially: str = ..., using: str = ..., - where: Optional[Union[str, bool, visitors.Visitable]] = ...) -> None: ... - def copy(self: _EC, **kw: Any) -> _EC: ... - -@overload -def array_agg(self, *args: ColumnElement[Any], bind: Optional[Union[Engine, Connection]] = ..., - type_: Type[TypeEngine[_T]]) -> functions.array_agg[_T]: ... -@overload -def array_agg(self, *args: ColumnElement[Any], bind: Optional[Union[Engine, Connection]] = ..., - type_: TypeEngine[_T]) -> functions.array_agg[_T]: ... -@overload -def array_agg(self, *args: ColumnElement[_T], bind: Optional[Union[Engine, Connection]] = ...) -> functions.array_agg[_T]: ... diff --git a/sqlalchemy/dialects/postgresql/hstore.pyi b/sqlalchemy/dialects/postgresql/hstore.pyi deleted file mode 100644 index 46db8b93..00000000 --- a/sqlalchemy/dialects/postgresql/hstore.pyi +++ /dev/null @@ -1,58 +0,0 @@ -from ... import types as sqltypes -from ...sql import functions as sqlfunc, type_api -from .array import ARRAY -from typing import Any, Optional, Mapping, Type, List, Text - -class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine[Mapping[str, Any]]): - __visit_name__: str = ... - hashable: bool = ... - text_type: type_api.TypeEngine[Text] = ... - def __init__(self, text_type: Optional[type_api.TypeEngine[Text]] = ...) -> None: ... - class Comparator(type_api.TypeEngine.Comparator): - def has_key(self, other: Any): ... - def has_all(self, other: Any): ... - def has_any(self, other: Any): ... - def contains(self, other: Any, **kwargs: Any): ... - def contained_by(self, other: Any): ... - def defined(self, key: Any) -> _HStoreDefinedFunction: ... - def delete(self, key: Any) -> _HStoreDeleteFunction: ... - def slice(self, array: Any) -> _HStoreSliceFunction: ... - def keys(self) -> _HStoreKeysFunction: ... - def vals(self) -> _HStoreValsFunction: ... - def array(self) -> _HStoreArrayFunction: ... - def matrix(self) -> _HStoreMatrixFunction: ... - comparator_factory: Type[HSTORE.Comparator] = ... - def bind_processor(self, dialect: Any): ... - def result_processor(self, dialect: Any, coltype: Any): ... - -class hstore(sqlfunc.GenericFunction[Mapping[str, Any]]): - type: HSTORE = ... - name: str = ... - -class _HStoreDefinedFunction(sqlfunc.GenericFunction[bool]): - type: sqltypes.Boolean = ... - name: str = ... - -class _HStoreDeleteFunction(sqlfunc.GenericFunction[Mapping[str, Any]]): - type: HSTORE = ... - name: str = ... - -class _HStoreSliceFunction(sqlfunc.GenericFunction[Mapping[str, Any]]): - type: HSTORE = ... - name: str = ... - -class _HStoreKeysFunction(sqlfunc.GenericFunction[List[Text]]): - type: ARRAY[Text] = ... - name: str = ... - -class _HStoreValsFunction(sqlfunc.GenericFunction[List[Text]]): - type: ARRAY[Text] = ... - name: str = ... - -class _HStoreArrayFunction(sqlfunc.GenericFunction[List[Text]]): - type: ARRAY[Text] = ... - name: str = ... - -class _HStoreMatrixFunction(sqlfunc.GenericFunction[List[Text]]): - type: ARRAY[Text] = ... - name: str = ... diff --git a/sqlalchemy/dialects/postgresql/json.pyi b/sqlalchemy/dialects/postgresql/json.pyi deleted file mode 100644 index 21dbd415..00000000 --- a/sqlalchemy/dialects/postgresql/json.pyi +++ /dev/null @@ -1,6 +0,0 @@ -import json as json - -from ... import types as sqltypes - -class JSON(sqltypes.JSON): ... -class JSONB(JSON): ... diff --git a/sqlalchemy/dialects/postgresql/ranges.pyi b/sqlalchemy/dialects/postgresql/ranges.pyi deleted file mode 100644 index ae3e5213..00000000 --- a/sqlalchemy/dialects/postgresql/ranges.pyi +++ /dev/null @@ -1,36 +0,0 @@ -from ... import types as _sqltypes -from ...sql.type_api import TypeEngine -from typing import Any - -class RangeOperators: - class comparator_factory(TypeEngine.Comparator): - def __ne__(self, other: Any): ... - def contains(self, other: Any, **kw: Any): ... - def contained_by(self, other: Any): ... - def overlaps(self, other: Any): ... - def strictly_left_of(self, other: Any): ... - __lshift__: Any = ... - def strictly_right_of(self, other: Any): ... - __rshift__: Any = ... - def not_extend_right_of(self, other: Any): ... - def not_extend_left_of(self, other: Any): ... - def adjacent_to(self, other: Any): ... - def __add__(self, other: Any): ... - -class INT4RANGE(RangeOperators, _sqltypes.TypeEngine[Any]): - __visit_name__: str = ... - -class INT8RANGE(RangeOperators, _sqltypes.TypeEngine[Any]): - __visit_name__: str = ... - -class NUMRANGE(RangeOperators, _sqltypes.TypeEngine[Any]): - __visit_name__: str = ... - -class DATERANGE(RangeOperators, _sqltypes.TypeEngine[Any]): - __visit_name__: str = ... - -class TSRANGE(RangeOperators, _sqltypes.TypeEngine[Any]): - __visit_name__: str = ... - -class TSTZRANGE(RangeOperators, _sqltypes.TypeEngine[Any]): - __visit_name__: str = ... diff --git a/sqlalchemy/dialects/sqlite/__init__.pyi b/sqlalchemy/dialects/sqlite/__init__.pyi deleted file mode 100644 index 6059ba87..00000000 --- a/sqlalchemy/dialects/sqlite/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from typing import Any - -def __getattr__(attr: str) -> Any: ... diff --git a/sqlalchemy/dialects/sybase/__init__.pyi b/sqlalchemy/dialects/sybase/__init__.pyi deleted file mode 100644 index 6059ba87..00000000 --- a/sqlalchemy/dialects/sybase/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from typing import Any - -def __getattr__(attr: str) -> Any: ... diff --git a/sqlalchemy/engine/__init__.pyi b/sqlalchemy/engine/__init__.pyi deleted file mode 100644 index f4a89e08..00000000 --- a/sqlalchemy/engine/__init__.pyi +++ /dev/null @@ -1,34 +0,0 @@ -from typing import Any -from . import default as default - -from .interfaces import ( - Connectable as Connectable, - CreateEnginePlugin as CreateEnginePlugin, - Dialect as Dialect, - ExecutionContext as ExecutionContext, - ExceptionContext as ExceptionContext, - Compiled as Compiled, - TypeCompiler as TypeCompiler, -) - -from .base import ( - Connection as Connection, - Engine as Engine, - NestedTransaction as NestedTransaction, - RootTransaction as RootTransaction, - Transaction as Transaction, - TwoPhaseTransaction as TwoPhaseTransaction, -) - -from .result import ( - BaseRowProxy as BaseRowProxy, - BufferedColumnResultProxy as BufferedColumnResultProxy, - BufferedColumnRow as BufferedColumnRow, - BufferedRowResultProxy as BufferedRowResultProxy, - FullyBufferedResultProxy as FullyBufferedResultProxy, - ResultProxy as ResultProxy, - RowProxy as RowProxy, -) - -def create_engine(*args: Any, **kwargs: Any) -> Engine: ... -def engine_from_config(configuration: Any, prefix: str = ..., **kwargs: Any) -> Engine: ... diff --git a/sqlalchemy/engine/base.pyi b/sqlalchemy/engine/base.pyi deleted file mode 100644 index 5f9c1f06..00000000 --- a/sqlalchemy/engine/base.pyi +++ /dev/null @@ -1,123 +0,0 @@ -from typing import Any, Optional, Dict, Union, Text -from sqlalchemy import log -from sqlalchemy.sql.expression import ClauseElement -from sqlalchemy.sql.functions import FunctionElement -from sqlalchemy.schema import DDLElement, DefaultGenerator -from sqlalchemy.engine.interfaces import Compiled -from .interfaces import Connectable as Connectable, ExceptionContext as ExceptionContext -from .result import ResultProxy - -class Transaction(object): - connection: Any = ... - is_active: bool = ... - def __init__(self, connection, parent) -> None: ... - def close(self): ... - def rollback(self): ... - def commit(self): ... - def __enter__(self): ... - def __exit__(self, type, value, traceback): ... - -class RootTransaction(Transaction): - def __init__(self, connection) -> None: ... - -class NestedTransaction(Transaction): - def __init__(self, connection, parent) -> None: ... - -class TwoPhaseTransaction(Transaction): - xid: Any = ... - def __init__(self, connection, xid) -> None: ... - def prepare(self): ... - -class Connection(Connectable): - schema_for_object: Any = ... - engine: Any = ... - dialect: Any = ... - should_close_with_result: bool = ... - dispatch: Any = ... - def __init__(self, engine, connection: Optional[Any] = ..., close_with_result: bool = ..., - _branch_from: Optional[Any] = ..., _execution_options: Optional[Any] = ..., - _dispatch: Optional[Any] = ..., _has_events: Optional[Any] = ...) -> None: ... - def __enter__(self): ... - def __exit__(self, type, value, traceback): ... - def execution_options(self, **opt): ... - @property - def closed(self) -> bool: ... - @property - def invalidated(self) -> bool: ... - @property - def connection(self): ... - def get_isolation_level(self) -> str: ... - @property - def default_isolation_level(self) -> str: ... - @property - def info(self) -> Dict[Any, Any]: ... - def connect(self): ... - def contextual_connect(self, **kwargs): ... - def invalidate(self, exception: Optional[Any] = ...) -> None: ... - def detach(self) -> None: ... - def begin(self) -> Transaction: ... - def begin_nested(self) -> NestedTransaction: ... - def begin_twophase(self, xid: Optional[Any] = ...) -> TwoPhaseTransaction: ... - def recover_twophase(self): ... - def rollback_prepared(self, xid, recover: bool = ...): ... - def commit_prepared(self, xid, recover: bool = ...): ... - def in_transaction(self) -> bool: ... - def close(self) -> None: ... - def scalar(self, object, *multiparams, **params): ... - def execute(self, object, *multiparams, **params): ... - def transaction(self, callable_, *args, **kwargs): ... - def run_callable(self, callable_, *args, **kwargs): ... - -class ExceptionContextImpl(ExceptionContext): - engine: Any = ... - connection: Any = ... - sqlalchemy_exception: Any = ... - original_exception: Any = ... - execution_context: Any = ... - statement: Any = ... - parameters: Any = ... - is_disconnect: bool = ... - invalidate_pool_on_disconnect: bool = ... - def __init__(self, exception, sqlalchemy_exception, engine, connection, cursor, - statement, parameters, context, is_disconnect, - invalidate_pool_on_disconnect) -> None: ... - -class Engine(Connectable, log.Identified): - schema_for_object: Any = ... - pool: Any = ... - url: Any = ... - dialect: Any = ... - logging_name: Any = ... - echo: Any = ... - engine: Any = ... - def __init__(self, pool, dialect, url, logging_name: Optional[Any] = ..., echo: Optional[Any] = ..., - proxy: Optional[Any] = ..., execution_options: Optional[Any] = ...) -> None: ... - def update_execution_options(self, **opt): ... - def execution_options(self, **opt): ... - @property - def name(self): ... - @property - def driver(self): ... - def dispose(self) -> None: ... - def begin(self, close_with_result: bool = ...): ... - def transaction(self, callable_, *args, **kwargs): ... - def run_callable(self, callable_, *args, **kwargs): ... - def execute(self, - object: Union[Text, ClauseElement, FunctionElement, DDLElement, DefaultGenerator, Compiled], - *multiparams: Any, - **params: Any) -> ResultProxy: ... - def scalar(self, statement, *multiparams, **params): ... - def connect(self, **kwargs) -> Connection: ... - def contextual_connect(self, close_with_result: bool = ..., **kwargs): ... - def table_names(self, schema: Optional[Any] = ..., connection: Optional[Any] = ...): ... - def has_table(self, table_name, schema: Optional[Any] = ...): ... - def raw_connection(self, _connection: Optional[Any] = ...): ... - -class OptionEngine(Engine): - url: Any = ... - dialect: Any = ... - logging_name: Any = ... - echo: Any = ... - dispatch: Any = ... - def __init__(self, proxied, execution_options) -> None: ... - pool: Any = ... diff --git a/sqlalchemy/engine/default.pyi b/sqlalchemy/engine/default.pyi deleted file mode 100644 index e63a0cbb..00000000 --- a/sqlalchemy/engine/default.pyi +++ /dev/null @@ -1,146 +0,0 @@ -from typing import Any, Optional -from . import interfaces - -AUTOCOMMIT_REGEXP: Any = ... -SERVER_SIDE_CURSOR_RE: Any = ... - -class DefaultDialect(interfaces.Dialect): - statement_compiler: Any = ... - ddl_compiler: Any = ... - type_compiler: Any = ... - preparer: Any = ... - supports_alter: bool = ... - default_sequence_base: int = ... - execute_sequence_format: Any = ... - supports_views: bool = ... - supports_sequences: bool = ... - sequences_optional: bool = ... - preexecute_autoincrement_sequences: bool = ... - postfetch_lastrowid: bool = ... - implicit_returning: bool = ... - supports_right_nested_joins: bool = ... - supports_native_enum: bool = ... - supports_native_boolean: bool = ... - supports_simple_order_by_label: bool = ... - engine_config_types: Any = ... - supports_native_decimal: bool = ... - supports_unicode_statements: bool = ... - supports_unicode_binds: bool = ... - returns_unicode_strings: bool = ... - description_encoding: Any = ... - name: str = ... - max_identifier_length: int = ... - max_index_name_length: Any = ... - supports_sane_rowcount: bool = ... - supports_sane_multi_rowcount: bool = ... - dbapi_type_map: Any = ... - colspecs: Any = ... - default_paramstyle: str = ... - supports_default_values: bool = ... - supports_empty_insert: bool = ... - supports_multivalues_insert: bool = ... - supports_server_side_cursors: bool = ... - server_version_info: Any = ... - construct_arguments: Any = ... - requires_name_normalize: bool = ... - reflection_options: Any = ... - dbapi_exception_translation_map: Any = ... - convert_unicode: Any = ... - encoding: Any = ... - positional: bool = ... - dbapi: Any = ... - paramstyle: Any = ... - identifier_preparer: Any = ... - case_sensitive: Any = ... - label_length: Any = ... - def __init__(self, convert_unicode: bool = ..., encoding: str = ..., paramstyle: Optional[Any] = ..., - dbapi: Optional[Any] = ..., implicit_returning: Optional[Any] = ..., - supports_right_nested_joins: Optional[Any] = ..., case_sensitive: bool = ..., - supports_native_boolean: Optional[Any] = ..., - label_length: Optional[Any] = ..., **kwargs) -> None: ... - @property - def dialect_description(self): ... - @classmethod - def get_pool_class(cls, url): ... - default_schema_name: str = ... - default_isolation_level: Any = ... - def initialize(self, connection): ... - def on_connect(self): ... - def type_descriptor(self, typeobj): ... - def reflecttable(self, connection, table, include_columns, exclude_columns, **opts): ... - # Should be conn but using connection so mypy doesn't complain about superclass incompatibility - def get_pk_constraint(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def validate_identifier(self, ident): ... - def connect(self, *cargs, **cparams): ... - def create_connect_args(self, url): ... - def set_engine_execution_options(self, engine, opts): ... - def set_connection_execution_options(self, connection, opts): ... - def do_begin(self, dbapi_connection): ... - def do_rollback(self, dbapi_connection): ... - def do_commit(self, dbapi_connection): ... - def do_close(self, dbapi_connection): ... - def create_xid(self): ... - def do_savepoint(self, connection, name): ... - def do_rollback_to_savepoint(self, connection, name): ... - def do_release_savepoint(self, connection, name): ... - def do_executemany(self, cursor, statement, parameters, context: Optional[Any] = ...): ... - def do_execute(self, cursor, statement, parameters, context: Optional[Any] = ...): ... - def do_execute_no_params(self, *args, **kwargs): ... - def is_disconnect(self, e, connection, cursor): ... - def reset_isolation_level(self, dbapi_conn): ... - -class StrCompileDialect(DefaultDialect): - statement_compiler: Any = ... - ddl_compiler: Any = ... - type_compiler: Any = ... - preparer: Any = ... - supports_sequences: bool = ... - sequences_optional: bool = ... - preexecute_autoincrement_sequences: bool = ... - implicit_returning: bool = ... - supports_native_boolean: bool = ... - supports_simple_order_by_label: bool = ... - -class DefaultExecutionContext(interfaces.ExecutionContext): - isinsert: bool = ... - isupdate: bool = ... - isdelete: bool = ... - is_crud: bool = ... - is_text: bool = ... - isddl: bool = ... - executemany: bool = ... - compiled: Any = ... - statement: Any = ... - result_column_struct: Any = ... - returned_defaults: Any = ... - @property - def engine(self): ... - @property - def postfetch_cols(self): ... - @property - def prefetch_cols(self): ... - @property - def returning_cols(self): ... - @property - def no_parameters(self): ... - @property - def should_autocommit(self): ... - @property - def connection(self): ... - def should_autocommit_text(self, statement): ... - def create_cursor(self): ... - def create_server_side_cursor(self): ... - def pre_exec(self): ... - def post_exec(self): ... - def get_result_processor(self, type_, colname, coltype): ... - def get_lastrowid(self): ... - def handle_dbapi_exception(self, e): ... - def get_result_proxy(self): ... - @property - def rowcount(self): ... - def supports_sane_rowcount(self): ... - def supports_sane_multi_rowcount(self): ... - def lastrow_has_defaults(self): ... - def set_input_sizes(self, translate: Optional[Any] = ..., exclude_types: Optional[Any] = ...): ... - def get_insert_default(self, column): ... - def get_update_default(self, column): ... diff --git a/sqlalchemy/engine/interfaces.pyi b/sqlalchemy/engine/interfaces.pyi deleted file mode 100644 index 61cdcc46..00000000 --- a/sqlalchemy/engine/interfaces.pyi +++ /dev/null @@ -1,100 +0,0 @@ -from typing import Any, Optional, Union -from sqlalchemy.sql.expression import ClauseElement -from sqlalchemy.sql.functions import FunctionElement -from sqlalchemy.schema import DDLElement, DefaultGenerator -from .base import Connection -from .result import ResultProxy -from ..sql.compiler import Compiled as Compiled, TypeCompiler as TypeCompiler - -class Dialect(object): - @property - def name(self) -> str: ... - def create_connect_args(self, url): ... - @classmethod - def type_descriptor(cls, typeobj): ... - def initialize(self, connection): ... - def reflecttable(self, connection, table, include_columns, exclude_columns): ... - def get_columns(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_primary_keys(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_pk_constraint(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_foreign_keys(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_table_names(self, connection, schema: Optional[Any] = ..., **kw): ... - def get_temp_table_names(self, connection, schema: Optional[Any] = ..., **kw): ... - def get_view_names(self, connection, schema: Optional[Any] = ..., **kw): ... - def get_temp_view_names(self, connection, schema: Optional[Any] = ..., **kw): ... - def get_view_definition(self, connection, view_name, schema: Optional[Any] = ..., **kw): ... - def get_indexes(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_unique_constraints(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def get_check_constraints(self, connection, table_name, schema: Optional[Any] = ..., **kw): ... - def normalize_name(self, name): ... - def denormalize_name(self, name): ... - def has_table(self, connection, table_name, schema: Optional[Any] = ...): ... - def has_sequence(self, connection, sequence_name, schema: Optional[Any] = ...): ... - def do_begin(self, dbapi_connection): ... - def do_rollback(self, dbapi_connection): ... - def do_commit(self, dbapi_connection): ... - def do_close(self, dbapi_connection): ... - def create_xid(self): ... - def do_savepoint(self, connection, name): ... - def do_rollback_to_savepoint(self, connection, name): ... - def do_release_savepoint(self, connection, name): ... - def do_begin_twophase(self, connection, xid): ... - def do_prepare_twophase(self, connection, xid): ... - def do_rollback_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...): ... - def do_commit_twophase(self, connection, xid, is_prepared: bool = ..., recover: bool = ...): ... - def do_recover_twophase(self, connection): ... - def do_executemany(self, cursor, statement, parameters, context: Optional[Any] = ...): ... - def do_execute(self, cursor, statement, parameters, context: Optional[Any] = ...): ... - def do_execute_no_params(self, cursor, statement, parameters, context: Optional[Any] = ...): ... - def is_disconnect(self, e, connection, cursor): ... - def connect(self): ... - def reset_isolation_level(self, dbapi_conn): ... - def set_isolation_level(self, dbapi_conn, level): ... - def get_isolation_level(self, dbapi_conn): ... - @classmethod - def get_dialect_cls(cls, url): ... - @classmethod - def engine_created(cls, engine): ... - -class CreateEnginePlugin(object): - url: Any = ... - def __init__(self, url, kwargs) -> None: ... - def handle_dialect_kwargs(self, dialect_cls, dialect_args): ... - def handle_pool_kwargs(self, pool_cls, pool_args): ... - def engine_created(self, engine): ... - -class ExecutionContext(object): - exception: Any = ... - is_disconnect: bool = ... - def create_cursor(self): ... - def pre_exec(self): ... - def post_exec(self): ... - def result(self): ... - def handle_dbapi_exception(self, e): ... - def should_autocommit_text(self, statement): ... - def lastrow_has_defaults(self): ... - def get_rowcount(self): ... - -class Connectable(object): - def connect(self, **kwargs: Any) -> Connection: ... - def contextual_connect(self) -> Connection: ... - def create(self, entity, **kwargs): ... - def drop(self, entity, **kwargs): ... - def execute(self, - object: Union[str, ClauseElement, FunctionElement, DDLElement, DefaultGenerator, Compiled], - *multiparams: Any, - **params: Any) -> ResultProxy: ... - def scalar(self, object, *multiparams: Any, **params: Any) -> Any: ... - -class ExceptionContext(object): - connection: Any = ... - engine: Any = ... - cursor: Any = ... - statement: Any = ... - parameters: Any = ... - original_exception: Any = ... - sqlalchemy_exception: Any = ... - chained_exception: Any = ... - execution_context: Any = ... - is_disconnect: bool = ... - invalidate_pool_on_disconnect: bool = ... diff --git a/sqlalchemy/engine/reflection.pyi b/sqlalchemy/engine/reflection.pyi deleted file mode 100644 index 32cc830c..00000000 --- a/sqlalchemy/engine/reflection.pyi +++ /dev/null @@ -1,30 +0,0 @@ -from typing import Any, Optional - -def cache(fn, self, con, *args, **kw): ... - -class Inspector(object): - bind: Any = ... - engine: Any = ... - dialect: Any = ... - info_cache: Any = ... - def __init__(self, bind) -> None: ... - @classmethod - def from_engine(cls, bind): ... - @property - def default_schema_name(self) -> Any: ... - def get_schema_names(self): ... - def get_table_names(self, schema: Optional[Any] = ..., order_by: Optional[Any] = ...): ... - def get_sorted_table_and_fkc_names(self, schema: Optional[Any] = ...): ... - def get_temp_table_names(self): ... - def get_temp_view_names(self): ... - def get_table_options(self, table_name, schema: Optional[Any] = ..., **kw): ... - def get_view_names(self, schema: Optional[Any] = ...): ... - def get_view_definition(self, view_name, schema: Optional[Any] = ...): ... - def get_columns(self, table_name, schema: Optional[Any] = ..., **kw): ... - def get_primary_keys(self, table_name, schema: Optional[Any] = ..., **kw): ... - def get_pk_constraint(self, table_name, schema: Optional[Any] = ..., **kw): ... - def get_foreign_keys(self, table_name, schema: Optional[Any] = ..., **kw): ... - def get_indexes(self, table_name, schema: Optional[Any] = ..., **kw): ... - def get_unique_constraints(self, table_name, schema: Optional[Any] = ..., **kw): ... - def get_check_constraints(self, table_name, schema: Optional[Any] = ..., **kw): ... - def reflecttable(self, table, include_columns, exclude_columns: Any = ..., _extend_on: Optional[Any] = ...): ... diff --git a/sqlalchemy/engine/result.pyi b/sqlalchemy/engine/result.pyi deleted file mode 100644 index cd463a63..00000000 --- a/sqlalchemy/engine/result.pyi +++ /dev/null @@ -1,93 +0,0 @@ -import sys - -from typing import Any, List, Mapping, Optional, Iterator, Union, AbstractSet, Tuple -from ..sql.schema import Column - -if sys.version_info >= (3, 0): - _RowItems = AbstractSet[Tuple[str, Any]] -else: - _RowItems = List[Tuple[str, Any]] - -def rowproxy_reconstructor(cls, state): ... - -class BaseRowProxy(Mapping[str, Any]): - def __init__(self, parent, row, processors, keymap) -> None: ... - def __reduce__(self): ... - def values(self): ... - def __iter__(self): ... - def __len__(self) -> int: ... - def __getitem__(self, key: Union[str, int, Column]) -> Any: ... - def __getattr__(self, name): ... - -class RowProxy(BaseRowProxy): - def __contains__(self, key): ... - __hash__: Any = ... - def __lt__(self, other): ... - def __le__(self, other): ... - def __ge__(self, other): ... - def __gt__(self, other): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def has_key(self, key): ... - def items(self) -> _RowItems: ... # type: ignore[override] - def keys(self): ... - def iterkeys(self): ... - def itervalues(self): ... - -class ResultMetaData(object): - case_sensitive: Any = ... - matched_on_name: bool = ... - def __init__(self, parent, cursor_description) -> None: ... - -class ResultProxy: - out_parameters: Any = ... - closed: bool = ... - context: Any = ... - dialect: Any = ... - cursor: Any = ... - connection: Any = ... - def __init__(self, context) -> None: ... - def keys(self): ... - @property - def rowcount(self) -> int: ... - @property - def lastrowid(self): ... - @property - def returns_rows(self): ... - @property - def is_insert(self): ... - def close(self) -> None: ... - def __iter__(self) -> Iterator[RowProxy]: ... - def __next__(self) -> RowProxy: ... - def next(self) -> RowProxy: ... - @property - def inserted_primary_key(self): ... - def last_updated_params(self): ... - def last_inserted_params(self): ... - @property - def returned_defaults(self): ... - def lastrow_has_defaults(self): ... - def postfetch_cols(self): ... - def prefetch_cols(self): ... - def supports_sane_rowcount(self): ... - def supports_sane_multi_rowcount(self): ... - def process_rows(self, rows): ... - def fetchall(self) -> List[RowProxy]: ... - def fetchmany(self, size: Optional[int] = ...) -> List[RowProxy]: ... - def fetchone(self) -> Optional[RowProxy]: ... - def first(self) -> Optional[RowProxy]: ... - # Note: The return type `Any` should be a DB API 2 value type once defined - # TODO: See typeshed/#1037 - def scalar(self) -> Any: ... - -class BufferedRowResultProxy(ResultProxy): - size_growth: Any = ... - -class FullyBufferedResultProxy(ResultProxy): ... - -class BufferedColumnRow(RowProxy): - def __init__(self, parent, row, processors, keymap) -> None: ... - -class BufferedColumnResultProxy(ResultProxy): - def fetchall(self): ... - def fetchmany(self, size: Optional[Any] = ...): ... diff --git a/sqlalchemy/engine/strategies.pyi b/sqlalchemy/engine/strategies.pyi deleted file mode 100644 index da3d0fa1..00000000 --- a/sqlalchemy/engine/strategies.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from typing import Any, Type -from . import base, threadlocal - -strategies: Any = ... - -class EngineStrategy(object): - def __init__(self) -> None: ... - def create(self, *args, **kwargs): ... - -class DefaultEngineStrategy(EngineStrategy): - def create(self, name_or_url, **kwargs): ... - -class PlainEngineStrategy(DefaultEngineStrategy): - name: str - engine_cls: Type[base.Engine] - -class ThreadLocalEngineStrategy(DefaultEngineStrategy): - name: str = ... - engine_cls: Type[threadlocal.TLEngine] = ... - -class MockEngineStrategy(EngineStrategy): - name: str = ... - def create(self, name_or_url, executor, **kwargs) -> MockEngineStrategy.MockConnection: ... # type: ignore - class MockConnection(base.Connectable): - execute: Any = ... - def __init__(self, dialect, execute) -> None: ... - engine: Any = ... - dialect: Any = ... - name: str = ... - schema_for_object: Any = ... - def contextual_connect(self, **kwargs): ... - def execution_options(self, **kw): ... - def compiler(self, statement, parameters, **kwargs): ... - def create(self, entity, **kwargs): ... - def drop(self, entity, **kwargs): ... diff --git a/sqlalchemy/engine/threadlocal.pyi b/sqlalchemy/engine/threadlocal.pyi deleted file mode 100644 index 4d1ecbf0..00000000 --- a/sqlalchemy/engine/threadlocal.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Any, Optional -from . import base - -class TLConnection(base.Connection): - def __init__(self, *arg, **kw) -> None: ... - def close(self): ... - -class TLEngine(base.Engine): - def __init__(self, *args, **kwargs) -> None: ... - def contextual_connect(self, **kw): ... - def begin_twophase(self, xid: Optional[Any] = ...): ... - def begin_nested(self): ... - def begin(self): ... - def __enter__(self): ... - def __exit__(self, type, value, traceback): ... - def prepare(self): ... - def commit(self): ... - def rollback(self): ... - def dispose(self): ... - @property - def closed(self): ... - def close(self): ... diff --git a/sqlalchemy/engine/url.pyi b/sqlalchemy/engine/url.pyi deleted file mode 100644 index 742e7342..00000000 --- a/sqlalchemy/engine/url.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Any, Optional, Dict, Text, Union - -class URL(object): - drivername: str = ... - username: str = ... - password: Any - host: Any = ... - port: Any = ... - database: str = ... - query: Dict[str, Any] = ... - def __init__(self, drivername, username: Optional[Any] = ..., password: Optional[Any] = ..., - host: Optional[Any] = ..., port: Optional[Any] = ..., database: Optional[Any] = ..., - query: Optional[Any] = ...) -> None: ... - def __to_string__(self, hide_password: bool = ...) -> str: ... - def __hash__(self): ... - def __eq__(self, other): ... - def get_backend_name(self): ... - def get_driver_name(self): ... - def get_dialect(self): ... - def translate_connect_args(self, names: Any = ..., **kw): ... - -def make_url(name_or_url: Union[Text, bytes]) -> URL: ... diff --git a/sqlalchemy/engine/util.pyi b/sqlalchemy/engine/util.pyi deleted file mode 100644 index afe33213..00000000 --- a/sqlalchemy/engine/util.pyi +++ /dev/null @@ -1,2 +0,0 @@ -def connection_memoize(key): ... -def py_fallback(): ... diff --git a/sqlalchemy/event/__init__.pyi b/sqlalchemy/event/__init__.pyi deleted file mode 100644 index 34b8ccc2..00000000 --- a/sqlalchemy/event/__init__.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from .api import ( - CANCEL as CANCEL, - NO_RETVAL as NO_RETVAL, - listen as listen, - listens_for as listens_for, - remove as remove, - contains as contains -) -from .base import Events as Events, dispatcher as dispatcher -from .attr import RefCollection as RefCollection diff --git a/sqlalchemy/event/api.pyi b/sqlalchemy/event/api.pyi deleted file mode 100644 index 53d20e65..00000000 --- a/sqlalchemy/event/api.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import Any - -CANCEL: Any = ... -NO_RETVAL: Any = ... - -def listen(target, identifier, fn, *args, **kw): ... -def listens_for(target, identifier, *args, **kw): ... -def remove(target, identifier, fn): ... -def contains(target, identifier, fn): ... diff --git a/sqlalchemy/event/attr.pyi b/sqlalchemy/event/attr.pyi deleted file mode 100644 index 27d65e8f..00000000 --- a/sqlalchemy/event/attr.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from typing import Any -from .. import util - -class RefCollection(util.MemoizedSlots): ... diff --git a/sqlalchemy/event/base.pyi b/sqlalchemy/event/base.pyi deleted file mode 100644 index 4797d8d7..00000000 --- a/sqlalchemy/event/base.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from typing import Any, Optional - -class _EventMeta(type): - def __init__(cls, classname, bases, dict_) -> None: ... - -class Events(metaclass=_EventMeta): ... - -class dispatcher(object): - dispatch_cls: Any = ... - events: Any = ... - def __init__(self, events) -> None: ... - def __get__(self, obj, cls): ... diff --git a/sqlalchemy/event/registry.pyi b/sqlalchemy/event/registry.pyi deleted file mode 100644 index 90190ea8..00000000 --- a/sqlalchemy/event/registry.pyi +++ /dev/null @@ -1 +0,0 @@ -# No public APIs here. diff --git a/sqlalchemy/events.pyi b/sqlalchemy/events.pyi deleted file mode 100644 index 2b9dae3a..00000000 --- a/sqlalchemy/events.pyi +++ /dev/null @@ -1,50 +0,0 @@ -from . import event - -class DDLEvents(event.Events): - def before_create(self, target, connection, **kw): ... - def after_create(self, target, connection, **kw): ... - def before_drop(self, target, connection, **kw): ... - def after_drop(self, target, connection, **kw): ... - def before_parent_attach(self, target, parent): ... - def after_parent_attach(self, target, parent): ... - def column_reflect(self, inspector, table, column_info): ... - -class PoolEvents(event.Events): - def connect(self, dbapi_connection, connection_record): ... - def first_connect(self, dbapi_connection, connection_record): ... - def checkout(self, dbapi_connection, connection_record, connection_proxy): ... - def checkin(self, dbapi_connection, connection_record): ... - def reset(self, dbapi_connection, connection_record): ... - def invalidate(self, dbapi_connection, connection_record, exception): ... - def soft_invalidate(self, dbapi_connection, connection_record, exception): ... - def close(self, dbapi_connection, connection_record): ... - def detach(self, dbapi_connection, connection_record): ... - def close_detached(self, dbapi_connection): ... - -class ConnectionEvents(event.Events): - def before_execute(self, conn, clauseelement, multiparams, params): ... - def after_execute(self, conn, clauseelement, multiparams, params, result): ... - def before_cursor_execute(self, conn, cursor, statement, parameters, context, executemany): ... - def after_cursor_execute(self, conn, cursor, statement, parameters, context, executemany): ... - def dbapi_error(self, conn, cursor, statement, parameters, context, exception): ... - def handle_error(self, exception_context): ... - def engine_connect(self, conn, branch): ... - def set_connection_execution_options(self, conn, opts): ... - def set_engine_execution_options(self, engine, opts): ... - def engine_disposed(self, engine): ... - def begin(self, conn): ... - def rollback(self, conn): ... - def commit(self, conn): ... - def savepoint(self, conn, name): ... - def rollback_savepoint(self, conn, name, context): ... - def release_savepoint(self, conn, name, context): ... - def begin_twophase(self, conn, xid): ... - def prepare_twophase(self, conn, xid): ... - def rollback_twophase(self, conn, xid, is_prepared): ... - def commit_twophase(self, conn, xid, is_prepared): ... - -class DialectEvents(event.Events): - def do_connect(self, dialect, conn_rec, cargs, cparams): ... - def do_executemany(self, cursor, statement, parameters, context): ... - def do_execute_no_params(self, cursor, statement, context): ... - def do_execute(self, cursor, statement, parameters, context): ... diff --git a/sqlalchemy/exc.pyi b/sqlalchemy/exc.pyi deleted file mode 100644 index 9a3ca1f6..00000000 --- a/sqlalchemy/exc.pyi +++ /dev/null @@ -1,81 +0,0 @@ -from typing import Any, Optional - -class SQLAlchemyError(Exception): - code: Optional[str] = ... -class ArgumentError(SQLAlchemyError): ... - -class ObjectNotExecutableError(ArgumentError): - def __init__(self, target) -> None: ... - -class NoSuchModuleError(ArgumentError): ... -class NoForeignKeysError(ArgumentError): ... -class AmbiguousForeignKeysError(ArgumentError): ... - -class CircularDependencyError(SQLAlchemyError): - cycles: Any = ... - edges: Any = ... - def __init__(self, message, cycles, edges, msg: Optional[Any] = ...) -> None: ... - def __reduce__(self): ... - -class CompileError(SQLAlchemyError): ... - -class UnsupportedCompilationError(CompileError): - def __init__(self, compiler, element_type) -> None: ... - -class IdentifierError(SQLAlchemyError): ... -class DisconnectionError(SQLAlchemyError): - invalidate_pool: bool = ... -class InvalidatePoolError(DisconnectionError): ... -class TimeoutError(SQLAlchemyError): ... -class InvalidRequestError(SQLAlchemyError): ... -class NoInspectionAvailable(InvalidRequestError): ... -class ResourceClosedError(InvalidRequestError): ... -class NoSuchColumnError(KeyError, InvalidRequestError): ... -class NoReferenceError(InvalidRequestError): ... - -class NoReferencedTableError(NoReferenceError): - table_name: str = ... - def __init__(self, message, tname) -> None: ... - def __reduce__(self): ... - -class NoReferencedColumnError(NoReferenceError): - table_name: str = ... - column_name: str = ... - def __init__(self, message, tname, cname) -> None: ... - def __reduce__(self): ... - -class NoSuchTableError(InvalidRequestError): ... -class UnboundExecutionError(InvalidRequestError): ... -class DontWrapMixin(object): ... - -UnmappedColumnError: Any - -class StatementError(SQLAlchemyError): - statement: Any = ... - params: Any = ... - orig: Any = ... - detail: Any = ... - def __init__(self, message, statement, params, orig) -> None: ... - def add_detail(self, msg): ... - def __reduce__(self): ... - def __unicode__(self): ... - -class DBAPIError(StatementError): - @classmethod - def instance(cls, statement, params, orig, dbapi_base_err, connection_invalidated: bool = ..., - dialect: Optional[Any] = ...): ... - def __reduce__(self): ... - connection_invalidated: Any = ... - def __init__(self, statement, params, orig, connection_invalidated: bool = ...) -> None: ... - -class InterfaceError(DBAPIError): ... -class DatabaseError(DBAPIError): ... -class DataError(DatabaseError): ... -class OperationalError(DatabaseError): ... -class IntegrityError(DatabaseError): ... -class InternalError(DatabaseError): ... -class ProgrammingError(DatabaseError): ... -class NotSupportedError(DatabaseError): ... -class SADeprecationWarning(DeprecationWarning): ... -class SAPendingDeprecationWarning(PendingDeprecationWarning): ... -class SAWarning(RuntimeWarning): ... diff --git a/sqlalchemy/ext/__init__.pyi b/sqlalchemy/ext/__init__.pyi deleted file mode 100644 index 48f7ea4c..00000000 --- a/sqlalchemy/ext/__init__.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from . import ( - declarative as declarative, - associationproxy as associationproxy, - automap as automap, - baked as baked, - compiler as compiler, - horizontal_shard as horizontal_shard, - hybrid as hybrid, - indexable as indexable, - instrumentation as instrumentation, - mutable as mutable, - orderinglist as orderinglist, - serializer as serializer -) diff --git a/sqlalchemy/ext/associationproxy.pyi b/sqlalchemy/ext/associationproxy.pyi deleted file mode 100644 index adeac8c1..00000000 --- a/sqlalchemy/ext/associationproxy.pyi +++ /dev/null @@ -1,161 +0,0 @@ -from typing import Any, Optional -from ..orm import interfaces - -def association_proxy(target_collection, attr, **kw): ... - -ASSOCIATION_PROXY: Any = ... - -class AssociationProxy(interfaces.InspectionAttrInfo): - is_attribute: bool = ... - extension_type: Any = ... - target_collection: Any = ... - value_attr: Any = ... - creator: Any = ... - getset_factory: Any = ... - proxy_factory: Any = ... - proxy_bulk_set: Any = ... - owning_class: Any = ... - key: Any = ... - collection_class: Any = ... - info: Any = ... - def __init__(self, target_collection, attr, creator: Optional[Any] = ..., - getset_factory: Optional[Any] = ..., proxy_factory: Optional[Any] = ..., - proxy_bulk_set: Optional[Any] = ..., info: Optional[Any] = ...) -> None: ... - @property - def remote_attr(self): ... - @property - def local_attr(self): ... - @property - def attr(self): ... - @property - def target_class(self): ... - @property - def scalar(self): ... - def __get__(self, obj, class_): ... - def __set__(self, obj, values): ... - def __delete__(self, obj): ... - def any(self, criterion: Optional[Any] = ..., **kwargs): ... - def has(self, criterion: Optional[Any] = ..., **kwargs): ... - def contains(self, obj): ... - def __eq__(self, obj): ... - def __ne__(self, obj): ... - -class _lazy_collection(object): - ref: Any = ... - target: Any = ... - def __init__(self, obj, target) -> None: ... - def __call__(self): ... - -class _AssociationCollection(object): - lazy_collection: Any = ... - creator: Any = ... - getter: Any = ... - setter: Any = ... - parent: Any = ... - def __init__(self, lazy_collection, creator, getter, setter, parent) -> None: ... - col: Any = ... - def __len__(self): ... - def __bool__(self): ... - __nonzero__: Any = ... - -# these classes are returned by AssociationProxy.__get__ -class _AssociationList(_AssociationCollection): - def __getitem__(self, index): ... - def __setitem__(self, index, value): ... - def __delitem__(self, index): ... - def __contains__(self, value): ... - def __getslice__(self, start, end): ... - def __setslice__(self, start, end, values): ... - def __delslice__(self, start, end): ... - def __iter__(self): ... - def append(self, value): ... - def count(self, value): ... - def extend(self, values): ... - def insert(self, index, value): ... - def pop(self, index: int = ...): ... - def remove(self, value): ... - def reverse(self): ... - def sort(self): ... - def clear(self): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def __lt__(self, other): ... - def __le__(self, other): ... - def __gt__(self, other): ... - def __ge__(self, other): ... - def __cmp__(self, other): ... - def __add__(self, iterable): ... - def __radd__(self, iterable): ... - def __mul__(self, n): ... - __rmul__: Any = ... - def __iadd__(self, iterable): ... - def __imul__(self, n): ... - def copy(self): ... - def __hash__(self): ... - -class _AssociationDict(_AssociationCollection): - def __getitem__(self, key): ... - def __setitem__(self, key, value): ... - def __delitem__(self, key): ... - def __contains__(self, key): ... - def has_key(self, key): ... - def __iter__(self): ... - def clear(self): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def __lt__(self, other): ... - def __le__(self, other): ... - def __gt__(self, other): ... - def __ge__(self, other): ... - def __cmp__(self, other): ... - def get(self, key, default: Optional[Any] = ...): ... - def setdefault(self, key, default: Optional[Any] = ...): ... - def keys(self): ... - def iteritems(self): ... - def itervalues(self): ... - def iterkeys(self): ... - def values(self): ... - def items(self): ... - def pop(self, key, default: Any = ...): ... - def popitem(self): ... - def update(self, *a, **kw): ... - def copy(self): ... - def __hash__(self): ... - -class _AssociationSet(_AssociationCollection): - def __len__(self): ... - def __bool__(self): ... - def __nonzero__(self): ... - def __contains__(self, value): ... - def __iter__(self): ... - def add(self, value): ... - def discard(self, value): ... - def remove(self, value): ... - def pop(self): ... - def update(self, other): ... - def __ior__(self, other): ... - def union(self, other): ... - def __or__(self, other): ... - def difference(self, other): ... - def __sub__(self, other): ... - def difference_update(self, other): ... - def __isub__(self, other): ... - def intersection(self, other): ... - def __and__(self, other): ... - def intersection_update(self, other): ... - def __iand__(self, other): ... - def symmetric_difference(self, other): ... - def __xor__(self, other): ... - def symmetric_difference_update(self, other): ... - def __ixor__(self, other): ... - def issubset(self, other): ... - def issuperset(self, other): ... - def clear(self): ... - def copy(self): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def __lt__(self, other): ... - def __le__(self, other): ... - def __gt__(self, other): ... - def __ge__(self, other): ... - def __hash__(self): ... diff --git a/sqlalchemy/ext/automap.pyi b/sqlalchemy/ext/automap.pyi deleted file mode 100644 index e08a6dfe..00000000 --- a/sqlalchemy/ext/automap.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from typing import Any, Optional - -def classname_for_table(base, tablename, table) -> str: ... -def name_for_scalar_relationship(base, local_cls, referred_cls, constraint) -> str: ... -def name_for_collection_relationship(base, local_cls, referred_cls, constraint) -> str: ... -def generate_relationship(base, direction, return_fn, attrname, local_cls, referred_cls, **kw): ... - -class AutomapBase(object): - __abstract__: bool = ... - classes: Any = ... - @classmethod - def prepare(cls, engine: Optional[Any] = ..., reflect: bool = ..., - schema: Optional[Any] = ..., classname_for_table: Any = ..., - collection_class: Any = ..., name_for_scalar_relationship: Any = ..., - name_for_collection_relationship: Any = ..., generate_relationship: Any = ...) -> None: ... - -def automap_base(declarative_base: Optional[Any] = ..., **kw): ... diff --git a/sqlalchemy/ext/baked.pyi b/sqlalchemy/ext/baked.pyi deleted file mode 100644 index 39b9433c..00000000 --- a/sqlalchemy/ext/baked.pyi +++ /dev/null @@ -1,47 +0,0 @@ -from typing import Any -from ..orm import strategies as strategies - -log: Any = ... - -class Bakery(object): - cls: Any = ... - cache: Any = ... - def __init__(self, cls_, cache) -> None: ... - def __call__(self, initial_fn, *args) -> None: ... - -class BakedQuery(object): - steps: Any = ... - def __init__(self, bakery: Bakery, initial_fn, args: Any = ...) -> None: ... - @classmethod - def bakery(cls, size: int = ...) -> Bakery: ... - def __iadd__(self, other): ... - def __add__(self, other): ... - def add_criteria(self, fn, *args): ... - def with_criteria(self, fn, *args): ... - def for_session(self, session): ... - def __call__(self, session): ... - def spoil(self, full: bool = ...): ... - -class Result(object): - bq: Any = ... - session: Any = ... - def __init__(self, bq: BakedQuery, session) -> None: ... - def params(self, *args, **kw): ... - def __iter__(self): ... - def count(self): ... - def scalar(self): ... - def first(self): ... - def one(self): ... - def one_or_none(self): ... - def all(self): ... - def get(self, ident): ... - -def bake_lazy_loaders(): ... -def unbake_lazy_loaders(): ... - -class BakedLazyLoader(strategies.LazyLoader): ... - -def baked_lazyload(loadopt, attr): ... -def baked_lazyload_all(*keys): ... - -bakery: Bakery = ... diff --git a/sqlalchemy/ext/compiler.pyi b/sqlalchemy/ext/compiler.pyi deleted file mode 100644 index 6147ca94..00000000 --- a/sqlalchemy/ext/compiler.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from typing import Callable, TypeVar, Any - -_F = TypeVar('_F', bound=Callable[..., Any]) - -def compiles(class_, *specs) -> Callable[[_F], _F]: ... -def deregister(class_) -> None: ... diff --git a/sqlalchemy/ext/declarative/__init__.pyi b/sqlalchemy/ext/declarative/__init__.pyi deleted file mode 100644 index 40a261d2..00000000 --- a/sqlalchemy/ext/declarative/__init__.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from .api import ( - declarative_base as declarative_base, - synonym_for as synonym_for, - comparable_using as comparable_using, - instrument_declarative as instrument_declarative, - ConcreteBase as ConcreteBase, - AbstractConcreteBase as AbstractConcreteBase, - DeclarativeMeta as DeclarativeMeta, - DeferredReflection as DeferredReflection, - has_inherited_table as has_inherited_table, - declared_attr as declared_attr, - as_declarative as as_declarative -) diff --git a/sqlalchemy/ext/declarative/api.pyi b/sqlalchemy/ext/declarative/api.pyi deleted file mode 100644 index 2e950f1a..00000000 --- a/sqlalchemy/ext/declarative/api.pyi +++ /dev/null @@ -1,41 +0,0 @@ -from typing import Any, Optional -from ...orm import interfaces - -def instrument_declarative(cls, registry, metadata): ... -def has_inherited_table(cls): ... - -class DeclarativeMeta(type): - def __init__(cls, classname, bases, dict_) -> None: ... - def __setattr__(cls, key, value): ... - -def synonym_for(name, map_column: bool = ...): ... -def comparable_using(comparator_factory): ... - -class declared_attr(interfaces._MappedAttribute, property): - __doc__: Any = ... - def __init__(self, fget, cascading: bool = ...) -> None: ... - def __get__(desc, self, cls): ... - def cascading(cls): ... - -class _stateful_declared_attr(declared_attr): - kw: Any = ... - def __init__(self, **kw) -> None: ... - def __call__(self, fn): ... - -def declarative_base(bind: Optional[Any] = ..., metadata: Optional[Any] = ..., - mapper: Optional[Any] = ..., cls: Any = ..., name: str = ..., - constructor: Any = ..., class_registry: Optional[Any] = ..., metaclass: Any = ...): ... -def as_declarative(**kw): ... - -class ConcreteBase(object): - @classmethod - def __declare_first__(cls): ... - -class AbstractConcreteBase(ConcreteBase): - __no_table__: bool = ... - @classmethod - def __declare_first__(cls): ... - -class DeferredReflection(object): - @classmethod - def prepare(cls, engine): ... diff --git a/sqlalchemy/ext/declarative/base.pyi b/sqlalchemy/ext/declarative/base.pyi deleted file mode 100644 index 145f6240..00000000 --- a/sqlalchemy/ext/declarative/base.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from typing import Any - -declared_attr: Any = ... -declarative_props: Any = ... diff --git a/sqlalchemy/ext/declarative/clsregistry.pyi b/sqlalchemy/ext/declarative/clsregistry.pyi deleted file mode 100644 index d369423c..00000000 --- a/sqlalchemy/ext/declarative/clsregistry.pyi +++ /dev/null @@ -1 +0,0 @@ -def add_class(classname: str, cls) -> None: ... diff --git a/sqlalchemy/ext/horizontal_shard.pyi b/sqlalchemy/ext/horizontal_shard.pyi deleted file mode 100644 index f02d5732..00000000 --- a/sqlalchemy/ext/horizontal_shard.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Any, Optional -from ..orm.session import Session -from ..orm.query import Query - -class ShardedQuery(Query): - id_chooser: Any = ... - query_chooser: Any = ... - def __init__(self, *args, **kwargs) -> None: ... - def set_shard(self, shard_id): ... - def get(self, ident, **kwargs): ... - -class ShardedSession(Session): - shard_chooser: Any = ... - id_chooser: Any = ... - query_chooser: Any = ... - connection_callable: Any = ... - def __init__(self, shard_chooser, id_chooser, query_chooser, shards: Optional[Any] = ..., - query_cls: Any = ..., **kwargs) -> None: ... - def connection(self, *args, **kwargs): ... - def get_bind(self, *args, **kw): ... - def bind_shard(self, shard_id, bind): ... diff --git a/sqlalchemy/ext/hybrid.pyi b/sqlalchemy/ext/hybrid.pyi deleted file mode 100644 index c3ec573d..00000000 --- a/sqlalchemy/ext/hybrid.pyi +++ /dev/null @@ -1,62 +0,0 @@ -from typing import Any, Optional -from ..orm import interfaces - -HYBRID_METHOD: Any = ... -HYBRID_PROPERTY: Any = ... - -class hybrid_method(interfaces.InspectionAttrInfo): - is_attribute: bool = ... - extension_type: Any = ... - func: Any = ... - def __init__(self, func, expr: Optional[Any] = ...) -> None: ... - def __get__(self, instance, owner): ... - expr: Any = ... - def expression(self, expr): ... - -class hybrid_property(interfaces.InspectionAttrInfo): - is_attribute: bool = ... - extension_type: Any = ... - fget: Any = ... - fset: Any = ... - fdel: Any = ... - custom_comparator: Any = ... - update_expr: Any = ... - def __init__(self, fget, fset: Optional[Any] = ..., fdel: Optional[Any] = ..., - expr: Optional[Any] = ..., custom_comparator: Optional[Any] = ..., - update_expr: Optional[Any] = ...) -> None: ... - def __get__(self, instance, owner): ... - def __set__(self, instance, value): ... - def __delete__(self, instance): ... - def getter(self, fget): ... - def setter(self, fset): ... - def deleter(self, fdel): ... - expr: Any = ... - def expression(self, expr): ... - def comparator(self, comparator): ... - def update_expression(self, meth): ... - def _copy(self, **kw): ... - def _expr_comparator(self): ... - def _get_expr(self, expr): ... - def _get_comparator(self, comparator): ... - @property - def overrides(self): ... - - -class Comparator(interfaces.PropComparator): - property: Any = ... - expression: Any = ... - def __init__(self, expression) -> None: ... - def __clause_element__(self): ... - def adapt_to_entity(self, adapt_to_entity): ... - -class ExprComparator(Comparator): - expression: Any = ... - hybrid: Any = ... - def __init__(self, expression, hybrid) -> None: ... - def __getattr__(self, key): ... - @property - def info(self): ... - @property - def property(self): ... - def operate(self, op, *other, **kwargs): ... - def reverse_operate(self, op, other, **kwargs): ... diff --git a/sqlalchemy/ext/indexable.pyi b/sqlalchemy/ext/indexable.pyi deleted file mode 100644 index ff8322b5..00000000 --- a/sqlalchemy/ext/indexable.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from typing import Any, Optional -from ..ext.hybrid import hybrid_property - -class index_property(hybrid_property): - attr_name: str = ... - index: Any = ... - default: Any = ... - datatype: Any = ... - onebased: Any = ... - def __init__(self, attr_name, index, default: Any = ..., datatype: Optional[Any] = ..., - mutable: bool = ..., onebased: bool = ...) -> None: ... - def fget(self, instance): ... - def fset(self, instance, value): ... - def fdel(self, instance): ... - def expr(self, model): ... diff --git a/sqlalchemy/ext/instrumentation.pyi b/sqlalchemy/ext/instrumentation.pyi deleted file mode 100644 index 92af6b86..00000000 --- a/sqlalchemy/ext/instrumentation.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from typing import Any, Optional -from ..orm.instrumentation import InstrumentationFactory - -INSTRUMENTATION_MANAGER: str = ... - -def find_native_user_instrumentation_hook(cls): ... - -instrumentation_finders: Any = ... - -class ExtendedInstrumentationRegistry(InstrumentationFactory): - def unregister(self, class_): ... - def manager_of_class(self, cls): ... - def state_of(self, instance): ... - def dict_of(self, instance): ... - -class InstrumentationManager(object): - def __init__(self, class_) -> None: ... - def manage(self, class_, manager): ... - def dispose(self, class_, manager): ... - def manager_getter(self, class_): ... - def instrument_attribute(self, class_, key, inst): ... - def post_configure_attribute(self, class_, key, inst): ... - def install_descriptor(self, class_, key, inst): ... - def uninstall_descriptor(self, class_, key): ... - def install_member(self, class_, key, implementation): ... - def uninstall_member(self, class_, key): ... - def instrument_collection_class(self, class_, key, collection_class): ... - def get_instance_dict(self, class_, instance): ... - def initialize_instance_dict(self, class_, instance): ... - def install_state(self, class_, instance, state): ... - def remove_state(self, class_, instance): ... - def state_getter(self, class_): ... - def dict_getter(self, class_): ... diff --git a/sqlalchemy/ext/mutable.pyi b/sqlalchemy/ext/mutable.pyi deleted file mode 100644 index f68846bd..00000000 --- a/sqlalchemy/ext/mutable.pyi +++ /dev/null @@ -1,56 +0,0 @@ -class MutableBase(object): - @classmethod - def coerce(cls, key, value): ... - -class Mutable(MutableBase): - def changed(self): ... - @classmethod - def associate_with_attribute(cls, attribute): ... - @classmethod - def associate_with(cls, sqltype): ... - @classmethod - def as_mutable(cls, sqltype): ... - -class MutableComposite(MutableBase): - def changed(self): ... - -class MutableDict(Mutable, dict): - def __setitem__(self, key, value): ... - def setdefault(self, key, value): ... - def __delitem__(self, key): ... - def update(self, *a, **kw): ... - def pop(self, *arg): ... - def popitem(self): ... - def clear(self): ... - @classmethod - def coerce(cls, key, value): ... - -class MutableList(Mutable, list): - def __setitem__(self, index, value): ... - def __setslice__(self, start, end, value): ... - def __delitem__(self, index): ... - def __delslice__(self, start, end): ... - def pop(self, *arg): ... - def append(self, x): ... - def extend(self, x): ... - def insert(self, i, x): ... - def remove(self, i): ... - def clear(self): ... - def sort(self): ... - def reverse(self): ... - @classmethod - def coerce(cls, index, value): ... - -class MutableSet(Mutable, set): - def update(self, *arg): ... - def intersection_update(self, *arg): ... - def difference_update(self, *arg): ... - def symmetric_difference_update(self, *arg): ... - def add(self, elem): ... - def remove(self, elem): ... - def discard(self, elem): ... - def pop(self, *arg): ... - def clear(self): ... - @classmethod - def coerce(cls, index, value): ... - def __reduce_ex__(self, proto): ... diff --git a/sqlalchemy/ext/orderinglist.pyi b/sqlalchemy/ext/orderinglist.pyi deleted file mode 100644 index 879ed162..00000000 --- a/sqlalchemy/ext/orderinglist.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Any, Optional - -def ordering_list(attr, count_from: Optional[Any] = ..., **kw): ... - -class OrderingList(list): - ordering_attr: str = ... - ordering_func: Any = ... - reorder_on_append: Any = ... - def __init__(self, ordering_attr: Optional[str] = ..., ordering_func: Optional[Any] = ..., - reorder_on_append: bool = ...) -> None: ... - def reorder(self): ... - def append(self, entity): ... - def insert(self, index, entity): ... - def remove(self, entity): ... - def __setitem__(self, index, entity): ... - def __delitem__(self, index): ... - def __setslice__(self, start, end, values): ... - def __delslice__(self, start, end): ... - def __reduce__(self): ... diff --git a/sqlalchemy/ext/serializer.pyi b/sqlalchemy/ext/serializer.pyi deleted file mode 100644 index 1cf3ac2b..00000000 --- a/sqlalchemy/ext/serializer.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import Any, Optional -from pickle import Pickler, Unpickler - -def Serializer(*args, **kw) -> Pickler: ... -def Deserializer(file, metadata: Optional[Any] = ..., scoped_session: Optional[Any] = ..., - engine: Optional[Any] = ...) -> Unpickler: ... -def dumps(obj, protocol: int = ...) -> bytes: ... -def loads(data, metadata: Optional[Any] = ..., scoped_session: Optional[Any] = ..., - engine: Optional[Any] = ...): ... diff --git a/sqlalchemy/inspection.pyi b/sqlalchemy/inspection.pyi deleted file mode 100644 index 70bcd49a..00000000 --- a/sqlalchemy/inspection.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from typing import Any - -def inspect(subject: object, raiseerr: bool = ...) -> Any: ... diff --git a/sqlalchemy/interfaces.pyi b/sqlalchemy/interfaces.pyi deleted file mode 100644 index 8ccb6a9d..00000000 --- a/sqlalchemy/interfaces.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Any, Optional - -class PoolListener(object): - def connect(self, dbapi_con, con_record): ... - def first_connect(self, dbapi_con, con_record): ... - def checkout(self, dbapi_con, con_record, con_proxy): ... - def checkin(self, dbapi_con, con_record): ... - -class ConnectionProxy(object): - def execute(self, conn, execute, clauseelement, *multiparams, **params): ... - def cursor_execute(self, execute, cursor, statement, parameters, context, executemany): ... - def begin(self, conn, begin): ... - def rollback(self, conn, rollback): ... - def commit(self, conn, commit): ... - def savepoint(self, conn, savepoint, name: Optional[Any] = ...): ... - def rollback_savepoint(self, conn, rollback_savepoint, name, context): ... - def release_savepoint(self, conn, release_savepoint, name, context): ... - def begin_twophase(self, conn, begin_twophase, xid): ... - def prepare_twophase(self, conn, prepare_twophase, xid): ... - def rollback_twophase(self, conn, rollback_twophase, xid, is_prepared): ... - def commit_twophase(self, conn, commit_twophase, xid, is_prepared): ... diff --git a/sqlalchemy/log.pyi b/sqlalchemy/log.pyi deleted file mode 100644 index 5651547e..00000000 --- a/sqlalchemy/log.pyi +++ /dev/null @@ -1,32 +0,0 @@ -from typing import Any, Optional - -rootlogger: Any = ... - -def class_logger(cls): ... - -class Identified(object): - logging_name: str = ... - def _should_log_debug(self) -> bool: ... - def _should_log_info(self) -> bool: ... - -class InstanceLogger(object): - echo: Any - logger: Any = ... - def __init__(self, echo, name) -> None: ... - def debug(self, msg, *args, **kwargs): ... - def info(self, msg, *args, **kwargs): ... - def warning(self, msg, *args, **kwargs): ... - def warn(self, msg, *args, **kwargs): ... - def error(self, msg, *args, **kwargs): ... - def exception(self, msg, *args, **kwargs): ... - def critical(self, msg, *args, **kwargs): ... - def log(self, level, msg, *args, **kwargs): ... - def isEnabledFor(self, level): ... - def getEffectiveLevel(self): ... - -def instance_logger(instance, echoflag: Optional[Any] = ...): ... - -class echo_property(object): - __doc__: str = ... - def __get__(self, instance, owner): ... - def __set__(self, instance, value): ... diff --git a/sqlalchemy/orm/__init__.pyi b/sqlalchemy/orm/__init__.pyi deleted file mode 100644 index 6527e6c2..00000000 --- a/sqlalchemy/orm/__init__.pyi +++ /dev/null @@ -1,91 +0,0 @@ -from typing import Any, Optional -from .mapper import ( - Mapper as Mapper, - class_mapper as class_mapper, - configure_mappers as configure_mappers, - reconstructor as reconstructor, - validates as validates -) -from .interfaces import ( - EXT_CONTINUE as EXT_CONTINUE, - EXT_STOP as EXT_STOP, - PropComparator as PropComparator -) -from .util import ( - aliased as aliased, - join as join, - object_mapper as object_mapper, - outerjoin as outerjoin, - polymorphic_union as polymorphic_union, - was_deleted as was_deleted, - with_parent as with_parent, - with_polymorphic as with_polymorphic -) -from .properties import ColumnProperty as ColumnProperty -from .relationships import RelationshipProperty as RelationshipProperty -from .descriptor_props import ( - ComparableProperty as ComparableProperty, - CompositeProperty as CompositeProperty, - SynonymProperty as SynonymProperty -) -from .relationships import foreign as foreign, remote as remote -from .session import ( - Session as Session, - close_all_sessions as close_all_sessions, - object_session as object_session, - sessionmaker as sessionmaker, - make_transient as make_transient, - make_transient_to_detached as make_transient_to_detached -) -from .scoping import scoped_session as scoped_session -from . import mapper as mapperlib -from .query import AliasOption as AliasOption, Query as Query, Bundle as Bundle -from .strategy_options import Load as Load - -def create_session(bind: Optional[Any] = ..., **kwargs): ... - -relationship = RelationshipProperty - -def relation(*arg, **kw): ... -def dynamic_loader(argument, **kw): ... - -column_property = ColumnProperty -composite = CompositeProperty - -def query_expression() -> ColumnProperty: ... - -def backref(name, **kwargs): ... -def deferred(*columns, **kw): ... - -mapper = Mapper -synonym = SynonymProperty -comparable_property = ComparableProperty - -def compile_mappers(): ... -def clear_mappers(): ... - -# TODO: these are function "aliases" -joinedload: Any = ... -joinedload_all: Any = ... -contains_eager: Any = ... -defer: Any = ... -undefer: Any = ... -undefer_group: Any = ... -with_expression: Any = ... -load_only: Any = ... -lazyload: Any = ... -lazyload_all: Any = ... -subqueryload: Any = ... -subqueryload_all: Any = ... -selectinload: Any = ... -selectinload_all: Any = ... -immediateload: Any = ... -noload: Any = ... -raiseload: Any = ... -defaultload: Any = ... -selectin_polymorphic: Any = ... - -def eagerload(*args, **kwargs): ... -def eagerload_all(*args, **kwargs): ... - -contains_alias = AliasOption diff --git a/sqlalchemy/orm/attributes.pyi b/sqlalchemy/orm/attributes.pyi deleted file mode 100644 index 3eb151b9..00000000 --- a/sqlalchemy/orm/attributes.pyi +++ /dev/null @@ -1,194 +0,0 @@ -from typing import Any, Optional -from . import interfaces -from .base import ( - PASSIVE_NO_RESULT as PASSIVE_NO_RESULT, - ATTR_WAS_SET as ATTR_WAS_SET, - ATTR_EMPTY as ATTR_EMPTY, - NO_VALUE as NO_VALUE, - NEVER_SET as NEVER_SET, - NO_CHANGE as NO_CHANGE, - CALLABLES_OK as CALLABLES_OK, - SQL_OK as SQL_OK, - RELATED_OBJECT_OK as RELATED_OBJECT_OK, - INIT_OK as INIT_OK, - NON_PERSISTENT_OK as NON_PERSISTENT_OK, - LOAD_AGAINST_COMMITTED as LOAD_AGAINST_COMMITTED, - PASSIVE_OFF as PASSIVE_OFF, - PASSIVE_RETURN_NEVER_SET as PASSIVE_RETURN_NEVER_SET, - PASSIVE_NO_INITIALIZE as PASSIVE_NO_INITIALIZE, - PASSIVE_NO_FETCH as PASSIVE_NO_FETCH, - PASSIVE_NO_FETCH_RELATED as PASSIVE_NO_FETCH_RELATED, - PASSIVE_ONLY_PERSISTENT as PASSIVE_ONLY_PERSISTENT, - NO_AUTOFLUSH as NO_AUTOFLUSH -) -from .base import state_str as state_str, instance_str as instance_str -from collections import namedtuple - -class QueryableAttribute(interfaces._MappedAttribute, interfaces.InspectionAttr, interfaces.PropComparator): - is_attribute: bool = ... - class_: Any = ... - key: Any = ... - impl: Any = ... - comparator: Any = ... - def __init__(self, class_, key, impl: Optional[Any] = ..., comparator: Optional[Any] = ..., - parententity: Optional[Any] = ..., of_type: Optional[Any] = ...) -> None: ... - def get_history(self, instance, passive: Any = ...): ... - def __selectable__(self): ... - @property - def info(self): ... - @property - def parent(self): ... - @property - def expression(self): ... - def __clause_element__(self): ... - def adapt_to_entity(self, adapt_to_entity): ... - def of_type(self, cls): ... - def label(self, name): ... - def operate(self, op, *other, **kwargs): ... - def reverse_operate(self, op, other, **kwargs): ... - def hasparent(self, state, optimistic: bool = ...): ... - def __getattr__(self, key): ... - @property - def property(self): ... - -class InstrumentedAttribute(QueryableAttribute): - def __set__(self, instance, value): ... - def __delete__(self, instance): ... - def __get__(self, instance, owner): ... - -def create_proxied_attribute(descriptor): ... - -OP_REMOVE: Any = ... -OP_APPEND: Any = ... -OP_REPLACE: Any = ... - -class Event(object): - impl: Any = ... - op: Any = ... - parent_token: Any = ... - def __init__(self, attribute_impl, op) -> None: ... - def __eq__(self, other): ... - @property - def key(self): ... - def hasparent(self, state): ... - -class AttributeImpl(object): - class_: Any = ... - key: Any = ... - callable_: Any = ... - dispatch: Any = ... - trackparent: Any = ... - parent_token: Any = ... - send_modified_events: Any = ... - is_equal: Any = ... - expire_missing: Any = ... - def __init__(self, class_, key, callable_, dispatch, trackparent: bool = ..., extension: Optional[Any] = ..., - compare_function: Optional[Any] = ..., active_history: bool = ..., - parent_token: Optional[Any] = ..., expire_missing: bool = ..., - send_modified_events: bool = ..., **kwargs) -> None: ... - active_history: Any = ... - def hasparent(self, state, optimistic: bool = ...): ... - def sethasparent(self, state, parent_state, value): ... - def get_history(self, state, dict_, passive: Any = ...): ... - def get_all_pending(self, state, dict_, passive: Any = ...): ... - def initialize(self, state, dict_): ... - def get(self, state, dict_, passive: Any = ...): ... - def append(self, state, dict_, value, initiator, passive: Any = ...): ... - def remove(self, state, dict_, value, initiator, passive: Any = ...): ... - def pop(self, state, dict_, value, initiator, passive: Any = ...): ... - def set(self, state, dict_, value, initiator, passive: Any = ..., - check_old: Optional[Any] = ..., pop: bool = ...): ... - def get_committed_value(self, state, dict_, passive: Any = ...): ... - def set_committed_value(self, state, dict_, value): ... - -class ScalarAttributeImpl(AttributeImpl): - accepts_scalar_loader: bool = ... - uses_objects: bool = ... - supports_population: bool = ... - collection: bool = ... - def __init__(self, *arg, **kw) -> None: ... - def delete(self, state, dict_): ... - def get_history(self, state, dict_, passive: Any = ...): ... - def set(self, state, dict_, value, initiator, passive: Any = ..., - check_old: Optional[Any] = ..., pop: bool = ...): ... - def fire_replace_event(self, state, dict_, value, previous, initiator): ... - def fire_remove_event(self, state, dict_, value, initiator): ... - @property - def type(self): ... - -class ScalarObjectAttributeImpl(ScalarAttributeImpl): - accepts_scalar_loader: bool = ... - uses_objects: bool = ... - supports_population: bool = ... - collection: bool = ... - def delete(self, state, dict_): ... - def get_history(self, state, dict_, passive: Any = ...): ... - def get_all_pending(self, state, dict_, passive: Any = ...): ... - def set(self, state, dict_, value, initiator, passive: Any = ..., - check_old: Optional[Any] = ..., pop: bool = ...): ... - def fire_remove_event(self, state, dict_, value, initiator): ... - def fire_replace_event(self, state, dict_, value, previous, initiator): ... - -class CollectionAttributeImpl(AttributeImpl): - accepts_scalar_loader: bool = ... - uses_objects: bool = ... - supports_population: bool = ... - collection: bool = ... - copy: Any = ... - collection_factory: Any = ... - def __init__(self, class_, key, callable_, dispatch, typecallable: Optional[Any] = ..., - trackparent: bool = ..., extension: Optional[Any] = ..., - copy_function: Optional[Any] = ..., compare_function: Optional[Any] = ..., **kwargs) -> None: ... - def get_history(self, state, dict_, passive: Any = ...): ... - def get_all_pending(self, state, dict_, passive: Any = ...): ... - def fire_append_event(self, state, dict_, value, initiator): ... - def fire_pre_remove_event(self, state, dict_, initiator): ... - def fire_remove_event(self, state, dict_, value, initiator): ... - def delete(self, state, dict_): ... - def initialize(self, state, dict_): ... - def append(self, state, dict_, value, initiator, passive: Any = ...): ... - def remove(self, state, dict_, value, initiator, passive: Any = ...): ... - def pop(self, state, dict_, value, initiator, passive: Any = ...): ... - def set(self, *args, **kwargs): ... - def set_committed_value(self, state, dict_, value): ... - def get_collection(self, state, dict_, user_data: Optional[Any] = ..., passive: Any = ...): ... - -def backref_listeners(attribute, key, uselist): ... - -_History = namedtuple('_History', ['added', 'unchanged', 'deleted']) - -class History(_History): - def __bool__(self): ... - __nonzero__: Any = ... - def empty(self): ... - def sum(self): ... - def non_deleted(self): ... - def non_added(self): ... - def has_changes(self): ... - def as_state(self): ... - @classmethod - def from_scalar_attribute(cls, attribute, state, current): ... - @classmethod - def from_object_attribute(cls, attribute, state, current): ... - @classmethod - def from_collection(cls, attribute, state, current): ... - -HISTORY_BLANK: Any = ... - -def get_history(obj, key, passive: Any = ...): ... -def get_state_history(state, key, passive: Any = ...): ... -def has_parent(cls, obj, key, optimistic: bool = ...): ... -def register_attribute(class_, key, **kw): ... -def register_attribute_impl(class_, key, uselist: bool = ..., callable_: Optional[Any] = ..., - useobject: bool = ..., impl_class: Optional[Any] = ..., - backref: Optional[Any] = ..., **kw): ... -def register_descriptor(class_, key, comparator: Optional[Any] = ..., - parententity: Optional[Any] = ..., doc: Optional[Any] = ...): ... -def unregister_attribute(class_, key): ... -def init_collection(obj, key): ... -def init_state_collection(state, dict_, key): ... -def set_committed_value(instance, key, value): ... -def set_attribute(instance, key, value): ... -def get_attribute(instance, key): ... -def del_attribute(instance, key): ... -def flag_modified(instance, key): ... diff --git a/sqlalchemy/orm/base.pyi b/sqlalchemy/orm/base.pyi deleted file mode 100644 index 41094f1e..00000000 --- a/sqlalchemy/orm/base.pyi +++ /dev/null @@ -1,60 +0,0 @@ -from typing import Any - -PASSIVE_NO_RESULT: Any = ... -ATTR_WAS_SET: Any = ... -ATTR_EMPTY: Any = ... -NO_VALUE: Any = ... -NEVER_SET: Any = ... -NO_CHANGE: Any = ... -CALLABLES_OK: Any = ... -SQL_OK: Any = ... -RELATED_OBJECT_OK: Any = ... -INIT_OK: Any = ... -NON_PERSISTENT_OK: Any = ... -LOAD_AGAINST_COMMITTED: Any = ... -NO_AUTOFLUSH: Any = ... -PASSIVE_OFF: Any = ... -PASSIVE_RETURN_NEVER_SET: Any = ... -PASSIVE_NO_INITIALIZE: Any = ... -PASSIVE_NO_FETCH: Any = ... -PASSIVE_NO_FETCH_RELATED: Any = ... -PASSIVE_ONLY_PERSISTENT: Any = ... -DEFAULT_MANAGER_ATTR: str = ... -DEFAULT_STATE_ATTR: str = ... -EXT_CONTINUE: Any = ... -EXT_STOP: Any = ... -ONETOMANY: Any = ... -MANYTOONE: Any = ... -MANYTOMANY: Any = ... -NOT_EXTENSION: Any = ... - -def manager_of_class(cls): ... - -instance_state: Any = ... -instance_dict: Any = ... - -def instance_str(instance): ... -def state_str(state): ... -def state_class_str(state): ... -def attribute_str(instance, attribute): ... -def state_attribute_str(state, attribute): ... -def object_mapper(instance): ... -def object_state(instance): ... -def class_mapper(class_, configure: bool = ...): ... - -class InspectionAttr(object): - is_selectable: bool = ... - is_aliased_class: bool = ... - is_instance: bool = ... - is_mapper: bool = ... - is_property: bool = ... - is_attribute: bool = ... - is_clause_element: bool = ... - extension_type: Any = ... - -class InspectionAttrInfo(InspectionAttr): - @property - def info(self): ... - -# used by interfaces.pyi -class _MappedAttribute(object): ... diff --git a/sqlalchemy/orm/collections.pyi b/sqlalchemy/orm/collections.pyi deleted file mode 100644 index 9db5b8c3..00000000 --- a/sqlalchemy/orm/collections.pyi +++ /dev/null @@ -1,64 +0,0 @@ -from typing import Any, Optional - -def column_mapped_collection(mapping_spec): ... -def attribute_mapped_collection(attr_name): ... -def mapped_collection(keyfunc): ... - -class collection(object): - @staticmethod - def appender(fn): ... - @staticmethod - def remover(fn): ... - @staticmethod - def iterator(fn): ... - @staticmethod - def internally_instrumented(fn): ... - @staticmethod - def linker(fn): ... - link: Any = ... - @staticmethod - def converter(fn): ... - @staticmethod - def adds(arg): ... - @staticmethod - def replaces(arg): ... - @staticmethod - def removes(arg): ... - @staticmethod - def removes_return(): ... - -collection_adapter: Any = ... - -class CollectionAdapter(object): - attr: Any = ... - owner_state: Any = ... - invalidated: bool = ... - def __init__(self, attr, owner_state, data) -> None: ... - @property - def data(self): ... - def bulk_appender(self): ... - def append_with_event(self, item, initiator: Optional[Any] = ...): ... - def append_without_event(self, item): ... - def append_multiple_without_event(self, items): ... - def bulk_remover(self): ... - def remove_with_event(self, item, initiator: Optional[Any] = ...): ... - def remove_without_event(self, item): ... - def clear_with_event(self, initiator: Optional[Any] = ...): ... - def clear_without_event(self): ... - def __iter__(self): ... - def __len__(self): ... - def __bool__(self): ... - __nonzero__: Any = ... - def fire_append_event(self, item, initiator: Optional[Any] = ...): ... - def fire_remove_event(self, item, initiator: Optional[Any] = ...): ... - def fire_pre_remove_event(self, initiator: Optional[Any] = ...): ... - -class InstrumentedList(list): ... -class InstrumentedSet(set): ... -class InstrumentedDict(dict): ... - -class MappedCollection(dict): - keyfunc: Any = ... - def __init__(self, keyfunc) -> None: ... - def set(self, value, _sa_initiator: Optional[Any] = ...): ... - def remove(self, value, _sa_initiator: Optional[Any] = ...): ... diff --git a/sqlalchemy/orm/dependency.pyi b/sqlalchemy/orm/dependency.pyi deleted file mode 100644 index 8db25233..00000000 --- a/sqlalchemy/orm/dependency.pyi +++ /dev/null @@ -1,74 +0,0 @@ -from typing import Any -from .. import exc as sa_exc -from . import util as mapperutil -from .interfaces import ( - ONETOMANY as ONETOMANY, - MANYTOONE as MANYTOONE, - MANYTOMANY as MANYTOMANY -) - -class DependencyProcessor(object): - prop: Any = ... - cascade: Any = ... - mapper: Any = ... - parent: Any = ... - secondary: Any = ... - direction: Any = ... - post_update: Any = ... - passive_deletes: Any = ... - passive_updates: Any = ... - enable_typechecks: Any = ... - key: Any = ... - def __init__(self, prop) -> None: ... - @classmethod - def from_relationship(cls, prop): ... - def hasparent(self, state): ... - def per_property_preprocessors(self, uow): ... - def per_property_flush_actions(self, uow): ... - def per_state_flush_actions(self, uow, states, isdelete): ... - def presort_deletes(self, uowcommit, states): ... - def presort_saves(self, uowcommit, states): ... - def process_deletes(self, uowcommit, states): ... - def process_saves(self, uowcommit, states): ... - def prop_has_changes(self, uowcommit, states, isdelete): ... - -class OneToManyDP(DependencyProcessor): - def per_property_dependencies(self, uow, parent_saves, child_saves, parent_deletes, - child_deletes, after_save, before_delete): ... - def per_state_dependencies(self, uow, save_parent, delete_parent, child_action, - after_save, before_delete, isdelete, childisdelete): ... - def presort_deletes(self, uowcommit, states): ... - def presort_saves(self, uowcommit, states): ... - def process_deletes(self, uowcommit, states): ... - def process_saves(self, uowcommit, states): ... - -class ManyToOneDP(DependencyProcessor): - def __init__(self, prop) -> None: ... - def per_property_dependencies(self, uow, parent_saves, child_saves, parent_deletes, - child_deletes, after_save, before_delete): ... - def per_state_dependencies(self, uow, save_parent, delete_parent, child_action, - after_save, before_delete, isdelete, childisdelete): ... - def presort_deletes(self, uowcommit, states): ... - def presort_saves(self, uowcommit, states): ... - def process_deletes(self, uowcommit, states): ... - def process_saves(self, uowcommit, states): ... - -class DetectKeySwitch(DependencyProcessor): - def per_property_preprocessors(self, uow): ... - def per_property_flush_actions(self, uow): ... - def per_state_flush_actions(self, uow, states, isdelete): ... - def presort_deletes(self, uowcommit, states): ... - def presort_saves(self, uow, states): ... - def prop_has_changes(self, uow, states, isdelete): ... - def process_deletes(self, uowcommit, states): ... - def process_saves(self, uowcommit, states): ... - -class ManyToManyDP(DependencyProcessor): - def per_property_dependencies(self, uow, parent_saves, child_saves, parent_deletes, - child_deletes, after_save, before_delete): ... - def per_state_dependencies(self, uow, save_parent, delete_parent, child_action, - after_save, before_delete, isdelete, childisdelete): ... - def presort_deletes(self, uowcommit, states): ... - def presort_saves(self, uowcommit, states): ... - def process_deletes(self, uowcommit, states): ... - def process_saves(self, uowcommit, states): ... diff --git a/sqlalchemy/orm/descriptor_props.pyi b/sqlalchemy/orm/descriptor_props.pyi deleted file mode 100644 index 7b491d5f..00000000 --- a/sqlalchemy/orm/descriptor_props.pyi +++ /dev/null @@ -1,65 +0,0 @@ -from typing import Any, Optional -from .interfaces import ( - MapperProperty as MapperProperty, - PropComparator as PropComparator -) -from . import query - -class DescriptorProperty(MapperProperty): - doc: Any = ... - key: Any = ... - descriptor: Any = ... - def instrument_class(self, mapper): ... - -class CompositeProperty(DescriptorProperty): - attrs: Any = ... - composite_class: Any = ... - active_history: Any = ... - deferred: Any = ... - group: Any = ... - comparator_factory: Any = ... - info: Any = ... - def __init__(self, class_, *attrs, **kwargs) -> None: ... - def instrument_class(self, mapper): ... - def do_init(self): ... - @property - def props(self): ... - @property - def columns(self): ... - def get_history(self, state, dict_, passive: Any = ...): ... - class CompositeBundle(query.Bundle): - property: Any = ... - def __init__(self, property, expr) -> None: ... - def create_row_processor(self, query, procs, labels): ... - class Comparator(PropComparator): - __hash__: Any = ... - @property - def clauses(self): ... - def __clause_element__(self): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - -class ConcreteInheritedProperty(DescriptorProperty): - descriptor: Any = ... - def __init__(self) -> None: ... - -class SynonymProperty(DescriptorProperty): - name: str = ... - map_column: Any = ... - descriptor: Any = ... - comparator_factory: Any = ... - doc: Any = ... - info: Any = ... - def __init__(self, name, map_column: Optional[Any] = ..., descriptor: Optional[Any] = ..., - comparator_factory: Optional[Any] = ..., doc: Optional[Any] = ..., - info: Optional[Any] = ...) -> None: ... - parent: Any = ... - def set_parent(self, parent, init): ... - -class ComparableProperty(DescriptorProperty): - descriptor: Any = ... - comparator_factory: Any = ... - doc: Any = ... - info: Any = ... - def __init__(self, comparator_factory, descriptor: Optional[Any] = ..., - doc: Optional[Any] = ..., info: Optional[Any] = ...) -> None: ... diff --git a/sqlalchemy/orm/dynamic.pyi b/sqlalchemy/orm/dynamic.pyi deleted file mode 100644 index 5d6ee486..00000000 --- a/sqlalchemy/orm/dynamic.pyi +++ /dev/null @@ -1,63 +0,0 @@ -from typing import Any, Optional -from . import strategies -from . import attributes -from .query import Query as Query - -class DynaLoader(strategies.AbstractRelationshipLoader): - is_class_level: bool = ... - def init_class_attribute(self, mapper): ... - -class DynamicAttributeImpl(attributes.AttributeImpl): - uses_objects: bool = ... - accepts_scalar_loader: bool = ... - supports_population: bool = ... - collection: bool = ... - target_mapper: Any = ... - order_by: Any = ... - query_class: Any = ... - def __init__(self, class_, key, typecallable, dispatch, target_mapper, order_by, - query_class: Optional[Any] = ..., **kw) -> None: ... - def get(self, state, dict_, passive: Any = ...): ... - def get_collection(self, state, dict_, user_data: Optional[Any] = ..., passive: Any = ...): ... - def fire_append_event(self, state, dict_, value, initiator, collection_history: Optional[Any] = ...): ... - def fire_remove_event(self, state, dict_, value, initiator, collection_history: Optional[Any] = ...): ... - def set(self, state, dict_, value, initiator: Optional[Any] = ..., passive: Any = ..., - check_old: Optional[Any] = ..., pop: bool = ..., _adapt: bool = ...): ... - def delete(self, *args, **kwargs): ... - def set_committed_value(self, state, dict_, value): ... - def get_history(self, state, dict_, passive: Any = ...): ... - def get_all_pending(self, state, dict_, passive: Any = ...): ... - def append(self, state, dict_, value, initiator, passive: Any = ...): ... - def remove(self, state, dict_, value, initiator, passive: Any = ...): ... - def pop(self, state, dict_, value, initiator, passive: Any = ...): ... - -class AppenderMixin(object): - query_class: Any = ... - instance: Any = ... - attr: Any = ... - def __init__(self, attr, state) -> None: ... - session: Any = ... - def __iter__(self): ... - def __getitem__(self, index): ... - def count(self): ... - def extend(self, iterator): ... - def append(self, item): ... - def remove(self, item): ... - -class AppenderQuery(AppenderMixin, Query): ... - -def mixin_user_query(cls): ... - -class CollectionHistory(object): - unchanged_items: Any = ... - added_items: Any = ... - deleted_items: Any = ... - def __init__(self, attr, state, apply_to: Optional[Any] = ...) -> None: ... - @property - def added_plus_unchanged(self): ... - @property - def all_items(self): ... - def as_history(self): ... - def indexed(self, index): ... - def add_added(self, value): ... - def add_removed(self, value): ... diff --git a/sqlalchemy/orm/evaluator.pyi b/sqlalchemy/orm/evaluator.pyi deleted file mode 100644 index 8b04a7a2..00000000 --- a/sqlalchemy/orm/evaluator.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from typing import Any, Optional - -class UnevaluatableError(Exception): ... - -class EvaluatorCompiler(object): - target_cls: Any = ... - def __init__(self, target_cls: Optional[Any] = ...) -> None: ... - def process(self, clause): ... - def visit_grouping(self, clause): ... - def visit_null(self, clause): ... - def visit_false(self, clause): ... - def visit_true(self, clause): ... - def visit_column(self, clause): ... - def visit_clauselist(self, clause): ... - def visit_binary(self, clause): ... - def visit_unary(self, clause): ... - def visit_bindparam(self, clause): ... diff --git a/sqlalchemy/orm/events.pyi b/sqlalchemy/orm/events.pyi deleted file mode 100644 index f9e5e212..00000000 --- a/sqlalchemy/orm/events.pyi +++ /dev/null @@ -1,92 +0,0 @@ -from typing import Any -from .. import event - -class InstrumentationEvents(event.Events): - def class_instrument(self, cls): ... - def class_uninstrument(self, cls): ... - def attribute_instrument(self, cls, key, inst): ... - -class _InstrumentationEventsHold(object): - class_: Any = ... - def __init__(self, class_) -> None: ... - dispatch: Any = ... - -class InstanceEvents(event.Events): - def first_init(self, manager, cls): ... - def init(self, target, args, kwargs): ... - def init_failure(self, target, args, kwargs): ... - def load(self, target, context): ... - def refresh(self, target, context, attrs): ... - def refresh_flush(self, target, flush_context, attrs): ... - def expire(self, target, attrs): ... - def pickle(self, target, state_dict): ... - def unpickle(self, target, state_dict): ... - -class _EventsHold(event.RefCollection): - class_: Any = ... - def __init__(self, class_) -> None: ... - class HoldEvents(object): ... - def remove(self, event_key): ... - @classmethod - def populate(cls, class_, subject): ... - -class _InstanceEventsHold(_EventsHold): - all_holds: Any = ... - def resolve(self, class_): ... - class HoldInstanceEvents(_EventsHold.HoldEvents, InstanceEvents): ... - dispatch: Any = ... - -class MapperEvents(event.Events): - def instrument_class(self, mapper, class_): ... - def mapper_configured(self, mapper, class_): ... - def before_configured(self): ... - def after_configured(self): ... - def before_insert(self, mapper, connection, target): ... - def after_insert(self, mapper, connection, target): ... - def before_update(self, mapper, connection, target): ... - def after_update(self, mapper, connection, target): ... - def before_delete(self, mapper, connection, target): ... - def after_delete(self, mapper, connection, target): ... - -class _MapperEventsHold(_EventsHold): - all_holds: Any = ... - def resolve(self, class_): ... - class HoldMapperEvents(_EventsHold.HoldEvents, MapperEvents): ... - dispatch: Any = ... - -class SessionEvents(event.Events): - def after_transaction_create(self, session, transaction): ... - def after_transaction_end(self, session, transaction): ... - def before_commit(self, session): ... - def after_commit(self, session): ... - def after_rollback(self, session): ... - def after_soft_rollback(self, session, previous_transaction): ... - def before_flush(self, session, flush_context, instances): ... - def after_flush(self, session, flush_context): ... - def after_flush_postexec(self, session, flush_context): ... - def after_begin(self, session, transaction, connection): ... - def before_attach(self, session, instance): ... - def after_attach(self, session, instance): ... - def after_bulk_update(self, update_context): ... - def after_bulk_delete(self, delete_context): ... - def transient_to_pending(self, session, instance): ... - def pending_to_transient(self, session, instance): ... - def persistent_to_transient(self, session, instance): ... - def pending_to_persistent(self, session, instance): ... - def detached_to_persistent(self, session, instance): ... - def loaded_as_persistent(self, session, instance): ... - def persistent_to_deleted(self, session, instance): ... - def deleted_to_persistent(self, session, instance): ... - def deleted_to_detached(self, session, instance): ... - def persistent_to_detached(self, session, instance): ... - -class AttributeEvents(event.Events): - def append(self, target, value, initiator): ... - def remove(self, target, value, initiator): ... - def set(self, target, value, oldvalue, initiator): ... - def init_scalar(self, target, value, dict_): ... - def init_collection(self, target, collection, collection_adapter): ... - def dispose_collection(self, target, collection, collection_adpater): ... - -class QueryEvents(event.Events): - def before_compile(self, query): ... diff --git a/sqlalchemy/orm/exc.pyi b/sqlalchemy/orm/exc.pyi deleted file mode 100644 index e6245770..00000000 --- a/sqlalchemy/orm/exc.pyi +++ /dev/null @@ -1,29 +0,0 @@ -from typing import Any, Optional -from .. import exc as sa_exc - -NO_STATE: Any = ... - -class StaleDataError(sa_exc.SQLAlchemyError): ... - -ConcurrentModificationError: Any = ... - -class FlushError(sa_exc.SQLAlchemyError): ... -class UnmappedError(sa_exc.InvalidRequestError): ... -class ObjectDereferencedError(sa_exc.SQLAlchemyError): ... -class DetachedInstanceError(sa_exc.SQLAlchemyError): ... - -class UnmappedInstanceError(UnmappedError): - def __init__(self, obj, msg: Optional[Any] = ...) -> None: ... - def __reduce__(self): ... - -class UnmappedClassError(UnmappedError): - def __init__(self, cls, msg: Optional[Any] = ...) -> None: ... - def __reduce__(self): ... - -class ObjectDeletedError(sa_exc.InvalidRequestError): - def __init__(self, state, msg: Optional[Any] = ...) -> None: ... - def __reduce__(self): ... - -class UnmappedColumnError(sa_exc.InvalidRequestError): ... -class NoResultFound(sa_exc.InvalidRequestError): ... -class MultipleResultsFound(sa_exc.InvalidRequestError): ... diff --git a/sqlalchemy/orm/identity.pyi b/sqlalchemy/orm/identity.pyi deleted file mode 100644 index cd9f04e2..00000000 --- a/sqlalchemy/orm/identity.pyi +++ /dev/null @@ -1,53 +0,0 @@ -from typing import Any, Optional - -class IdentityMap(object): - def __init__(self) -> None: ... - def keys(self): ... - def replace(self, state): ... - def add(self, state): ... - def update(self, dict): ... - def clear(self): ... - def check_modified(self): ... - def has_key(self, key) -> bool: ... - def popitem(self): ... - def pop(self, key, *args): ... - def setdefault(self, key, default: Optional[Any] = ...): ... - def __len__(self): ... - def copy(self): ... - def __setitem__(self, key, value): ... - def __delitem__(self, key): ... - -class WeakInstanceDict(IdentityMap): - def __getitem__(self, key): ... - def __contains__(self, key): ... - def contains_state(self, state): ... - def replace(self, state): ... - def add(self, state): ... - def get(self, key, default: Optional[Any] = ...): ... - def items(self): ... - def values(self): ... - def __iter__(self): ... - def iteritems(self): ... - def itervalues(self): ... - def all_states(self): ... - def discard(self, state): ... - def safe_discard(self, state): ... - def prune(self): ... - -class StrongInstanceDict(IdentityMap): - def itervalues(self): ... - def iteritems(self): ... - def __iter__(self): ... - def __getitem__(self, key): ... - def __contains__(self, key): ... - def get(self, key, default: Optional[Any] = ...): ... - def values(self): ... - def items(self): ... - def all_states(self): ... - def contains_state(self, state): ... - def replace(self, state): ... - def add(self, state): ... - def discard(self, state): ... - def safe_discard(self, state): ... - modified: Any = ... - def prune(self): ... diff --git a/sqlalchemy/orm/instrumentation.pyi b/sqlalchemy/orm/instrumentation.pyi deleted file mode 100644 index 5e05d21d..00000000 --- a/sqlalchemy/orm/instrumentation.pyi +++ /dev/null @@ -1,58 +0,0 @@ -from typing import Any, Optional - -class ClassManager(dict): - MANAGER_ATTR: Any = ... - STATE_ATTR: Any = ... - deferred_scalar_loader: Any = ... - original_init: Any = ... - factory: Any = ... - class_: Any = ... - info: Any = ... - new_init: Any = ... - local_attrs: Any = ... - originals: Any = ... - def __init__(self, class_) -> None: ... - def __hash__(self): ... - def __eq__(self, other): ... - @property - def is_mapped(self): ... - def manage(self): ... - def dispose(self): ... - def manager_getter(self): ... - def state_getter(self): ... - def dict_getter(self): ... - def instrument_attribute(self, key, inst, propagated: bool = ...): ... - def subclass_managers(self, recursive): ... - def post_configure_attribute(self, key): ... - def uninstrument_attribute(self, key, propagated: bool = ...): ... - mapper: Any = ... - def unregister(self): ... - def install_descriptor(self, key, inst): ... - def uninstall_descriptor(self, key): ... - def install_member(self, key, implementation): ... - def uninstall_member(self, key): ... - def instrument_collection_class(self, key, collection_class): ... - def initialize_collection(self, key, state, factory): ... - def is_instrumented(self, key, search: bool = ...): ... - def get_impl(self, key): ... - @property - def attributes(self): ... - def new_instance(self, state: Optional[Any] = ...): ... - def setup_instance(self, instance, state: Optional[Any] = ...): ... - def teardown_instance(self, instance): ... - def has_state(self, instance): ... - def has_parent(self, state, key, optimistic: bool = ...): ... - def __bool__(self): ... - __nonzero__: Any = ... - -class InstrumentationFactory(object): - def create_manager_for_cls(self, class_): ... - def unregister(self, class_): ... - -instance_state: Any = ... -instance_dict: Any = ... -manager_of_class: Any = ... - -def register_class(class_): ... -def unregister_class(class_): ... -def is_instrumented(instance, key): ... diff --git a/sqlalchemy/orm/interfaces.pyi b/sqlalchemy/orm/interfaces.pyi deleted file mode 100644 index 58bab386..00000000 --- a/sqlalchemy/orm/interfaces.pyi +++ /dev/null @@ -1,82 +0,0 @@ -from typing import Any, Optional -from .. import util -from ..sql import operators -from .base import ( - ONETOMANY as ONETOMANY, - MANYTOONE as MANYTOONE, - MANYTOMANY as MANYTOMANY, - EXT_CONTINUE as EXT_CONTINUE, - EXT_STOP as EXT_STOP, - NOT_EXTENSION as NOT_EXTENSION, - InspectionAttrInfo as InspectionAttrInfo -) -from .base import InspectionAttr as InspectionAttr, _MappedAttribute as _MappedAttribute - -MapperExtension: Any = ... -SessionExtension: Any = ... -AttributeExtension: Any = ... - -class MapperProperty(_MappedAttribute, InspectionAttr, util.MemoizedSlots): - cascade: Any = ... - is_property: bool = ... - def setup(self, context, entity, path, adapter, **kwargs): ... - def create_row_processor(self, context, path, mapper, result, adapter, populators): ... - def cascade_iterator(self, type_, state, visited_instances: Optional[Any] = ..., - halt_on: Optional[Any] = ...): ... - parent: Any = ... - def set_parent(self, parent, init): ... - def instrument_class(self, mapper): ... - def __init__(self) -> None: ... - def init(self): ... - @property - def class_attribute(self): ... - def do_init(self): ... - def post_instrument_class(self, mapper): ... - def merge(self, session, source_state, source_dict, dest_state, dest_dict, load, - _recursive, _resolve_conflict_map): ... - -class PropComparator(operators.ColumnOperators): - prop: Any = ... - def __init__(self, prop, parentmapper, adapt_to_entity: Optional[Any] = ...) -> None: ... - def __clause_element__(self): ... - def adapt_to_entity(self, adapt_to_entity): ... - @property - def adapter(self): ... - @property - def info(self): ... - @staticmethod - def any_op(a, b, **kwargs): ... - @staticmethod - def has_op(a, b, **kwargs): ... - @staticmethod - def of_type_op(a, class_): ... - def of_type(self, class_): ... - def any(self, criterion: Optional[Any] = ..., **kwargs): ... - def has(self, criterion: Optional[Any] = ..., **kwargs): ... - -class StrategizedProperty(MapperProperty): - strategy_wildcard_key: Any = ... - def setup(self, context, entity, path, adapter, **kwargs): ... - def create_row_processor(self, context, path, mapper, result, adapter, populators): ... - strategy: Any = ... - def do_init(self): ... - def post_instrument_class(self, mapper): ... - @classmethod - def strategy_for(cls, **kw): ... - -class MapperOption(object): - propagate_to_loaders: bool = ... - def process_query(self, query): ... - def process_query_conditionally(self, query): ... - -class LoaderStrategy(object): - parent_property: Any = ... - is_class_level: bool = ... - parent: Any = ... - key: Any = ... - strategy_key: Any = ... - strategy_opts: Any = ... - def __init__(self, parent, strategy_key) -> None: ... - def init_class_attribute(self, mapper): ... - def setup_query(self, context, entity, path, loadopt, adapter, **kwargs): ... - def create_row_processor(self, context, path, loadopt, mapper, result, adapter, populators): ... diff --git a/sqlalchemy/orm/loading.pyi b/sqlalchemy/orm/loading.pyi deleted file mode 100644 index 6ab97475..00000000 --- a/sqlalchemy/orm/loading.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import Any, Optional - -def instances(query, cursor, context): ... -def merge_result(query, iterator, load: bool = ...): ... -def get_from_identity(session, key, passive): ... -def load_on_ident(query, key, refresh_state: Optional[Any] = ..., lockmode: Optional[Any] = ..., - only_load_props: Optional[Any] = ...): ... -def load_scalar_attributes(mapper, state, attribute_names): ... diff --git a/sqlalchemy/orm/mapper.pyi b/sqlalchemy/orm/mapper.pyi deleted file mode 100644 index a2c7d847..00000000 --- a/sqlalchemy/orm/mapper.pyi +++ /dev/null @@ -1,102 +0,0 @@ -from typing import Any, Optional, Callable -from .interfaces import InspectionAttr -from .base import class_mapper as class_mapper - -NO_ATTRIBUTE: Any = ... - -class Mapper(InspectionAttr): - class_: Any = ... - class_manager: Any = ... - non_primary: Any = ... - order_by: Any = ... - always_refresh: Any = ... - version_id_prop: Any = ... - version_id_col: Any = ... - version_id_generator: bool = ... - concrete: Any = ... - single: bool = ... - inherits: Any = ... - local_table: Any = ... - inherit_condition: Any = ... - inherit_foreign_keys: Any = ... - batch: Any = ... - eager_defaults: Any = ... - column_prefix: Any = ... - polymorphic_on: Any = ... - validators: Any = ... - passive_updates: Any = ... - passive_deletes: Any = ... - legacy_is_orphan: Any = ... - allow_partial_pks: Any = ... - confirm_deleted_rows: bool = ... - with_polymorphic: Any = ... - polymorphic_identity: Any = ... - polymorphic_map: Any = ... - include_properties: Any = ... - exclude_properties: Any = ... - configured: bool = ... - def __init__(self, class_, local_table: Optional[Any] = ..., - properties: Optional[Any] = ..., primary_key: Optional[Any] = ..., - non_primary: bool = ..., inherits: Optional[Any] = ..., - inherit_condition: Optional[Any] = ..., - inherit_foreign_keys: Optional[Any] = ..., extension: Optional[Any] = ..., - order_by: bool = ..., always_refresh: bool = ..., - version_id_col: Optional[Any] = ..., version_id_generator: Optional[Any] = ..., - polymorphic_on: Optional[Any] = ..., _polymorphic_map: Optional[Any] = ..., - polymorphic_identity: Optional[Any] = ..., - concrete: bool = ..., with_polymorphic: Optional[Any] = ..., - allow_partial_pks: bool = ..., batch: bool = ..., column_prefix: Optional[Any] = ..., - include_properties: Optional[Any] = ..., exclude_properties: Optional[Any] = ..., - passive_updates: bool = ..., passive_deletes: bool = ..., - confirm_deleted_rows: bool = ..., eager_defaults: bool = ..., - legacy_is_orphan: bool = ..., _compiled_cache_size: int = ...) -> None: ... - is_mapper: bool = ... - @property - def mapper(self): ... - @property - def entity(self): ... - mapped_table: Any = ... - tables: Any = ... - primary_key: Any = ... - base_mapper: Any = ... - columns: Any = ... - c: Any = ... - def dispose(self): ... - def add_properties(self, dict_of_properties): ... - def add_property(self, key, prop): ... - def has_property(self, key): ... - def get_property(self, key, _configure_mappers: bool = ...): ... - def get_property_by_column(self, column): ... - @property - def iterate_properties(self): ... - with_polymorphic_mappers: Any = ... - @property - def selectable(self): ... - def attrs(self): ... - def all_orm_descriptors(self): ... - def synonyms(self): ... - def column_attrs(self): ... - def relationships(self): ... - def composites(self): ... - def common_parent(self, other): ... - def isa(self, other): ... - def iterate_to_root(self): ... - def self_and_descendants(self): ... - def polymorphic_iterator(self): ... - def primary_mapper(self): ... - @property - def primary_base_mapper(self): ... - def identity_key_from_row(self, row, adapter: Optional[Any] = ...): ... - def identity_key_from_primary_key(self, primary_key): ... - def identity_key_from_instance(self, instance): ... - def primary_key_from_instance(self, instance): ... - def cascade_iterator(self, type_, state, halt_on: Optional[Any] = ...): ... - -def configure_mappers(): ... -def reconstructor(fn): ... -def validates(*names, **kw) -> Callable[..., Any]: ... - -class _ColumnMapping(dict): - mapper: Any = ... - def __init__(self, mapper) -> None: ... - def __missing__(self, column): ... diff --git a/sqlalchemy/orm/path_registry.pyi b/sqlalchemy/orm/path_registry.pyi deleted file mode 100644 index a268eea8..00000000 --- a/sqlalchemy/orm/path_registry.pyi +++ /dev/null @@ -1,75 +0,0 @@ -from typing import Any - -log: Any = ... - -class PathRegistry(object): - is_token: bool = ... - is_root: bool = ... - def __eq__(self, other): ... - def set(self, attributes, key, value): ... - def setdefault(self, *args, **kwargs): ... - def get(self, *args, **kwargs): ... - def __len__(self): ... - @property - def length(self): ... - def pairs(self): ... - def contains_mapper(self, mapper): ... - def contains(self, attributes, key): ... - def __reduce__(self): ... - def serialize(self): ... - @classmethod - def deserialize(cls, path): ... - @classmethod - def per_mapper(cls, mapper): ... - @classmethod - def coerce(cls, raw): ... - def token(self, token): ... - def __add__(self, other): ... - -class RootRegistry(PathRegistry): - path: Any = ... - has_entity: bool = ... - is_aliased_class: bool = ... - is_root: bool = ... - def __getitem__(self, entity): ... - -class TokenRegistry(PathRegistry): - token: Any = ... - parent: Any = ... - path: Any = ... - def __init__(self, parent, token) -> None: ... - has_entity: bool = ... - is_token: bool = ... - def generate_for_superclasses(self): ... - def __getitem__(self, entity): ... - -class PropRegistry(PathRegistry): - prop: Any = ... - parent: Any = ... - path: Any = ... - def __init__(self, parent, prop) -> None: ... - @property - def has_entity(self): ... - @property - def entity(self): ... - @property - def mapper(self): ... - @property - def entity_path(self): ... - def __getitem__(self, entity): ... - -class EntityRegistry(PathRegistry, dict): - is_aliased_class: bool = ... - has_entity: bool = ... - key: Any = ... - parent: Any = ... - entity: Any = ... - path: Any = ... - entity_path: Any = ... - def __init__(self, parent, entity) -> None: ... - @property - def mapper(self): ... - def __bool__(self): ... - __nonzero__: Any = ... - def __getitem__(self, entity): ... - def __missing__(self, key): ... diff --git a/sqlalchemy/orm/persistence.pyi b/sqlalchemy/orm/persistence.pyi deleted file mode 100644 index 0878dd7d..00000000 --- a/sqlalchemy/orm/persistence.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from typing import Any - -def save_obj(base_mapper, states, uowtransaction, single: bool = ...): ... -def post_update(base_mapper, states, uowtransaction, post_update_cols): ... -def delete_obj(base_mapper, states, uowtransaction): ... - -class BulkUD(object): - query: Any = ... - mapper: Any = ... - def __init__(self, query) -> None: ... - @property - def session(self): ... - def exec_(self): ... - -class BulkEvaluate(BulkUD): ... -class BulkFetch(BulkUD): ... - -class BulkUpdate(BulkUD): - values: Any = ... - update_kwargs: Any = ... - def __init__(self, query, values, update_kwargs) -> None: ... - @classmethod - def factory(cls, query, synchronize_session, values, update_kwargs): ... - -class BulkDelete(BulkUD): - def __init__(self, query) -> None: ... - @classmethod - def factory(cls, query, synchronize_session): ... - -class BulkUpdateEvaluate(BulkEvaluate, BulkUpdate): ... -class BulkDeleteEvaluate(BulkEvaluate, BulkDelete): ... -class BulkUpdateFetch(BulkFetch, BulkUpdate): ... -class BulkDeleteFetch(BulkFetch, BulkDelete): ... diff --git a/sqlalchemy/orm/properties.pyi b/sqlalchemy/orm/properties.pyi deleted file mode 100644 index cf8dd453..00000000 --- a/sqlalchemy/orm/properties.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from typing import Any -from .interfaces import StrategizedProperty, PropComparator -from .. import util -from .relationships import RelationshipProperty as RelationshipProperty - -class ColumnProperty(StrategizedProperty): - strategy_wildcard_key: str = ... - columns: Any = ... - group: Any = ... - deferred: Any = ... - instrument: Any = ... - comparator_factory: Any = ... - descriptor: Any = ... - extension: Any = ... - active_history: Any = ... - expire_on_flush: Any = ... - info: Any = ... - doc: Any = ... - strategy_key: Any = ... - def __init__(self, *columns, **kwargs) -> None: ... - @property - def expression(self): ... - def instrument_class(self, mapper): ... - def do_init(self): ... - def copy(self): ... - def merge(self, session, source_state, source_dict, dest_state, dest_dict, load, - _recursive, _resolve_conflict_map): ... - class Comparator(util.MemoizedSlots, PropComparator): - def _memoized_method___clause_element__(self): ... - def operate(self, op, *other, **kwargs): ... - def reverse_operate(self, op, other, **kwargs): ... diff --git a/sqlalchemy/orm/query.pyi b/sqlalchemy/orm/query.pyi deleted file mode 100644 index 0af81ba5..00000000 --- a/sqlalchemy/orm/query.pyi +++ /dev/null @@ -1,210 +0,0 @@ -from typing import Any, Optional, Union, TypeVar, Generic, List, Iterator -from . import interfaces -from .base import InspectionAttr -from ..sql.selectable import ForUpdateArg, Alias, CTE -from ..sql.elements import Label -from .session import Session - - -_T = TypeVar('_T') -_Q = TypeVar('_Q', bound="Query") - - -class Query(Generic[_T]): - session: Session = ... - def __init__(self, entities, session: Optional[Session] = ...) -> None: ... - - # TODO: is "statement" always of type sqlalchemy.sql.selectable.Select ? - @property - def statement(self): ... - def subquery(self, name: Optional[str] = ..., with_labels: bool = ..., reduce_columns: bool = ...) -> Alias: ... - def cte(self, name: Optional[str] = ..., recursive: bool = ...) -> CTE: ... - def label(self, name: str) -> Label: ... - def as_scalar(self): ... - @property - def selectable(self): ... - def __clause_element__(self): ... - def enable_eagerloads(self: _Q, value: bool) -> _Q: ... - def with_labels(self: _Q) -> _Q: ... - def enable_assertions(self: _Q, value: bool) -> _Q: ... - @property - def whereclause(self): ... - def with_polymorphic(self, cls_or_mappers, selectable: Optional[Any] = ..., - polymorphic_on: Optional[Any] = ...): ... - def yield_per(self: _Q, count: int) -> _Q: ... - def get(self, ident) -> Optional[_T]: ... - def correlate(self, *args): ... - def autoflush(self: _Q, setting: bool) -> _Q: ... - def populate_existing(self: _Q) -> _Q: ... - def with_parent(self, instance, property: Optional[Any] = ...): ... - def add_entity(self, entity, alias: Optional[Any] = ...): ... - def with_session(self: _Q, session: Optional[Session]) -> _Q: ... - def from_self(self, *entities): ... - def values(self, *columns): ... - def value(self, column): ... - def with_entities(self, *entities): ... - def add_columns(self, *column): ... - def add_column(self, column): ... - def options(self: _Q, *args) -> _Q: ... - def with_transformation(self, fn): ... - def with_hint(self, selectable, text, dialect_name: str = ...): ... - def with_statement_hint(self, text, dialect_name: str = ...): ... - def execution_options(self, **kwargs): ... - def with_lockmode(self, mode): ... - def with_for_update(self: _Q, read: bool = ..., nowait: bool = ..., of: Optional[Any] = ..., - skip_locked: bool = ..., key_share: bool = ...) -> _Q: ... - def params(self: _Q, *args, **kwargs) -> _Q: ... - def filter(self: _Q, *criterion) -> _Q: ... - def filter_by(self: _Q, **kwargs) -> _Q: ... - def order_by(self: _Q, *criterion) -> _Q: ... - def group_by(self: _Q, *criterion) -> _Q: ... - def having(self: _Q, criterion) -> _Q: ... - def union(self, *q): ... - def union_all(self, *q): ... - def intersect(self, *q): ... - def intersect_all(self, *q): ... - def except_(self, *q): ... - def except_all(self, *q): ... - def join(self, *props, **kwargs): ... - def outerjoin(self, *props, **kwargs): ... - def reset_joinpoint(self): ... - def select_from(self, *from_obj): ... - def select_entity_from(self, from_obj): ... - def __getitem__(self, item): ... - def slice(self: _Q, start: Optional[int], stop: Optional[int]) -> _Q: ... - def limit(self: _Q, limit: Optional[int]) -> _Q: ... - def offset(self: _Q, offset: Optional[int]) -> _Q: ... - def distinct(self, *criterion): ... - def prefix_with(self, *prefixes): ... - def suffix_with(self, *suffixes): ... - def all(self) -> List[_T]: ... - def from_statement(self, statement): ... - def first(self) -> Optional[_T]: ... - def one_or_none(self) -> Optional[_T]: ... - def one(self) -> _T: ... - def scalar(self): ... - def __iter__(self) -> Iterator[_T]: ... - @property - def column_descriptions(self): ... - def instances(self, cursor, __context: Optional[Any] = ...): ... - def merge_result(self, iterator, load: bool = ...): ... - def exists(self): ... - def count(self) -> int: ... - def delete(self, synchronize_session: Union[bool, str] = ...) -> int: ... - def update(self, values, synchronize_session: Union[bool, str] = ..., update_args: Optional[Any] = ...): ... - -class LockmodeArg(ForUpdateArg): - @classmethod - def parse_legacy_query(self, mode): ... - -class _QueryEntity(object): - def __new__(cls, *args, **kwargs): ... - -class _MapperEntity(_QueryEntity): - entities: Any = ... - expr: Any = ... - def __init__(self, query, entity) -> None: ... - supports_single_entity: bool = ... - use_id_for_hash: bool = ... - mapper: Any = ... - aliased_adapter: Any = ... - selectable: Any = ... - is_aliased_class: Any = ... - entity_zero: Any = ... - path: Any = ... - def setup_entity(self, ext_info, aliased_adapter): ... - def set_with_polymorphic(self, query, cls_or_mappers, selectable, polymorphic_on): ... - @property - def type(self): ... - @property - def entity_zero_or_selectable(self): ... - def corresponds_to(self, entity): ... - def adapt_to_selectable(self, query, sel): ... - def row_processor(self, query, context, result): ... - def setup_context(self, query, context): ... - -class Bundle(InspectionAttr): - single_entity: bool = ... - is_clause_element: bool = ... - is_mapper: bool = ... - is_aliased_class: bool = ... - name: str = ... - exprs: Any = ... - c: Any = ... - def __init__(self, name, *exprs, **kw) -> None: ... - columns: Any = ... - def __clause_element__(self): ... - @property - def clauses(self): ... - def label(self, name): ... - def create_row_processor(self, query, procs, labels): ... - -class _BundleEntity(_QueryEntity): - use_id_for_hash: bool = ... - bundle: Any = ... - type: Any = ... - supports_single_entity: Any = ... - def __init__(self, query, bundle, setup_entities: bool = ...) -> None: ... - @property - def entities(self): ... - @property - def entity_zero(self): ... - def corresponds_to(self, entity): ... - @property - def entity_zero_or_selectable(self): ... - def adapt_to_selectable(self, query, sel): ... - def setup_entity(self, ext_info, aliased_adapter): ... - def setup_context(self, query, context): ... - def row_processor(self, query, context, result): ... - -class _ColumnEntity(_QueryEntity): - expr: Any = ... - namespace: Any = ... - type: Any = ... - use_id_for_hash: Any = ... - column: Any = ... - froms: Any = ... - actual_froms: Any = ... - entity_zero: Any = ... - entities: Any = ... - mapper: Any = ... - def __init__(self, query, column, namespace: Optional[Any] = ...) -> None: ... - supports_single_entity: bool = ... - @property - def entity_zero_or_selectable(self): ... - def adapt_to_selectable(self, query, sel): ... - selectable: Any = ... - def setup_entity(self, ext_info, aliased_adapter): ... - def corresponds_to(self, entity): ... - def row_processor(self, query, context, result): ... - def setup_context(self, query, context): ... - -class QueryContext(object): - statement: Any = ... - from_clause: Any = ... - whereclause: Any = ... - order_by: Any = ... - multi_row_eager_loaders: bool = ... - adapter: Any = ... - froms: Any = ... - for_update: Any = ... - query: Any = ... - session: Any = ... - autoflush: Any = ... - populate_existing: Any = ... - invoke_all_eagers: Any = ... - version_check: Any = ... - refresh_state: Any = ... - primary_columns: Any = ... - secondary_columns: Any = ... - eager_order_by: Any = ... - eager_joins: Any = ... - create_eager_joins: Any = ... - propagate_options: Any = ... - attributes: Any = ... - def __init__(self, query) -> None: ... - -class AliasOption(interfaces.MapperOption): - alias: Any = ... - def __init__(self, alias) -> None: ... - def process_query(self, query): ... diff --git a/sqlalchemy/orm/relationships.pyi b/sqlalchemy/orm/relationships.pyi deleted file mode 100644 index 46277555..00000000 --- a/sqlalchemy/orm/relationships.pyi +++ /dev/null @@ -1,142 +0,0 @@ -from typing import Any, Optional, Generic, TypeVar, Union, overload, Type -from .interfaces import ( - MANYTOMANY as MANYTOMANY, - MANYTOONE as MANYTOONE, - ONETOMANY as ONETOMANY, - StrategizedProperty as StrategizedProperty, - PropComparator as PropComparator -) - -def remote(expr): ... -def foreign(expr): ... - - -_T_co = TypeVar('_T_co', covariant=True) - - -# Note: typical use case is where argument is a string, so this will require -# a plugin to infer '_T_co', otherwise a user will need to write an explicit annotation. -# It is not clear whether RelationshipProperty is covariant at this stage since -# many types are still missing. -class RelationshipProperty(StrategizedProperty, Generic[_T_co]): - strategy_wildcard_key: str = ... - uselist: Any = ... - argument: Any = ... - secondary: Any = ... - primaryjoin: Any = ... - secondaryjoin: Any = ... - post_update: bool = ... - direction: Any = ... - viewonly: bool = ... - lazy: Any = ... - single_parent: bool = ... - collection_class: Any = ... - passive_deletes: Union[bool, str] = ... - cascade_backrefs: bool = ... - passive_updates: bool = ... - remote_side: Any = ... - enable_typechecks: bool = ... - query_class: Any = ... - innerjoin: bool = ... - distinct_target_key: Any = ... - doc: Any = ... - active_history: bool = ... - join_depth: Any = ... - local_remote_pairs: Any = ... - extension: Any = ... - bake_queries: bool = ... - load_on_pending: bool = ... - comparator_factory: Any = ... - comparator: Any = ... - info: Any = ... - strategy_key: Any = ... - cascade: Any = ... - order_by: Any = ... - back_populates: Any = ... - backref: Any = ... - def __init__(self, argument: Any, secondary: Optional[Any] = ..., - primaryjoin: Optional[Any] = ..., secondaryjoin: Optional[Any] = ..., - foreign_keys: Optional[Any] = ..., uselist: Optional[Any] = ..., - order_by: Any = ..., backref: Optional[Any] = ..., - back_populates: Optional[Any] = ..., post_update: bool = ..., cascade: Union[str, bool] = ..., - extension: Optional[Any] = ..., viewonly: bool = ..., - lazy: Optional[Union[str, bool]] = ..., collection_class: Optional[Any] = ..., - passive_deletes: Union[bool, str] = ..., passive_updates: bool = ..., - remote_side: Optional[Any] = ..., enable_typechecks: bool = ..., - join_depth: Optional[Any] = ..., comparator_factory: Optional[Any] = ..., - single_parent: bool = ..., innerjoin: bool = ..., distinct_target_key: Optional[Any] = ..., - doc: Optional[Any] = ..., active_history: bool = ..., cascade_backrefs: bool = ..., - load_on_pending: bool = ..., bake_queries: bool = ..., - _local_remote_pairs: Optional[Any] = ..., query_class: Optional[Any] = ..., - info: Optional[Any] = ...) -> None: ... - def instrument_class(self, mapper): ... - class Comparator(PropComparator): - prop: Any = ... - def __init__(self, prop, parentmapper, adapt_to_entity: Optional[Any] = ..., - of_type: Optional[Any] = ...) -> None: ... - def adapt_to_entity(self, adapt_to_entity): ... - def mapper(self): ... - def __clause_element__(self): ... - def of_type(self, cls): ... - def in_(self, other): ... - __hash__: Any = ... - def __eq__(self, other): ... - def any(self, criterion: Optional[Any] = ..., **kwargs): ... - def has(self, criterion: Optional[Any] = ..., **kwargs): ... - def contains(self, other, **kwargs): ... - def __ne__(self, other): ... - @property - def property(self): ... - # This doesn't exist at runtime, and Comparator is used instead, but it is hard to explain to mypy. - def __eq__(self, other: Any) -> Any: ... - def merge(self, session, source_state, source_dict, dest_state, dest_dict, - load, _recursive, _resolve_conflict_map): ... - def cascade_iterator(self, *args, **kwargs): ... - @property - def mapper(self): ... - def table(self): ... - def do_init(self): ... - # This doesn't exist at runtime, but is present here for better typing. - @overload - def __get__(self, instance: None, owner: Any) -> RelationshipProperty[_T_co]: ... - @overload - def __get__(self, instance: object, owner: Any) -> _T_co: ... - -class JoinCondition(object): - parent_selectable: Any = ... - parent_local_selectable: Any = ... - child_selectable: Any = ... - child_local_selectable: Any = ... - parent_equivalents: Any = ... - child_equivalents: Any = ... - primaryjoin: Any = ... - secondaryjoin: Any = ... - secondary: Any = ... - consider_as_foreign_keys: Any = ... - prop: Any = ... - self_referential: Any = ... - support_sync: Any = ... - can_be_synced_fn: Any = ... - def __init__(self, parent_selectable, child_selectable, parent_local_selectable, - child_local_selectable, primaryjoin: Optional[Any] = ..., - secondary: Optional[Any] = ..., secondaryjoin: Optional[Any] = ..., - parent_equivalents: Optional[Any] = ..., child_equivalents: Optional[Any] = ..., - consider_as_foreign_keys: Optional[Any] = ..., local_remote_pairs: Optional[Any] = ..., - remote_side: Optional[Any] = ..., self_referential: bool = ..., prop: Optional[Any] = ..., - support_sync: bool = ..., can_be_synced_fn: Any = ...) -> None: ... - @property - def primaryjoin_minus_local(self): ... - @property - def secondaryjoin_minus_local(self): ... - @property - def primaryjoin_reverse_remote(self): ... - @property - def remote_columns(self): ... - @property - def local_columns(self): ... - @property - def foreign_key_columns(self): ... - def deannotated_primaryjoin(self): ... - def deannotated_secondaryjoin(self): ... - def join_targets(self, source_selectable, dest_selectable, aliased, single_crit: Optional[Any] = ...): ... - def create_lazy_clause(self, reverse_direction: bool = ...): ... diff --git a/sqlalchemy/orm/scoping.pyi b/sqlalchemy/orm/scoping.pyi deleted file mode 100644 index ba7502b3..00000000 --- a/sqlalchemy/orm/scoping.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from typing import Any, Optional - -from .session import Session - -class scoped_session(Session): # not true at runtime, methods are set dynamically and wrapped - session_factory: Any = ... - registry: Any = ... - def __init__(self, session_factory, scopefunc: Optional[Any] = ...) -> None: ... - def __call__(self, **kw): ... - def remove(self): ... - def configure(self, **kwargs): ... - def query_property(self, query_cls: Optional[Any] = ...): ... - -ScopedSession = scoped_session diff --git a/sqlalchemy/orm/session.pyi b/sqlalchemy/orm/session.pyi deleted file mode 100644 index b0c588cc..00000000 --- a/sqlalchemy/orm/session.pyi +++ /dev/null @@ -1,114 +0,0 @@ -from typing import Any, Optional, Tuple, Type, TypeVar, overload - -from sqlalchemy import Column -from sqlalchemy.orm.query import Query - -class _SessionClassMethods(object): - @classmethod - def close_all(cls): ... - @classmethod - def identity_key(cls, *args, **kwargs): ... - @classmethod - def object_session(cls, instance): ... - -class SessionTransaction(object): - session: Any = ... - nested: Any = ... - def __init__(self, session, parent: Optional[Any] = ..., nested: bool = ...) -> None: ... - @property - def parent(self): ... - @property - def is_active(self): ... - def connection(self, bindkey, execution_options: Optional[Any] = ..., **kwargs): ... - def prepare(self): ... - def commit(self): ... - def rollback(self, _capture_exception: bool = ...): ... - def close(self, invalidate: bool = ...): ... - def __enter__(self): ... - def __exit__(self, type, value, traceback): ... - -_T = TypeVar("_T") - -class Session(_SessionClassMethods): - public_methods: Any = ... - identity_map: Any = ... - bind: Any = ... - transaction: Any = ... - hash_key: Any = ... - autoflush: Any = ... - autocommit: Any = ... - expire_on_commit: Any = ... - twophase: Any = ... - def __init__(self, bind: Optional[Any] = ..., autoflush: bool = ..., expire_on_commit: bool = ..., - _enable_transaction_accounting: bool = ..., autocommit: bool = ..., - twophase: bool = ..., weak_identity_map: bool = ..., - binds: Optional[Any] = ..., extension: Optional[Any] = ..., - info: Optional[Any] = ..., query_cls: Any = ...) -> None: ... - connection_callable: Any = ... - @property - def info(self): ... - def begin(self, subtransactions: bool = ..., nested: bool = ...) -> SessionTransaction: ... - def begin_nested(self) -> SessionTransaction: ... - def rollback(self) -> None: ... - def commit(self) -> None: ... - def prepare(self): ... - def connection(self, mapper: Optional[Any] = ..., clause: Optional[Any] = ..., - bind: Optional[Any] = ..., close_with_result: bool = ..., - execution_options: Optional[Any] = ..., **kw): ... - def execute(self, clause, params: Optional[Any] = ..., - mapper: Optional[Any] = ..., bind: Optional[Any] = ..., **kw): ... - def scalar(self, clause, params: Optional[Any] = ..., - mapper: Optional[Any] = ..., bind: Optional[Any] = ..., **kw): ... - def close(self) -> None: ... - def invalidate(self) -> None: ... - def expunge_all(self) -> None: ... - def bind_mapper(self, mapper, bind): ... - def bind_table(self, table, bind): ... - def get_bind(self, mapper: Optional[Any] = ..., clause: Optional[Any] = ...): ... - @overload - def query(self, entity: Type[_T], **kwargs) -> Query[_T]: ... - @overload - def query(self, entity: Column[_T], **kwargs) -> Query[Tuple[_T]]: ... - @overload - def query(self, *entities, **kwargs) -> Query[Any]: ... # plugin is needed for precise type - @property - def no_autoflush(self): ... - def refresh(self, instance, attribute_names: Optional[Any] = ..., lockmode: Optional[Any] = ...): ... - def expire_all(self) -> None: ... - def expire(self, instance, attribute_names: Optional[Any] = ...) -> None: ... - def prune(self): ... - def expunge(self, instance) -> None: ... - def add(self, instance, _warn: bool = ...) -> None: ... - def add_all(self, instances) -> None: ... - def delete(self, instance): ... - def merge(self, instance: _T, load: bool = ...) -> _T: ... - def enable_relationship_loading(self, obj): ... - def __contains__(self, instance): ... - def __iter__(self): ... - def flush(self, objects: Optional[Any] = ...) -> None: ... - def bulk_save_objects(self, objects, return_defaults: bool = ..., update_changed_only: bool = ...): ... - def bulk_insert_mappings(self, mapper, mappings, return_defaults: bool = ..., render_nulls: bool = ...): ... - def bulk_update_mappings(self, mapper, mappings): ... - def is_modified(self, instance, include_collections: bool = ..., passive: bool = ...): ... - @property - def is_active(self) -> bool: ... - @property - def dirty(self): ... - @property - def deleted(self): ... - @property - def new(self): ... - -class sessionmaker(_SessionClassMethods): - kw: Any = ... - class_: Any = ... - def __init__(self, bind: Optional[Any] = ..., class_: Any = ..., autoflush: bool = ..., - autocommit: bool = ..., expire_on_commit: bool = ..., - info: Optional[Any] = ..., **kw) -> None: ... - def __call__(self, **local_kw): ... - def configure(self, **new_kw): ... - -def make_transient(instance) -> None: ... -def make_transient_to_detached(instance) -> None: ... -def object_session(instance): ... -def close_all_sessions() -> None: ... diff --git a/sqlalchemy/orm/state.pyi b/sqlalchemy/orm/state.pyi deleted file mode 100644 index 4e3ce467..00000000 --- a/sqlalchemy/orm/state.pyi +++ /dev/null @@ -1,86 +0,0 @@ -from typing import Any -from . import interfaces -from .base import ( - PASSIVE_NO_RESULT as PASSIVE_NO_RESULT, - SQL_OK as SQL_OK, - NEVER_SET as NEVER_SET, - ATTR_WAS_SET as ATTR_WAS_SET, - NO_VALUE as NO_VALUE, - PASSIVE_NO_INITIALIZE as PASSIVE_NO_INITIALIZE, - INIT_OK as INIT_OK, - PASSIVE_OFF as PASSIVE_OFF -) - -class InstanceState(interfaces.InspectionAttr): - session_id: Any = ... - key: Any = ... - runid: Any = ... - load_options: Any = ... - load_path: Any = ... - insert_order: Any = ... - modified: bool = ... - expired: bool = ... - is_instance: bool = ... - callables: Any = ... - class_: Any = ... - manager: Any = ... - obj: Any = ... - committed_state: Any = ... - expired_attributes: Any = ... - def __init__(self, obj, manager) -> None: ... - @property - def attrs(self): ... - @property - def transient(self): ... - @property - def pending(self): ... - @property - def deleted(self): ... - @property - def was_deleted(self): ... - @property - def persistent(self): ... - @property - def detached(self): ... - @property - def session(self): ... - @property - def object(self): ... - @property - def identity(self): ... - @property - def identity_key(self): ... - @property - def parents(self): ... - @property - def mapper(self): ... - @property - def has_identity(self) -> bool: ... - @property - def dict(self): ... - def get_history(self, key, passive): ... - def get_impl(self, key): ... - @property - def unmodified(self): ... - def unmodified_intersection(self, keys): ... - @property - def unloaded(self): ... - -class AttributeState(object): - state: Any = ... - key: Any = ... - def __init__(self, state, key) -> None: ... - @property - def loaded_value(self): ... - @property - def value(self): ... - @property - def history(self): ... - def load_history(self): ... - -class PendingCollection(object): - deleted_items: Any = ... - added_items: Any = ... - def __init__(self) -> None: ... - def append(self, value): ... - def remove(self, value): ... diff --git a/sqlalchemy/orm/strategies.pyi b/sqlalchemy/orm/strategies.pyi deleted file mode 100644 index 13d78443..00000000 --- a/sqlalchemy/orm/strategies.pyi +++ /dev/null @@ -1,87 +0,0 @@ -from typing import Any, Optional -from .. import util -from .interfaces import LoaderStrategy as LoaderStrategy - -class UninstrumentedColumnLoader(LoaderStrategy): - columns: Any = ... - def __init__(self, parent, strategy_key) -> None: ... - def setup_query(self, context, entity, path, loadopt, adapter, - column_collection: Optional[Any] = ..., **kwargs): ... - def create_row_processor(self, context, path, loadopt, mapper, result, adapter, populators): ... - -class ColumnLoader(LoaderStrategy): - columns: Any = ... - is_composite: Any = ... - def __init__(self, parent, strategy_key) -> None: ... - def setup_query(self, context, entity, path, loadopt, - adapter, column_collection, memoized_populators, **kwargs): ... - is_class_level: bool = ... - def init_class_attribute(self, mapper): ... - def create_row_processor(self, context, path, loadopt, mapper, result, adapter, populators): ... - -class DeferredColumnLoader(LoaderStrategy): - columns: Any = ... - group: Any = ... - def __init__(self, parent, strategy_key) -> None: ... - def create_row_processor(self, context, path, loadopt, mapper, result, adapter, populators): ... - is_class_level: bool = ... - def init_class_attribute(self, mapper): ... - def setup_query(self, *args, **kw): ... - -class LoadDeferredColumns(object): - key: Any = ... - def __init__(self, key) -> None: ... - def __call__(self, state, passive: Any = ...): ... - -class AbstractRelationshipLoader(LoaderStrategy): - mapper: Any = ... - target: Any = ... - uselist: Any = ... - def __init__(self, parent, strategy_key) -> None: ... - -class NoLoader(AbstractRelationshipLoader): - is_class_level: bool = ... - def init_class_attribute(self, mapper): ... - def create_row_processor(self, context, path, loadopt, mapper, result, adapter, populators): ... - -class LazyLoader(AbstractRelationshipLoader, util.MemoizedSlots): - use_get: Any = ... - def __init__(self, parent, strategy_key) -> None: ... - is_class_level: bool = ... - def init_class_attribute(self, mapper): ... - def create_row_processor(self, context, path, loadopt, mapper, result, adapter, populators): ... - -class LoadLazyAttribute(object): - key: Any = ... - strategy_key: Any = ... - def __init__(self, key, initiating_strategy) -> None: ... - def __call__(self, state, passive: Any = ...): ... - -class ImmediateLoader(AbstractRelationshipLoader): - def init_class_attribute(self, mapper): ... - def setup_query(self, context, entity, path, loadopt, adapter, column_collection: Optional[Any] = ..., - parentmapper: Optional[Any] = ..., **kwargs): ... - def create_row_processor(self, context, path, loadopt, mapper, result, adapter, populators): ... - -class SubqueryLoader(AbstractRelationshipLoader): - join_depth: Any = ... - def __init__(self, parent, strategy_key) -> None: ... - def init_class_attribute(self, mapper): ... - def setup_query(self, context, entity, path, loadopt, adapter, column_collection: Optional[Any] = ..., - parentmapper: Optional[Any] = ..., **kwargs): ... - class _SubqCollections(object): - subq: Any = ... - def __init__(self, subq) -> None: ... - def get(self, key, default): ... - def loader(self, state, dict_, row): ... - def create_row_processor(self, context, path, loadopt, mapper, result, adapter, populators): ... - -class JoinedLoader(AbstractRelationshipLoader): - join_depth: Any = ... - def __init__(self, parent, strategy_key) -> None: ... - def init_class_attribute(self, mapper): ... - def setup_query(self, context, entity, path, loadopt, adapter, column_collection: Optional[Any] = ..., - parentmapper: Optional[Any] = ..., chained_from_outerjoin: bool = ..., **kwargs): ... - def create_row_processor(self, context, path, loadopt, mapper, result, adapter, populators): ... - -def single_parent_validator(desc, prop): ... diff --git a/sqlalchemy/orm/strategy_options.pyi b/sqlalchemy/orm/strategy_options.pyi deleted file mode 100644 index 5f05fff1..00000000 --- a/sqlalchemy/orm/strategy_options.pyi +++ /dev/null @@ -1,45 +0,0 @@ -from typing import Any, Optional -from .interfaces import MapperOption -from ..sql.base import Generative - -class Load(Generative, MapperOption): - path: Any = ... - context: Any = ... - local_opts: Any = ... - def __init__(self, entity) -> None: ... - @classmethod - def for_existing_path(cls, path): ... - is_opts_only: bool = ... - strategy: Any = ... - propagate_to_loaders: bool = ... - def process_query(self, query): ... - def process_query_conditionally(self, query): ... - def set_relationship_strategy(self, attr, strategy, propagate_to_loaders: bool = ...): ... - def set_column_strategy(self, attrs, strategy, opts: Optional[Any] = ..., opts_only: bool = ...): ... - -class _UnboundLoad(Load): - path: Any = ... - local_opts: Any = ... - def __init__(self) -> None: ... - -class loader_option(object): - def __init__(self) -> None: ... - name: str = ... - fn: Any = ... - def __call__(self, fn): ... - -def contains_eager(loadopt, attr, alias: Optional[Any] = ...): ... -def load_only(loadopt, *attrs): ... -def joinedload(loadopt, attr, innerjoin: Optional[Any] = ...): ... -def joinedload_all(*keys, **kw): ... -def subqueryload(loadopt, attr): ... -def subqueryload_all(*keys): ... -def lazyload(loadopt, attr): ... -def lazyload_all(*keys): ... -def immediateload(loadopt, attr): ... -def noload(loadopt, attr): ... -def raiseload(loadopt, attr, sql_only: bool = ...): ... -def defaultload(loadopt, attr): ... -def defer(loadopt, key): ... -def undefer(loadopt, key): ... -def undefer_group(loadopt, name): ... diff --git a/sqlalchemy/orm/sync.pyi b/sqlalchemy/orm/sync.pyi deleted file mode 100644 index 423af4dd..00000000 --- a/sqlalchemy/orm/sync.pyi +++ /dev/null @@ -1,6 +0,0 @@ -def populate(source, source_mapper, dest, dest_mapper, synchronize_pairs, uowcommit, flag_cascaded_pks): ... -def bulk_populate_inherit_keys(source_dict, source_mapper, synchronize_pairs): ... -def clear(dest, dest_mapper, synchronize_pairs): ... -def update(source, source_mapper, dest, old_prefix, synchronize_pairs): ... -def populate_dict(source, source_mapper, dict_, synchronize_pairs): ... -def source_modified(uowcommit, source, source_mapper, synchronize_pairs): ... diff --git a/sqlalchemy/orm/unitofwork.pyi b/sqlalchemy/orm/unitofwork.pyi deleted file mode 100644 index b090306f..00000000 --- a/sqlalchemy/orm/unitofwork.pyi +++ /dev/null @@ -1,92 +0,0 @@ -from typing import Any, Optional - -def track_cascade_events(descriptor, prop): ... - -class UOWTransaction(object): - session: Any = ... - attributes: Any = ... - deps: Any = ... - mappers: Any = ... - presort_actions: Any = ... - postsort_actions: Any = ... - dependencies: Any = ... - states: Any = ... - post_update_states: Any = ... - def __init__(self, session) -> None: ... - @property - def has_work(self): ... - def was_already_deleted(self, state): ... - def is_deleted(self, state): ... - def memo(self, key, callable_): ... - def remove_state_actions(self, state): ... - def get_attribute_history(self, state, key, passive: Any = ...): ... - def has_dep(self, processor): ... - def register_preprocessor(self, processor, fromparent): ... - def register_object(self, state, isdelete: bool = ..., listonly: bool = ..., - cancel_delete: bool = ..., operation: Optional[Any] = ..., - prop: Optional[Any] = ...): ... - def issue_post_update(self, state, post_update_cols): ... - def filter_states_for_dep(self, dep, states): ... - def states_for_mapper_hierarchy(self, mapper, isdelete, listonly): ... - def execute(self): ... - def finalize_flush_changes(self): ... - -class IterateMappersMixin(object): ... - -class Preprocess(IterateMappersMixin): - dependency_processor: Any = ... - fromparent: Any = ... - processed: Any = ... - setup_flush_actions: bool = ... - def __init__(self, dependency_processor, fromparent) -> None: ... - def execute(self, uow): ... - -class PostSortRec(object): - disabled: bool = ... - def __new__(cls, uow, *args): ... - def execute_aggregate(self, uow, recs): ... - -class ProcessAll(IterateMappersMixin, PostSortRec): - dependency_processor: Any = ... - delete: Any = ... - fromparent: Any = ... - def __init__(self, uow, dependency_processor, delete, fromparent) -> None: ... - def execute(self, uow): ... - def per_state_flush_actions(self, uow): ... - -class IssuePostUpdate(PostSortRec): - mapper: Any = ... - isdelete: Any = ... - def __init__(self, uow, mapper, isdelete) -> None: ... - def execute(self, uow): ... - -class SaveUpdateAll(PostSortRec): - mapper: Any = ... - def __init__(self, uow, mapper) -> None: ... - def execute(self, uow): ... - def per_state_flush_actions(self, uow): ... - -class DeleteAll(PostSortRec): - mapper: Any = ... - def __init__(self, uow, mapper) -> None: ... - def execute(self, uow): ... - def per_state_flush_actions(self, uow): ... - -class ProcessState(PostSortRec): - dependency_processor: Any = ... - delete: Any = ... - state: Any = ... - def __init__(self, uow, dependency_processor, delete, state) -> None: ... - def execute_aggregate(self, uow, recs): ... - -class SaveUpdateState(PostSortRec): - state: Any = ... - mapper: Any = ... - def __init__(self, uow, state, mapper) -> None: ... - def execute_aggregate(self, uow, recs): ... - -class DeleteState(PostSortRec): - state: Any = ... - mapper: Any = ... - def __init__(self, uow, state, mapper) -> None: ... - def execute_aggregate(self, uow, recs): ... diff --git a/sqlalchemy/orm/util.pyi b/sqlalchemy/orm/util.pyi deleted file mode 100644 index d7790676..00000000 --- a/sqlalchemy/orm/util.pyi +++ /dev/null @@ -1,78 +0,0 @@ -from typing import Any, Optional, Text -from ..sql.selectable import FromClause - -from ..sql import expression -from ..sql import util as sql_util -from .base import InspectionAttr as InspectionAttr, object_mapper as object_mapper - -all_cascades: Any = ... - -class CascadeOptions(frozenset): - save_update: Any = ... - delete: Any = ... - refresh_expire: Any = ... - merge: Any = ... - expunge: Any = ... - delete_orphan: Any = ... - def __new__(cls, value_list): ... - @classmethod - def from_string(cls, arg): ... - -def polymorphic_union(table_map, typecolname, aliasname: str = ..., cast_nulls: bool = ...): ... -def identity_key(*args, **kwargs): ... - -class ORMAdapter(sql_util.ColumnAdapter): - mapper: Any = ... - aliased_class: Any = ... - def __init__(self, entity, equivalents: Optional[Any] = ..., - adapt_required: bool = ..., chain_to: Optional[Any] = ..., - allow_label_resolve: bool = ..., anonymize_labels: bool = ...) -> None: ... - -class AliasedClass(object): - __name__: Any = ... - def __init__(self, cls: Any, alias: Optional[FromClause] = ..., name: Optional[Text] = ..., - flat: bool = ..., adapt_on_names: bool = ..., with_polymorphic_mappers: Any = ..., - with_polymorphic_discriminator: Optional[Any] = ..., base_alias: Optional[Any] = ..., - use_mapper_path: bool = ...) -> None: ... - def __getattr__(self, key): ... - -class AliasedInsp(InspectionAttr): - entity: Any = ... - mapper: Any = ... - selectable: Any = ... - name: str = ... - with_polymorphic_mappers: Any = ... - polymorphic_on: Any = ... - def __init__(self, entity, mapper, selectable, name, - with_polymorphic_mappers, polymorphic_on, _base_alias, _use_mapper_path, - adapt_on_names) -> None: ... - is_aliased_class: bool = ... - @property - def class_(self): ... - -def aliased(element: Any, alias: Optional[FromClause] = ..., name: Optional[Text] = ..., - flat: bool = ..., adapt_on_names: bool = ...) -> AliasedClass: ... -def with_polymorphic(base, classes, selectable: bool = ..., flat: bool = ..., - polymorphic_on: Optional[Any] = ..., aliased: bool = ..., - innerjoin: bool = ..., _use_mapper_path: bool = ..., - _existing_alias: Optional[Any] = ...): ... - -class _ORMJoin(expression.Join): - __visit_name__: Any = ... - onclause: Any = ... - def __init__(self, left, right, onclause: Optional[Any] = ..., - isouter: bool = ..., full: bool = ..., - _left_memo: Optional[Any] = ..., _right_memo: Optional[Any] = ...) -> None: ... - def join(self, right, onclause: Optional[Any] = ..., - isouter: bool = ..., full: bool = ..., join_to_left: Optional[Any] = ...): ... - def outerjoin(self, right, onclause: Optional[Any] = ..., - full: bool = ..., join_to_left: Optional[Any] = ...): ... - -def join(left, right, onclause: Optional[Any] = ..., isouter: bool = ..., - full: bool = ..., join_to_left: Optional[Any] = ...): ... -def outerjoin(left, right, onclause: Optional[Any] = ..., - full: bool = ..., join_to_left: Optional[Any] = ...): ... -def with_parent(instance, prop): ... -def has_identity(object) -> bool: ... -def was_deleted(object) -> bool: ... -def randomize_unitofwork(): ... diff --git a/sqlalchemy/pool.pyi b/sqlalchemy/pool.pyi deleted file mode 100644 index 4269ebec..00000000 --- a/sqlalchemy/pool.pyi +++ /dev/null @@ -1,60 +0,0 @@ -from typing import Any, Optional, Deque -from . import log - -proxies: Any = ... - -def manage(module, **params): ... -def clear_managers(): ... - -reset_rollback: Any = ... -reset_commit: Any = ... -reset_none: Any = ... - -class Pool(log.Identified): - logging_name: str = ... - echo: Any - def __init__(self, creator, recycle: int = ..., echo: Optional[Any] = ..., use_threadlocal: bool = ..., - logging_name: Optional[Any] = ..., reset_on_return: bool = ..., listeners: Optional[Any] = ..., - events: Optional[Any] = ..., dialect: Optional[Any] = ..., - _dispatch: Optional[Any] = ...) -> None: ... - def add_listener(self, listener): ... - def unique_connection(self): ... - def recreate(self): ... - def dispose(self): ... - def connect(self): ... - def status(self): ... - -class SingletonThreadPool(Pool): - size: int = ... - def __init__(self, creator, pool_size: int = ..., **kw) -> None: ... - def recreate(self): ... - def dispose(self): ... - def status(self): ... - -class QueuePool(Pool): - def __init__(self, creator, pool_size: int = ..., max_overflow: int = ..., - timeout: int = ..., **kw) -> None: ... - def recreate(self): ... - def dispose(self): ... - def status(self): ... - def size(self): ... - def checkedin(self): ... - def overflow(self): ... - def checkedout(self): ... - -class NullPool(Pool): - def status(self): ... - def recreate(self): ... - def dispose(self): ... - -class StaticPool(Pool): - def connection(self): ... - def status(self): ... - def dispose(self): ... - def recreate(self): ... - -class AssertionPool(Pool): - def __init__(self, *args, **kw) -> None: ... - def status(self): ... - def dispose(self): ... - def recreate(self): ... diff --git a/sqlalchemy/processors.pyi b/sqlalchemy/processors.pyi deleted file mode 100644 index ca8eda76..00000000 --- a/sqlalchemy/processors.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import Any, Optional - -def str_to_datetime_processor_factory(regexp, type_): ... -def boolean_to_int(value): ... -def py_fallback(): ... -def to_unicode_processor_factory(encoding, errors: Optional[Any] = ...): ... -def to_conditional_unicode_processor_factory(encoding, errors: Optional[Any] = ...): ... -def to_decimal_processor_factory(target_class, scale): ... diff --git a/sqlalchemy/schema.pyi b/sqlalchemy/schema.pyi deleted file mode 100644 index a90512c2..00000000 --- a/sqlalchemy/schema.pyi +++ /dev/null @@ -1,48 +0,0 @@ -from .sql.base import SchemaVisitor as SchemaVisitor -from .sql.schema import ( - BLANK_SCHEMA as BLANK_SCHEMA, - CheckConstraint as CheckConstraint, - Column as Column, - ColumnDefault as ColumnDefault, - Constraint as Constraint, - DefaultClause as DefaultClause, - DefaultGenerator as DefaultGenerator, - FetchedValue as FetchedValue, - ForeignKey as ForeignKey, - ForeignKeyConstraint as ForeignKeyConstraint, - Index as Index, - MetaData as MetaData, - PassiveDefault as PassiveDefault, - PrimaryKeyConstraint as PrimaryKeyConstraint, - SchemaItem as SchemaItem, - Sequence as Sequence, - Table as Table, - ThreadLocalMetaData as ThreadLocalMetaData, - UniqueConstraint as UniqueConstraint, - ColumnCollectionConstraint as ColumnCollectionConstraint, - ColumnCollectionMixin as ColumnCollectionMixin -) - -from .sql.naming import conv as conv - -from .sql.ddl import ( - DDL as DDL, - CreateTable as CreateTable, - DropTable as DropTable, - CreateSequence as CreateSequence, - DropSequence as DropSequence, - CreateIndex as CreateIndex, - DropIndex as DropIndex, - CreateSchema as CreateSchema, - DropSchema as DropSchema, - _DropView as _DropView, - CreateColumn as CreateColumn, - AddConstraint as AddConstraint, - DropConstraint as DropConstraint, - DDLBase as DDLBase, - DDLElement as DDLElement, - _CreateDropBase as _CreateDropBase, - _DDLCompiles as _DDLCompiles, - sort_tables as sort_tables, - sort_tables_and_constraints as sort_tables_and_constraints -) diff --git a/sqlalchemy/sql/__init__.pyi b/sqlalchemy/sql/__init__.pyi deleted file mode 100644 index dc26a6a8..00000000 --- a/sqlalchemy/sql/__init__.pyi +++ /dev/null @@ -1,70 +0,0 @@ -from .expression import ( - Alias as Alias, - ClauseElement as ClauseElement, - ColumnCollection as ColumnCollection, - ColumnElement as ColumnElement, - CompoundSelect as CompoundSelect, - Delete as Delete, - FromClause as FromClause, - Insert as Insert, - Join as Join, - Select as Select, - Selectable as Selectable, - TableClause as TableClause, - TableSample as TableSample, - Update as Update, - alias as alias, - and_ as and_, - any_ as any_, - all_ as all_, - asc as asc, - between as between, - bindparam as bindparam, - case as case, - cast as cast, - collate as collate, - column as column, - delete as delete, - desc as desc, - distinct as distinct, - except_ as except_, - except_all as except_all, - exists as exists, - extract as extract, - false as false, - False_ as False_, - func as func, - funcfilter as funcfilter, - insert as insert, - intersect as intersect, - intersect_all as intersect_all, - join as join, - label as label, - lateral as lateral, - literal as literal, - literal_column as literal_column, - modifier as modifier, - not_ as not_, - null as null, - or_ as or_, - outerjoin as outerjoin, - outparam as outparam, - over as over, - select as select, - subquery as subquery, - table as table, - tablesample as tablesample, - text as text, - true as true, - True_ as True_, - tuple_ as tuple_, - type_coerce as type_coerce, - union as union, - union_all as union_all, - update as update, - within_group as within_group, - false as false, - true as true, - funcfilter as funcfilter -) -from .visitors import ClauseVisitor as ClauseVisitor diff --git a/sqlalchemy/sql/annotation.pyi b/sqlalchemy/sql/annotation.pyi deleted file mode 100644 index 6b5ca32f..00000000 --- a/sqlalchemy/sql/annotation.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from typing import Any, Dict, Type, TypeVar, Generic - -_T = TypeVar('_T') - -class Annotated(Generic[_T]): - __element: _T - def __new__(cls, *args): ... - def __init__(self, element: _T, values: Any) -> None: ... - def __hash__(self): ... - def __eq__(self, other): ... - def _annotate(self, values): ... - def _with_annotations(self, values): ... - def _deannotate(self, values=..., clone: bool = ...): ... - def _compiler_dispatch(self, visitor, **kw): ... - def _constructor(self): ... - def _clone(self): ... - -annotated_classes: Dict[Type[Any], Type[Annotated[Any]]] = ... diff --git a/sqlalchemy/sql/base.pyi b/sqlalchemy/sql/base.pyi deleted file mode 100644 index 75bf33da..00000000 --- a/sqlalchemy/sql/base.pyi +++ /dev/null @@ -1,83 +0,0 @@ -from typing import Any, Optional, Union, TypeVar, NoReturn, Iterable, List, Dict, Iterator, MutableMapping, Sequence -from sqlalchemy import util -from .visitors import ClauseVisitor as ClauseVisitor -from .schema import Column -from .elements import ColumnElement -from ..util import PopulateDict -from ..engine.base import Engine, Connection -from ..engine.result import ResultProxy -from .. import util - -PARSE_AUTOCOMMIT: util.symbol = ... -NO_ARG: util.symbol = ... - -_I = TypeVar('_I', bound=Immutable) - -class Immutable(object): - def unique_params(self, *optionaldict: Any, **kwargs: Any) -> Any: ... - def params(self, *optionaldict: Any, **kwargs: Any) -> Any: ... - def _clone(self: _I) -> _I: ... - -class _DialectArgView(MutableMapping[str, Any]): - def __getitem__(self, key: str) -> Any: ... - def __setitem__(self, key: str, value: Any) -> None: ... - def __delitem__(self, key: str) -> None: ... - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[Any]: ... - -class DialectKWArgs(object): - @classmethod - def argument_for(cls, dialect_name: str, argument_name: str, default: Any) -> None: ... - @property - def dialect_kwargs(self) -> _DialectArgView: ... - @property - def kwargs(self) -> _DialectArgView: ... - @property - def dialect_options(self) -> PopulateDict: ... - -class Generative(object): ... - -_E = TypeVar('_E', bound=Executable) - -class Executable(Generative): - supports_execution: bool = ... - def execution_options(self: _E, **kw: Any) -> _E: ... - def execute(self, *multiparams: Any, **params: Any) -> Optional[ResultProxy]: ... - def scalar(self, *multiparams: Any, **params: Any) -> Any: ... - @property - def bind(self) -> Optional[Union[Engine, Connection]]: ... - -class SchemaEventTarget(object): ... - -class SchemaVisitor(ClauseVisitor): - __traverse_options__: Any = ... - -class ColumnCollection(util.OrderedProperties[Column[Any]]): - def __init__(self, *columns: Column[Any]) -> None: ... - def __str__(self) -> str: ... - def replace(self, column: Column[Any]) -> None: ... - def add(self, column: Column[Any]) -> None: ... - def __delitem__(self, key: str) -> NoReturn: ... - def __setattr__(self, key: str, object: Column[Any]) -> NoReturn: ... - def __setitem__(self, key: str, value: Column[Any]) -> None: ... - def clear(self) -> NoReturn: ... - def remove(self, column: Column[Any]) -> None: ... - # signature incompatible with supertype "Properties" - def update(self, iter: Iterable[Column[Any]]) -> None: ... # type: ignore - def extend(self, iter: Iterable[Column[Any]]) -> None: ... - __hash__: None = ... # type: ignore - def __eq__(self, other: Any) -> bool: ... - def __contains__(self, other: Any) -> bool: ... - def contains_column(self, col: Column[Any]) -> bool: ... - def as_immutable(self) -> ImmutableColumnCollection: ... - -class ImmutableColumnCollection(util.ImmutableProperties[Column[Any]], ColumnCollection): - def __init__(self, data: Dict[str, Any], all_columns: Sequence[Column[Any]]) -> None: ... - -class ColumnSet(util.ordered_column_set[ColumnElement[Any]]): - def contains_column(self, col: ColumnElement[Any]) -> bool: ... - def extend(self, cols: Iterable[ColumnElement[Any]]) -> None: ... - # Return type of "__add__" incompatible with supertype "OrderedSet" - def __add__(self, other: Iterable[ColumnElement[Any]]) -> List[ColumnElement[Any]]: ... # type: ignore - def __eq__(self, other: Any) -> bool: ... - def __hash__(self) -> int: ... # type: ignore diff --git a/sqlalchemy/sql/compiler.pyi b/sqlalchemy/sql/compiler.pyi deleted file mode 100644 index b70e5756..00000000 --- a/sqlalchemy/sql/compiler.pyi +++ /dev/null @@ -1,301 +0,0 @@ -from typing import Any, Optional, Union, Set, Dict, List, Set, Pattern, TypeVar, Type, Mapping, Tuple, Callable -from .. import util, engine -from .elements import ClauseElement, BindParameter -from .type_api import TypeEngine - -RESERVED_WORDS: Set[str] = ... -LEGAL_CHARACTERS: Pattern[str] = ... -ILLEGAL_INITIAL_CHARACTERS: Set[str] = ... -BIND_PARAMS: Pattern[str] = ... -BIND_PARAMS_ESC: Pattern[str] = ... -BIND_TEMPLATES: Dict[str, str] = ... -OPERATORS: Dict[Any, str] = ... -FUNCTIONS: Dict[Any, str] = ... -EXTRACT_MAP: Dict[str, str] = ... -COMPOUND_KEYWORDS: Dict[Any, str] = ... - -class Compiled(object): - execution_options: Any = ... - dialect: engine.Dialect = ... - bind: Optional[Union[engine.Engine, engine.Connection]] = ... - preparer: Optional[IdentifierPreparer] = ... - statement: ClauseElement = ... - can_execute: Optional[bool] = ... - string: Optional[str] = ... - def __init__(self, dialect: engine.Dialect, statement: ClauseElement, - bind: Optional[Union[engine.Engine, engine.Connection]] = ..., - schema_translate_map: Optional[Any] = ..., compile_kwargs: Mapping[Any, Any] = ...) -> None: ... - def compile(self) -> str: ... - @property - def sql_compiler(self) -> SQLCompiler: ... - def process(self, obj: Any, **kwargs: Any) -> str: ... - def __str__(self) -> str: ... - def construct_params(self, params: Optional[Dict[str, Any]] = ...) -> Dict[str, Any]: ... - @property - def params(self) -> Dict[str, Any]: ... - def execute(self, *multiparams: Any, **params: Any) -> engine.ResultProxy: ... - def scalar(self, *multiparams: Any, **params: Any) -> Any: ... - -class TypeCompiler(metaclass=util.EnsureKWArgType): - ensure_kwarg: str = ... - dialect: engine.Dialect = ... - def __init__(self, dialect: engine.Dialect) -> None: ... - def process(self, type_: TypeEngine[Any], **kw: Any) -> str: ... - -_SQLC = TypeVar('_SQLC', bound=SQLCompiler) - -class SQLCompiler(Compiled): - extract_map: Dict[str, str] = ... - compound_keywords: Dict[Any, str] = ... - isdelete: bool = ... - isinsert: bool = ... - isupdate: bool = ... - isplaintext: bool = ... - returning: bool = ... - returning_precedes_values: bool = ... - render_table_with_column_in_update_from: bool = ... - ansi_bind_rules: bool = ... - insert_prefetch: Tuple[Any, ...] = ... - update_prefetch: Tuple[Any, ...] = ... - column_keys: Optional[List[str]] = ... - inline: bool = ... - binds: Dict[str, BindParameter[Any]] = ... - bind_names: Dict[BindParameter[Any], str] = ... - stack: List[Dict[str, Any]] = ... - positional: bool = ... - positiontup: List[Any] = ... - bindtemplate: str = ... - ctes: Optional[util.OrderedDict[str, Any]] = ... - label_length: int = ... - anon_map: util.PopulateDict = ... - truncated_names: Dict[str, Any] = ... - def __init__(self, dialect: engine.Dialect, statement: ClauseElement, column_keys: Optional[List[str]] = ..., - inline: bool = ..., **kwargs: Any) -> None: ... - @property - def prefetch(self) -> List[Any]: ... - def is_subquery(self) -> bool: ... - @property - def sql_compiler(self: _SQLC) -> _SQLC: ... - def construct_params(self, params: Optional[Dict[str, Any]] = ..., _group_number: Optional[Any] = ..., - _check: bool = ...) -> Dict[str, Any]: ... - @property - def params(self) -> Dict[str, Any]: ... - def default_from(self) -> str: ... - def visit_grouping(self, grouping: Any, asfrom: bool = ..., **kwargs: Any) -> str: ... - def visit_label_reference(self, element, within_columns_clause: bool = ..., **kwargs: Any) -> str: ... - def visit_textual_label_reference(self, element, within_columns_clause: bool = ..., **kwargs: Any) -> str: ... - def visit_label(self, label, add_to_result_map: Optional[Any] = ..., within_label_clause: bool = ..., - within_columns_clause: bool = ..., render_label_as_label: Optional[Any] = ..., **kw: Any) -> str: ... - def visit_column(self, column, add_to_result_map: Optional[Any] = ..., include_table: bool = ..., **kwargs: Any) -> str: ... - def escape_literal_column(self, text: str) -> str: ... - def visit_collation(self, element, **kw: Any) -> str: ... - def visit_fromclause(self, fromclause, **kwargs: Any) -> str: ... - def visit_index(self, index, **kwargs: Any) -> str: ... - def visit_typeclause(self, typeclause, **kw: Any) -> str: ... - def post_process_text(self, text: str) -> str: ... - def visit_textclause(self, textclause, **kw: Any) -> str: ... - def visit_text_as_from(self, taf, compound_index: Optional[Any] = ..., asfrom: bool = ..., - parens: bool = ..., **kw: Any) -> str: ... - def visit_null(self, expr, **kw: Any) -> str: ... - def visit_true(self, expr, **kw: Any) -> str: ... - def visit_false(self, expr, **kw: Any) -> str: ... - def visit_clauselist(self, clauselist, **kw: Any) -> str: ... - def visit_case(self, clause, **kwargs: Any) -> str: ... - def visit_type_coerce(self, type_coerce, **kw: Any) -> str: ... - def visit_cast(self, cast, **kwargs: Any) -> str: ... - def visit_over(self, over, **kwargs: Any) -> str: ... - def visit_withingroup(self, withingroup, **kwargs: Any) -> str: ... - def visit_funcfilter(self, funcfilter, **kwargs: Any) -> str: ... - def visit_extract(self, extract, **kwargs: Any) -> str: ... - def visit_function(self, func, add_to_result_map: Optional[Any] = ..., **kwargs: Any) -> str: ... - def visit_next_value_func(self, next_value, **kw: Any) -> str: ... - def visit_sequence(self, sequence: Any, **kw: Any) -> str: ... - def function_argspec(self, func, **kwargs: Any) -> str: ... - def visit_compound_select(self, cs, asfrom: bool = ..., parens: bool = ..., - compound_index: int = ..., **kwargs: Any) -> str: ... - def visit_unary(self, unary, **kw: Any) -> str: ... - def visit_istrue_unary_operator(self, element, operator, **kw: Any) -> str: ... - def visit_isfalse_unary_operator(self, element, operator, **kw: Any) -> str: ... - def visit_notmatch_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_binary(self, binary, override_operator: Optional[Any] = ..., - eager_grouping: bool = ..., **kw: Any) -> str: ... - def visit_mod_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_custom_op_binary(self, element, operator, **kw: Any) -> str: ... - def visit_custom_op_unary_operator(self, element, operator, **kw: Any) -> str: ... - def visit_custom_op_unary_modifier(self, element, operator, **kw: Any) -> str: ... - def visit_contains_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_notcontains_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_startswith_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_notstartswith_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_endswith_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_notendswith_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_like_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_notlike_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_ilike_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_notilike_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_between_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_notbetween_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_bindparam(self, bindparam, within_columns_clause: bool = ..., literal_binds: bool = ..., - skip_bind_expression: bool = ..., **kwargs: Any) -> str: ... - def render_literal_bindparam(self, bindparam, **kw: Any) -> str: ... - def render_literal_value(self, value, type_) -> str: ... - def bindparam_string(self, name, positional_names: Optional[Any] = ..., **kw: Any) -> str: ... - execution_options: Any = ... - ctes_recursive: bool = ... - def visit_cte(self, cte, asfrom: bool = ..., ashint: bool = ..., - fromhints: Optional[Any] = ..., **kwargs: Any) -> str: ... - def visit_alias(self, alias, asfrom: bool = ..., ashint: bool = ..., iscrud: bool = ..., - fromhints: Optional[Any] = ..., **kwargs: Any) -> str: ... - def visit_lateral(self, lateral, **kw: Any) -> str: ... - def visit_tablesample(self, tablesample, asfrom: bool = ..., **kw: Any) -> str: ... - def get_render_as_alias_suffix(self, alias_name_text) -> str: ... - def format_from_hint_text(self, sqltext, table, hint, iscrud) -> str: ... - def get_select_hint_text(self, byfroms) -> str: ... - def get_from_hint_text(self, table, text) -> str: ... - def get_crud_hint_text(self, table, text) -> str: ... - def get_statement_hint_text(self, hint_texts) -> str: ... - def visit_select(self, select, asfrom: bool = ..., parens: bool = ..., fromhints: Optional[Any] = ..., - compound_index: int = ..., nested_join_translation: bool = ..., - select_wraps_for: Optional[Any] = ..., lateral: bool = ..., **kwargs: Any) -> str: ... - def get_cte_preamble(self, recursive) -> str: ... - def get_select_precolumns(self, select, **kw: Any) -> str: ... - def order_by_clause(self, select, **kw: Any) -> str: ... - def for_update_clause(self, select, **kw: Any) -> str: ... - def returning_clause(self, stmt, returning_cols) -> str: ... - def limit_clause(self, select, **kw: Any) -> str: ... - def visit_table(self, table, asfrom: bool = ..., iscrud: bool = ..., ashint: bool = ..., - fromhints: Optional[Any] = ..., use_schema: bool = ..., **kwargs: Any) -> str: ... - def visit_join(self, join, asfrom: bool = ..., **kwargs: Any) -> str: ... - def visit_insert(self, insert_stmt, asfrom: bool = ..., **kw: Any) -> str: ... - def update_limit_clause(self, update_stmt) -> str: ... - def update_tables_clause(self, update_stmt, from_table, extra_froms, **kw: Any) -> str: ... - def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw: Any) -> str: ... - def visit_update(self, update_stmt, asfrom: bool = ..., **kw: Any) -> str: ... - def delete_extra_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw: Any) -> str: ... - def delete_table_clause(self, delete_stmt, from_table, extra_froms) -> str: ... - def visit_delete(self, delete_stmt, asfrom: bool = ..., **kw: Any) -> str: ... - def visit_savepoint(self, savepoint_stmt) -> str: ... - def visit_rollback_to_savepoint(self, savepoint_stmt) -> str: ... - def visit_release_savepoint(self, savepoint_stmt) -> str: ... - -class StrSQLCompiler(SQLCompiler): - def visit_getitem_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_json_getitem_op_binary(self, binary, operator, **kw: Any) -> str: ... - def visit_json_path_getitem_op_binary(self, binary, operator, **kw: Any) -> str: ... - def returning_clause(self, stmt, returning_cols) -> str: ... - def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw: Any) -> str: ... - def delete_extra_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw: Any) -> str: ... - -class DDLCompiler(Compiled): - @property - def sql_compiler(self) -> SQLCompiler: ... - @property - def type_compiler(self) -> Type[TypeCompiler]: ... - def construct_params(self, params: Optional[Any] = ...) -> Any: ... - def visit_ddl(self, ddl, **kwargs) -> str: ... - def visit_create_schema(self, create) -> str: ... - def visit_drop_schema(self, drop) -> str: ... - def visit_create_table(self, create) -> Optional[str]: ... - def visit_create_column(self, create, first_pk: bool = ...) -> str: ... - def create_table_constraints(self, table, _include_foreign_key_constraints: Optional[Any] = ...) -> str: ... - def visit_drop_table(self, drop) -> str: ... - def visit_drop_view(self, drop) -> str: ... - def visit_create_index(self, create, include_schema: bool = ..., include_table_schema: bool = ...) -> str: ... - def visit_drop_index(self, drop) -> str: ... - def visit_add_constraint(self, create) -> str: ... - def visit_set_table_comment(self, create) -> str: ... - def visit_drop_table_comment(self, drop) -> str: ... - def visit_set_column_comment(self, create) -> str: ... - def visit_drop_column_comment(self, drop) -> str: ... - def visit_create_sequence(self, create) -> str: ... - def visit_drop_sequence(self, drop) -> str: ... - def visit_drop_constraint(self, drop) -> str: ... - def get_column_specification(self, column, **kwargs) -> str: ... - def create_table_suffix(self, table) -> str: ... - def post_create_table(self, table) -> str: ... - def get_column_default_string(self, column) -> Optional[str]: ... - def visit_check_constraint(self, constraint) -> str: ... - def visit_column_check_constraint(self, constraint) -> str: ... - def visit_primary_key_constraint(self, constraint) -> str: ... - def visit_foreign_key_constraint(self, constraint) -> str: ... - def define_constraint_remote_table(self, constraint, table, preparer) -> str: ... - def visit_unique_constraint(self, constraint) -> str: ... - def define_constraint_cascades(self, constraint) -> str: ... - def define_constraint_deferrability(self, constraint) -> str: ... - def define_constraint_match(self, constraint) -> str: ... - -class GenericTypeCompiler(TypeCompiler): - def visit_FLOAT(self, type_, **kw) -> str: ... - def visit_REAL(self, type_, **kw) -> str: ... - def visit_NUMERIC(self, type_, **kw) -> str: ... - def visit_DECIMAL(self, type_, **kw) -> str: ... - def visit_INTEGER(self, type_, **kw) -> str: ... - def visit_SMALLINT(self, type_, **kw) -> str: ... - def visit_BIGINT(self, type_, **kw) -> str: ... - def visit_TIMESTAMP(self, type_, **kw) -> str: ... - def visit_DATETIME(self, type_, **kw) -> str: ... - def visit_DATE(self, type_, **kw) -> str: ... - def visit_TIME(self, type_, **kw) -> str: ... - def visit_CLOB(self, type_, **kw) -> str: ... - def visit_NCLOB(self, type_, **kw) -> str: ... - def visit_CHAR(self, type_, **kw) -> str: ... - def visit_NCHAR(self, type_, **kw) -> str: ... - def visit_VARCHAR(self, type_, **kw) -> str: ... - def visit_NVARCHAR(self, type_, **kw) -> str: ... - def visit_TEXT(self, type_, **kw) -> str: ... - def visit_BLOB(self, type_, **kw) -> str: ... - def visit_BINARY(self, type_, **kw) -> str: ... - def visit_VARBINARY(self, type_, **kw) -> str: ... - def visit_BOOLEAN(self, type_, **kw) -> str: ... - def visit_large_binary(self, type_, **kw) -> str: ... - def visit_boolean(self, type_, **kw) -> str: ... - def visit_time(self, type_, **kw) -> str: ... - def visit_datetime(self, type_, **kw) -> str: ... - def visit_date(self, type_, **kw) -> str: ... - def visit_big_integer(self, type_, **kw) -> str: ... - def visit_small_integer(self, type_, **kw) -> str: ... - def visit_integer(self, type_, **kw) -> str: ... - def visit_real(self, type_, **kw) -> str: ... - def visit_float(self, type_, **kw) -> str: ... - def visit_numeric(self, type_, **kw) -> str: ... - def visit_string(self, type_, **kw) -> str: ... - def visit_unicode(self, type_, **kw) -> str: ... - def visit_text(self, type_, **kw) -> str: ... - def visit_unicode_text(self, type_, **kw) -> str: ... - def visit_enum(self, type_, **kw) -> str: ... - def visit_null(self, type_, **kw) -> str: ... - def visit_type_decorator(self, type_, **kw) -> str: ... - def visit_user_defined(self, type_, **kw) -> str: ... - -class StrSQLTypeCompiler(GenericTypeCompiler): - def __getattr__(self, key: str) -> Any: ... - -class IdentifierPreparer(object): - reserved_words: Set[str] = ... - legal_characters: Pattern[str] = ... - illegal_initial_characters: Pattern[str] = ... - schema_for_object: Callable[[Any], str] = ... - dialect: engine.Dialect = ... - initial_quote: str = ... - final_quote: str = ... - escape_quote: str = ... - escape_to_quote: str = ... - omit_schema: bool = ... - quote_case_sensitive_collations: bool = ... - def __init__(self, dialect, initial_quote: str = ..., final_quote: Optional[str] = ..., - escape_quote: str = ..., omit_schema: bool = ...) -> None: ... - def quote_identifier(self, value: str) -> str: ... - def quote_schema(self, schema: Any, force: Optional[bool] = ...) -> str: ... - def quote(self, ident: Any, force: Optional[bool] = ...) -> str: ... - def format_collation(self, collation_name: str) -> str: ... - def format_sequence(self, sequence: Any, use_schema: bool = ...) -> str: ... - def format_label(self, label: Any, name: Optional[str] = ...) -> str: ... - def format_alias(self, alias, name: Optional[Any] = ...) -> str: ... - def format_savepoint(self, savepoint, name: Optional[Any] = ...) -> str: ... - def format_constraint(self, constraint: Any) -> str: ... - def format_table(self, table: Any, use_schema: bool = ..., name: Optional[str] = ...) -> str: ... - def format_schema(self, name: Any, quote: Optional[bool] = ...) -> str: ... - def format_column(self, column: Any, use_table: bool = ..., name: Optional[str] = ..., - table_name: Optional[str] = ...) -> str: ... - def format_table_seq(self, table: Any, use_schema: bool = ...) -> str: ... - def unformat_identifiers(self, identifiers: Any) -> List[Any]: ... diff --git a/sqlalchemy/sql/crud.pyi b/sqlalchemy/sql/crud.pyi deleted file mode 100644 index 6310e7b4..00000000 --- a/sqlalchemy/sql/crud.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from .. import util - -REQUIRED: util.symbol = ... -ISINSERT: util.symbol = ... -ISUPDATE: util.symbol = ... -ISDELETE: util.symbol = ... diff --git a/sqlalchemy/sql/ddl.pyi b/sqlalchemy/sql/ddl.pyi deleted file mode 100644 index b8082620..00000000 --- a/sqlalchemy/sql/ddl.pyi +++ /dev/null @@ -1,147 +0,0 @@ -from typing import Any, Optional, Union, List, Dict, TypeVar, Generic, Sequence, Callable, Tuple, Set -from typing_extensions import Protocol -from .elements import ClauseElement as ClauseElement, ColumnElement -from .base import Executable as Executable, SchemaVisitor as SchemaVisitor -from .schema import Table, MetaData, SchemaItem, ForeignKeyConstraint, ForeignKey -from .compiler import IdentifierPreparer -from .type_api import TypeEngine -from ..engine import Dialect, Engine, Connection, ResultProxy, Connectable - -_T = TypeVar('_T') - -class _DDLCompiles(ClauseElement): ... - -class _DDLCallable(Protocol): - def __call__(self, ddl: DDLElement, target: Optional[Union[Table, MetaData]], bind: Connection, - tables: Optional[List[Any]] = ..., state: Optional[Any] = ..., - checkfirst: bool = ...) -> bool: ... - -class _DDLOnCallback(Protocol): - def __call__(self, ddl: DDLElement, event: Optional[str], target: Optional[Union[Table, MetaData]], - connection: Connection, tables: Optional[List[Any]] = ...) -> bool: ... - -_DDLE = TypeVar('_DDLE', bound=DDLElement) - -class DDLElement(Executable, _DDLCompiles): - target: Optional[SchemaItem] = ... - on: Optional[Union[str, Tuple[str, ...], _DDLOnCallback]] = ... - dialect: Optional[Dialect] = ... - callable_: Optional[_DDLCallable] = ... - bind: Optional[Union[Engine, Connection]] = ... - def execute(self, bind: Optional[Union[Engine, Connection]] = ..., # type: ignore # incompatible with Executable.execute - target: Optional[SchemaItem] = ...) -> Optional[ResultProxy]: ... - def execute_at(self, event_name: str, target: SchemaItem) -> None: ... - def against(self: _DDLE, target: SchemaItem) -> _DDLE: ... - state: Any = ... - def execute_if(self: _DDLE, dialect: Optional[Dialect] = ..., callable_: Optional[_DDLCallable] = ..., - state: Optional[Any] = ...) -> _DDLE: ... - def __call__(self, target: Optional[Union[Table, MetaData]], bind: Connection, **kw: Any) -> Optional[ResultProxy]: ... - -class DDL(DDLElement): - __visit_name__: str = ... - statement: str = ... - context: Dict[Any, Any] = ... - on: Optional[Union[str, Tuple[str, ...], _DDLOnCallback]] = ... - def __init__(self, statement: str, on: Optional[Union[str, Tuple[str, ...], _DDLOnCallback]] = ..., - context: Optional[Dict[Any, Any]] = ..., bind: Optional[Connectable] = ...) -> None: ... - -class _CreateDropBase(DDLElement, Generic[_T]): - element: _T = ... - bind: Optional[Connection] = ... - def __init__(self, element: _T, on: Optional[Union[str, Tuple[str, ...], _DDLOnCallback]] = ..., - bind: Optional[Connection] = ...) -> None: ... - -class CreateSchema(_CreateDropBase[str]): - __visit_name__: str = ... - quote: Any = ... - def __init__(self, name: str, quote: Optional[Any] = ..., **kw) -> None: ... - -class DropSchema(_CreateDropBase[str]): - __visit_name__: str = ... - quote: Any = ... - cascade: bool = ... - def __init__(self, name: str, quote: Optional[Any] = ..., cascade: bool = ..., **kw) -> None: ... - -class CreateTable(_CreateDropBase[Table]): - __visit_name__: str = ... - columns: List[CreateColumn[Any]] = ... - include_foreign_key_constraints: Optional[Sequence[ForeignKeyConstraint]] = ... - def __init__(self, element: Table, on: Optional[Union[str, Tuple[str, ...], _DDLOnCallback]] = ..., - bind: Optional[Connectable] = ..., - include_foreign_key_constraints: Optional[Sequence[ForeignKeyConstraint]] = ...) -> None: ... - -class _DropView(_CreateDropBase[str]): - __visit_name__: str = ... - -class CreateColumn(_DDLCompiles, Generic[_T]): - __visit_name__: str = ... - element: ColumnElement[_T] = ... - def __init__(self, element: ColumnElement[_T]) -> None: ... - -class DropTable(_CreateDropBase[str]): - __visit_name__: str = ... - -class CreateSequence(_CreateDropBase[str]): - __visit_name__: str = ... - -class DropSequence(_CreateDropBase[str]): - __visit_name__: str = ... - -class CreateIndex(_CreateDropBase[str]): - __visit_name__: str = ... - -class DropIndex(_CreateDropBase[str]): - __visit_name__: str = ... - -class AddConstraint(_CreateDropBase[str]): - __visit_name__: str = ... - def __init__(self, element: str, *args: Any, **kw: Any) -> None: ... - -class DropConstraint(_CreateDropBase[str]): - __visit_name__: str = ... - cascade: bool = ... - def __init__(self, element: str, cascade: bool = ..., **kw: Any) -> None: ... - -class DDLBase(SchemaVisitor): - connection: Connection = ... - def __init__(self, connection: Connection) -> None: ... - -class SchemaGenerator(DDLBase): - checkfirst: bool = ... - tables: Optional[List[Table]] = ... - preparer: IdentifierPreparer = ... - dialect: Dialect = ... - memo: Dict[Any, Any] = ... - def __init__(self, dialect: Dialect, connection: Connection, checkfirst: bool = ..., - tables: Optional[List[Table]] = ..., **kwargs: Any) -> None: ... - def visit_metadata(self, metadata: MetaData) -> None: ... - def visit_table(self, table: Table, create_ok: bool = ..., - include_foreign_key_constraints: Optional[Sequence[ForeignKeyConstraint]] = ..., - _is_metadata_operation: bool = ...) -> None: ... - def visit_foreign_key_constraint(self, constraint: ForeignKeyConstraint) -> None: ... - def visit_sequence(self, sequence: str, create_ok: bool = ...): ... - def visit_index(self, index: str) -> None: ... - -class SchemaDropper(DDLBase): - checkfirst: bool = ... - tables: Optional[List[Table]] = ... - preparer: IdentifierPreparer = ... - dialect: Dialect = ... - memo: Dict[Any, Any] = ... - def __init__(self, dialect: Dialect, connection: Connection, checkfirst: bool = ..., - tables: Optional[List[Table]] = ..., **kwargs: Any) -> None: ... - def visit_metadata(self, metadata: MetaData) -> None: ... - def visit_index(self, index: str) -> None: ... - def visit_table(self, table: Table, drop_ok: bool = ..., _is_metadata_operation: bool = ...) -> None: ... - def visit_foreign_key_constraint(self, constraint: ForeignKeyConstraint) -> None: ... - def visit_sequence(self, sequence: str, drop_ok: bool = ...) -> None: ... - -def sort_tables(tables: Sequence[Table], skip_fn: Optional[Callable[[ForeignKey], bool]] = ..., - extra_dependencies: Optional[Sequence[Tuple[Table, Table]]] = ...) -> List[Table]: ... - - -_SortResultType = List[Tuple[Optional[Table], Union[Set[ForeignKeyConstraint], List[ForeignKeyConstraint]]]] - -def sort_tables_and_constraints(tables: Sequence[Table], - filter_fn: Optional[Callable[[ForeignKeyConstraint], Optional[bool]]] = ..., - extra_dependencies: Optional[Sequence[Tuple[Table, Table]]] = ...) -> _SortResultType: ... diff --git a/sqlalchemy/sql/dml.pyi b/sqlalchemy/sql/dml.pyi deleted file mode 100644 index 9b8886b9..00000000 --- a/sqlalchemy/sql/dml.pyi +++ /dev/null @@ -1,65 +0,0 @@ -from typing import Any, Optional, Union, TypeVar, Iterable, Tuple -from .base import Executable as Executable, DialectKWArgs as DialectKWArgs -from .elements import ClauseElement as ClauseElement, ColumnElement, TextClause -from .selectable import HasPrefixes as HasPrefixes, HasCTE as HasCTE, TableClause, Selectable -from .schema import Table, Column -from .visitors import Visitable - -_UB = TypeVar('_UB', bound=UpdateBase) - -class UpdateBase(HasCTE, DialectKWArgs, HasPrefixes, Executable, ClauseElement): - __visit_name__: str = ... - named_with_column: bool = ... - def params(self, *arg: Any, **kw: Any) -> Any: ... - bind: Any = ... - def returning(self: _UB, *cols: Union[ColumnElement[Any], Table]) -> _UB: ... - def with_hint(self: _UB, text: str, selectable: Optional[Table] = ..., dialect_name: str = ...) -> _UB: ... - -_VB = TypeVar('_VB', bound=ValuesBase) - -class ValuesBase(UpdateBase): - __visit_name__: str = ... - select: Any = ... - table: Union[TextClause, Selectable] = ... - def __init__(self, table: Union[str, Selectable], values: Any, prefixes: Any) -> None: ... - parameters: Any = ... - def values(self: _VB, *args: Any, **kwargs: Any) -> _VB: ... - def return_defaults(self: _VB, *cols: Any) -> _VB: ... - -_I = TypeVar('_I', bound=Insert) - -class Insert(ValuesBase): - __visit_name__: str = ... - select: Optional[Selectable] = ... - include_insert_from_select_defaults: bool = ... - inline: bool = ... - select_names: Optional[Iterable[Union[str, Column[Any]]]] = ... - def __init__(self, table: Union[str, Selectable], values: Optional[Any] = ..., inline: bool = ..., bind: Optional[Any] = ..., - prefixes: Optional[Any] = ..., returning: Optional[Any] = ..., return_defaults: bool = ..., - **dialect_kw: Any) -> None: ... - def get_children(self, **kwargs: Any) -> Union[Tuple, Tuple[Selectable]]: ... - def from_select(self: _I, names: Iterable[Union[str, Column[Any]]], select: Union[str, Selectable], - include_defaults: bool = ...) -> _I: ... - -_U = TypeVar('_U', bound=Update) - -class Update(ValuesBase): - __visit_name__: str = ... - inline: bool = ... - def __init__(self, table: Union[str, Selectable], whereclause: Optional[Union[str, bool, Visitable]] = ..., - values: Optional[Any] = ..., inline: bool = ..., bind: Optional[Any] = ..., prefixes: Optional[Any] = ..., - returning: Optional[Any] = ..., return_defaults: bool = ..., preserve_parameter_order: bool = ..., - **dialect_kw: Any) -> None: ... - def get_children(self, **kwargs: Any) -> Union[Tuple, Tuple[Visitable]]: ... - def where(self: _U, whereclause: Union[str, bool, Visitable]) -> _U: ... - -_D = TypeVar('_D', bound=Delete) - -class Delete(UpdateBase): - __visit_name__: str = ... - table: Union[TextClause, Selectable] = ... - def __init__(self, table: Union[str, Selectable], whereclause: Optional[Union[str, bool, Visitable]] = ..., - bind: Optional[Any] = ..., returning: Optional[Any] = ..., prefixes: Optional[Any] = ..., - **dialect_kw: Any) -> None: ... - def get_children(self, **kwargs: Any) -> Union[Tuple, Tuple[Visitable]]: ... - def where(self: _D, whereclause: Union[str, bool, Visitable]) -> _D: ... diff --git a/sqlalchemy/sql/elements.pyi b/sqlalchemy/sql/elements.pyi deleted file mode 100644 index cb9a64f3..00000000 --- a/sqlalchemy/sql/elements.pyi +++ /dev/null @@ -1,514 +0,0 @@ -from typing import ( - Any, Optional, Union, Type, TypeVar, Generic, Callable, List, Dict, Set, Iterator, Iterable, Tuple as _TupleType, - Mapping, overload, Text -) -from typing_extensions import Protocol -from . import operators -from .. import util -from .visitors import Visitable as Visitable -from .annotation import Annotated as Annotated -from .base import Executable as Executable, Immutable as Immutable -from ..engine.base import Engine, Connection -from .type_api import TypeEngine -from .sqltypes import NullType, Boolean, Integer -from .selectable import TextAsFrom, TableClause -from .functions import FunctionElement -from .schema import ForeignKey - -_T = TypeVar('_T') -_T_contra = TypeVar('_T_contra', contravariant=True) -_V = TypeVar('_V') -_U = TypeVar('_U') - -def collate(expression, collation): ... -def between(expr, lower_bound, upper_bound, symmetric: bool = ...): ... -def literal(value, type_: Optional[Any] = ...): ... -def outparam(key, type_: Optional[Any] = ...): ... -def not_(clause): ... - -class ClauseElement(Visitable): - __visit_name__: str = ... - supports_execution: bool = ... - bind: Any = ... - is_selectable: bool = ... - is_clause_element: bool = ... - description: Any = ... - def unique_params(self, *optionaldict, **kwargs): ... - def params(self, *optionaldict, **kwargs): ... - def compare(self, other: Any, **kw: Any) -> bool: ... - def get_children(self, **kwargs: Any) -> Any: ... - def self_group(self, against: Optional[Any] = ...) -> Any: ... - def compile(self, bind: Optional[Any] = ..., dialect: Optional[Any] = ..., **kw) -> Any: ... - def __and__(self, other): ... - def __or__(self, other): ... - def __invert__(self): ... - def __bool__(self): ... - __nonzero__: Any = ... - -_CE = TypeVar('_CE', bound=ColumnElement) - -class ColumnElement(operators.ColumnOperators, ClauseElement, Generic[_T]): - __visit_name__: str = ... - primary_key: bool = ... - foreign_keys: List[ForeignKey] = ... - key: Optional[str] = ... - def self_group(self: _CE, against: Optional[Any] = ...) -> Union[AsBoolean, Grouping[_T], _CE]: ... - @property - def type(self) -> TypeEngine[_T]: ... - def comparator(self): ... - def operate(self, op, *other, **kwargs): ... - def reverse_operate(self, op, other, **kwargs): ... - @property - def expression(self: _CE) -> _CE: ... - def base_columns(self) -> Set[ColumnElement[Any]]: ... - def proxy_set(self) -> Set[ColumnElement[Any]]: ... - def shares_lineage(self, othercolumn: ColumnElement[Any]) -> bool: ... - def compare(self, other: ColumnElement[Any], use_proxies: bool = ..., equivalents: bool = ..., **kw: Any) -> bool: ... - @overload - def cast(self, type_: Type[TypeEngine[_U]]) -> Cast[_U]: ... - @overload - def cast(self, type_: TypeEngine[_U]) -> Cast[_U]: ... - def label(self, name: str) -> Label[_T]: ... - def anon_label(self) -> _anonymous_label: ... - -class BindParameter(ColumnElement[_T]): - __visit_name__: str = ... - key: str = ... - unique: bool = ... - value: Optional[_T] = ... - callable: Any = ... - isoutparam: Any = ... - required: bool = ... - type: TypeEngine[_T] = ... - @overload - def __init__(self, key: str, value: _T = ..., type_: Optional[Type[TypeEngine[_T]]] = ..., unique: bool = ..., - required: bool = ..., quote: Optional[Any] = ..., callable_: Optional[Callable[[], _T]] = ..., - expanding: bool = ..., isoutparam: bool = ..., _compared_to_operator: Optional[Any] = ..., - _compared_to_type: Optional[Any] = ...) -> None: ... - @overload - def __init__(self, key: str, value: _T = ..., type_: Optional[TypeEngine[_T]] = ..., unique: bool = ..., - required: bool = ..., quote: Optional[Any] = ..., callable_: Optional[Callable[[], _T]] = ..., - expanding: bool = ..., isoutparam: bool = ..., _compared_to_operator: Optional[Any] = ..., - _compared_to_type: Optional[Any] = ...) -> None: ... - @property - def effective_value(self) -> _T: ... - # Signature of "compare" incompatible with supertype "ColumnElement" - def compare(self, other: ColumnElement[Any], **kw: Any) -> bool: ... # type: ignore - -class TypeClause(ClauseElement, Generic[_T]): - __visit_name__: str = ... - type: TypeEngine[_T] = ... - def __init__(self, type: TypeEngine[_T]) -> None: ... - -_TC = TypeVar('_TC', bound=TextClause) - -class TextClause(Executable, ClauseElement): - __visit_name__: str = ... - @property - def selectable(self: _TC) -> _TC: ... - key: Any = ... - text: str = ... - def __init__(self, text: Text, bind: Optional[Union[Engine, Connection]] = ...) -> None: ... - def bindparams(self: _TC, *binds: BindParameter[Any], **names_to_values: Any) -> _TC: ... - def columns(self, *cols: ColumnClause[Any], **types: Union[TypeEngine[Any], Type[TypeEngine[Any]]]) -> TextAsFrom: ... - @property - def type(self) -> NullType: ... - @property - def comparator(self) -> Any: ... - def self_group(self: _TC, against: Optional[Any] = ...) -> Union[_TC, Grouping[None]]: ... - def get_children(self, **kwargs: Any) -> List[BindParameter[Any]]: ... - def compare(self, other: Any) -> bool: ... # type: ignore - @classmethod - def _create_text(cls: Type[_TC], text: Text, bind: Optional[Union[Engine, Connection]] = ..., - bindparams: Optional[Iterable[BindParameter[Any]]] = ..., - typemap: Optional[Dict[str, Union[TypeEngine[Any], Type[TypeEngine[Any]]]]] = ..., - autocommit: Optional[bool] = ...) -> _TC: ... - -class Null(ColumnElement[None]): - __visit_name__: str = ... - @property - def type(self) -> NullType: ... - def compare(self, other: Any) -> bool: ... # type: ignore - @classmethod - def _instance(cls) -> Null: ... - -class False_(ColumnElement[bool]): - __visit_name__: str = ... - @property - def type(self) -> Boolean: ... - def compare(self, other: Any) -> bool: ... # type: ignore - @classmethod - def _instance(cls) -> False_: ... - -class True_(ColumnElement[bool]): - __visit_name__: str = ... - @property - def type(self) -> Boolean: ... - def compare(self, other: Any) -> bool: ... # type: ignore - @classmethod - def _instance(cls) -> True_: ... - -_CL = TypeVar('_CL', bound=ClauseList) - -class _LiteralAsTextCallback(Protocol[_T_contra]): - def __call__(self, clause: _T_contra) -> List[ClauseElement]: ... - -class ClauseList(ClauseElement): - __visit_name__: str = ... - operator: Any = ... - group: bool = ... - group_contents: bool = ... - clauses: List[ClauseElement] = ... - @overload - def __init__(self, *clauses: _T, operator: Callable[..., Any] = ..., group: bool = ..., group_contents: bool = ..., - _literal_as_text: _LiteralAsTextCallback[_T] = ..., **kwargs: Any) -> None: ... - @overload - def __init__(self, *clauses: Optional[Union[str, bool, Visitable]], operator: Callable[..., Any] = ..., group: bool = ..., - group_contents: bool = ..., **kwargs: Any) -> None: ... - def __iter__(self) -> Iterator[ClauseElement]: ... - def __len__(self) -> int: ... - def append(self, clause: ClauseElement): ... - def get_children(self, **kwargs) -> List[ClauseElement]: ... - def self_group(self: _CL, against: Optional[Any] = ...) -> Union[_CL, Grouping[Any]]: ... - def compare(self, other: Any, **kw: Any) -> bool: ... - -_BCL = TypeVar('_BCL', bound=BooleanClauseList) - -# Definitions of "compare" and "self_group" in ClauseList are incompatible with ColumnElement -class BooleanClauseList(ClauseList, ColumnElement[bool]): # type: ignore - __visit_name__: str = ... - # Note: passing strings to below generates a warning, but still works. - @classmethod - def and_(cls, *clauses: Union[ClauseElement, str, bool]) -> BooleanClauseList: ... - @classmethod - def or_(cls, *clauses: Union[ClauseElement, str, bool]) -> BooleanClauseList: ... - def self_group(self: _BCL, against: Optional[Any] = ...) -> Union[_BCL, Grouping[bool]]: ... - -and_ = BooleanClauseList.and_ -or_ = BooleanClauseList.or_ - -# Definitions of "compare" and "self_group" in ClauseList are incompatible with ColumnElement -class Tuple(ClauseList, ColumnElement[_T]): # type: ignore - type: TypeEngine[_T] = ... - @overload - def __init__(self, *clauses: ColumnElement[Any], type_: Type[TypeEngine[_T]], **kw: Any) -> None: ... - @overload - def __init__(self, *clauses: ColumnElement[Any], type_: TypeEngine[_T], **kw: Any) -> None: ... - @overload - def __init__(self, clause: ColumnElement[_T], *clauses: ColumnElement[Any], **kw: Any) -> None: ... - -class Case(ColumnElement[_T]): - __visit_name__: str = ... - value: Any = ... - type: TypeEngine[_T] = ... - whens: Any = ... - else_: Any = ... - @overload - def __init__(self, whens: Iterable[_TupleType[ClauseElement, _T]], value: None = ..., - else_: Optional[_T] = ...) -> None: ... - @overload - def __init__(self, whens: Mapping[Any, _T], value: ColumnElement[Any] = ..., else_: Optional[_T] = ...) -> None: ... - def get_children(self, **kwargs: Any) -> Any: ... - -@overload -def literal_column(text: str, type_: Optional[Type[TypeEngine[_T]]] = ...) -> ColumnClause[TypeEngine[_T]]: ... -@overload -def literal_column(text: str, type_: Optional[TypeEngine[_T]] = ...) -> ColumnClause[TypeEngine[_T]]: ... - -class Cast(ColumnElement[_T]): - __visit_name__: str = ... - type: TypeEngine[_T] = ... - clause: ClauseElement = ... - typeclause: TypeClause[_T] = ... - @overload - def __init__(self, expression: Any, type_: Type[TypeEngine[_T]]) -> None: ... - @overload - def __init__(self, expression: Any, type_: TypeEngine[_T]) -> None: ... - def get_children(self, **kwargs: Any) -> _TupleType[ClauseElement, TypeClause[TypeEngine[_T]]]: ... - -class TypeCoerce(ColumnElement[_T]): - __visit_name__: str = ... - type: TypeEngine[_T] = ... - clause: ClauseElement = ... - @overload - def __init__(self, expression: str, type_: Type[TypeEngine[_T]]) -> None: ... - @overload - def __init__(self, expression: ColumnElement[Any], type_: Type[TypeEngine[_T]]) -> None: ... - @overload - def __init__(self, expression: str, type_: TypeEngine[_T]) -> None: ... - @overload - def __init__(self, expression: ColumnElement[Any], type_: TypeEngine[_T]) -> None: ... - def get_children(self, **kwargs: Any) -> _TupleType[ClauseElement]: ... - @property - def typed_expression(self) -> Any: ... - -class Extract(ColumnElement[int]): - __visit_name__: str = ... - type: Integer = ... - field: Any = ... - expr: ClauseElement = ... - def __init__(self, field: Any, expr: ClauseElement, **kwargs: Any) -> None: ... - def get_children(self, **kwargs) -> _TupleType[ClauseElement]: ... - -_UE = TypeVar('_UE', bound=UnaryExpression) - -class UnaryExpression(ColumnElement[_T]): - __visit_name__: str = ... - operator: Callable[..., Any] = ... - modifier: Any = ... - element: Any = ... - type: TypeEngine[_T] = ... - negate: Any = ... - wraps_column_expression: bool = ... - @overload - def __init__(self, element: Any, operator: Optional[Callable[..., Any]] = ..., modifier: Optional[Any] = ..., - type_: Optional[Type[TypeEngine[_T]]] = ..., negate: Optional[Any] = ..., - wraps_column_expression: bool = ...) -> None: ... - @overload - def __init__(self, element: Any, operator: Optional[Callable[..., Any]] = ..., modifier: Optional[Any] = ..., - type_: Optional[TypeEngine[_T]] = ..., negate: Optional[Any] = ..., - wraps_column_expression: bool = ...) -> None: ... - def get_children(self, **kwargs) -> _TupleType[Any]: ... - # Signature of "compare" incompatible with supertype "ColumnElement" - def compare(self, other: ColumnElement[Any], **kw: Any) -> bool: ... # type: ignore - def self_group(self: _UE, against: Optional[Any] = ...) -> Union[_UE, Grouping[_T]]: ... - @classmethod - def _create_nullsfirst(cls, column: ColumnElement[Any]) -> UnaryExpression[NullType]: ... - @classmethod - def _create_nullslast(cls, column: ColumnElement[Any]) -> UnaryExpression[NullType]: ... - @classmethod - def _create_desc(cls, column: Union[ColumnElement[Any], str]) -> UnaryExpression[NullType]: ... - @classmethod - def _create_asc(cls, column: Union[ColumnElement[Any], str]) -> UnaryExpression[NullType]: ... - @classmethod - def _create_distinct(cls, expr: ColumnElement[_U]) -> UnaryExpression[_U]: ... - -class CollectionAggregate(UnaryExpression[_T]): - def operate(self, op: Any, *other: Any, **kwargs: Any) -> Any: ... - def reverse_operate(self, op: Any, other: Any, **kwargs: Any) -> Any: ... - @overload - @classmethod - def _create_all(cls, expr: ColumnElement[_U]) -> CollectionAggregate[_U]: ... - @overload - @classmethod - def _create_all(cls, expr: ClauseElement) -> CollectionAggregate[Any]: ... - @overload - @classmethod - def _create_any(cls, expr: ColumnElement[_U]) -> CollectionAggregate[_U]: ... - @overload - @classmethod - def _create_any(cls, expr: ClauseElement) -> CollectionAggregate[Any]: ... - -_AB = TypeVar('_AB', bound=AsBoolean) - -class AsBoolean(UnaryExpression[bool]): - element: ColumnElement[Any] = ... - type: Boolean = ... - operator: Callable[..., Any] = ... - negate: Callable[..., Any] = ... - modifier: Any = ... - wraps_column_expression: bool = ... - def __init__(self, element: ColumnElement[Any], operator: Callable[..., Any], negate: Callable[..., Any]) -> None: ... - def self_group(self: _AB, against: Optional[Any] = ...) -> _AB: ... - -_BE = TypeVar('_BE', bound=BinaryExpression) - -class BinaryExpression(ColumnElement[_T], Generic[_T, _U, _V]): - __visit_name__: str = ... - left: Union[Grouping[_U], ColumnClause[_U]] = ... - right: Union[Grouping[_V], ColumnElement[_V]] = ... - operator: Callable[..., Any] = ... - type: TypeEngine[_T] = ... - negate: Any = ... - modifiers: Any = ... - @overload - def __init__(self, left: ColumnClause[_U], right: ColumnClause[_V], operator: Callable[..., Any], - type_: Optional[Type[TypeEngine[_T]]] = ..., negate: Optional[Any] = ..., - modifiers: Optional[Any] = ...) -> None: ... - @overload - def __init__(self, left: ColumnClause[_U], right: ColumnClause[_V], operator: Callable[..., Any], - type_: Optional[TypeEngine[_T]] = ..., negate: Optional[Any] = ..., modifiers: Optional[Any] = ...) -> None: ... - def __bool__(self) -> bool: ... - __nonzero__: Any = ... - @property - def is_comparison(self): ... - def get_children(self, **kwargs): ... - # Signature of "compare" incompatible with supertype "ColumnElement" - def compare(self, other: ColumnElement[Any], **kw: Any) -> bool: ... # type: ignore - def self_group(self: _BE, against: Optional[Any] = ...) -> Union[_BE, Grouping[_T]]: ... - -_SL = TypeVar('_SL', bound=Slice) - -class Slice(ColumnElement[None]): - __visit_name__: str = ... - start: Any = ... - stop: Any = ... - step: Any = ... - type: NullType = ... - def __init__(self, start, stop, step) -> None: ... - def self_group(self: _SL, against: Optional[Any] = ...) -> _SL: ... - -class IndexExpression(BinaryExpression): ... - -_G = TypeVar('_G', bound=Grouping) - -class Grouping(ColumnElement[_T]): - __visit_name__: str = ... - element: ClauseElement = ... - type: TypeEngine[_T] = ... - @overload - def __init__(self, element: ColumnElement[_T]) -> None: ... - # the following __init__ signature produces Grouping[None] at runtime but mypy will require an annotation - @overload - def __init__(self, element: ClauseElement) -> None: ... - def self_group(self: _G, against: Optional[Any] = ...) -> _G: ... - def get_children(self, **kwargs) -> _TupleType[ClauseElement]: ... - def __getattr__(self, attr): ... - # Signature of "compare" incompatible with supertype "ColumnElement" - def compare(self, other: ColumnElement[Any], **kw: Any) -> bool: ... # type: ignore - -RANGE_UNBOUNDED: util.symbol = ... -RANGE_CURRENT: util.symbol = ... - -class Over(ColumnElement[_T]): - __visit_name__: str = ... - order_by: Optional[ClauseList] = ... - partition_by: Optional[ClauseList] = ... - element: Union[WithinGroup[_T], FunctionElement[_T]] = ... - range_: Optional[_TupleType[Union[int, util.symbol], Union[int, util.symbol]]] = ... - rows: Optional[_TupleType[Union[int, util.symbol], Union[int, util.symbol]]] = ... - @overload - def __init__(self, element: WithinGroup[_T], - partition_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - order_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - range_: Optional[_TupleType[Optional[int], Optional[int]]] = ...) -> None: ... - @overload - def __init__(self, element: WithinGroup[_T], - partition_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - order_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - rows: Optional[_TupleType[Optional[int], Optional[int]]] = ...) -> None: ... - @overload - def __init__(self, element: FunctionElement[_T], - partition_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - order_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - range_: Optional[_TupleType[Optional[int], Optional[int]]] = ...) -> None: ... - @overload - def __init__(self, element: FunctionElement[_T], - partition_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - order_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - rows: Optional[_TupleType[Optional[int], Optional[int]]] = ...) -> None: ... - @property - def func(self) -> Union[WithinGroup[_T], FunctionElement[_T]]: ... - @property - def type(self) -> TypeEngine[_T]: ... - def get_children(self, **kwargs: Any) -> List[Union[WithinGroup[_T], FunctionElement[_T], ClauseList]]: ... - -class WithinGroup(ColumnElement[_T]): - __visit_name__: str = ... - order_by: Optional[ClauseList] = ... - element: FunctionElement[_T] = ... - def __init__(self, element: FunctionElement[_T], *order_by: Union[str, ColumnElement[Any]]) -> None: ... - def over(self, partition_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - order_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ...) -> Over[_T]: ... - @property - def type(self) -> TypeEngine[_T]: ... - def get_children(self, **kwargs: Any) -> List[Union[FunctionElement[_T], ClauseList]]: ... - -class FunctionFilter(ColumnElement[_T]): - __visit_name__: str = ... - criterion: Any = ... - func: FunctionElement[_T] = ... - def __init__(self, func: FunctionElement[_T], *criterion: Any) -> None: ... - def filter(self, *criterion: Any) -> FunctionFilter[_T]: ... - def over(self, partition_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - order_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ...) -> Over[_T]: ... - @property - def type(self) -> TypeEngine[_T]: ... - def get_children(self, **kwargs: Any) -> List[Any]: ... - -_L = TypeVar('_L', bound=Label) - -class Label(ColumnElement[_T]): - __visit_name__: str = ... - name: str = ... - key: str = ... - @overload - def __init__(self, name: str, element: ColumnElement[_T]) -> None: ... - @overload - def __init__(self, name: str, element: ColumnElement[Any], type_: Type[TypeEngine[_T]] = ...) -> None: ... - @overload - def __init__(self, name: str, element: ColumnElement[Any], type_: TypeEngine[_T] = ...) -> None: ... - def __reduce__(self) -> Any: ... - @property - def type(self) -> TypeEngine[_T]: ... - @property - def element(self) -> ColumnElement[_T]: ... - def self_group(self: _L, against: Optional[Any] = ...) -> Union[_L, Label[_T]]: ... - # Signature of "primary_key" incompatible with supertype "ColumnElement" - @property - def primary_key(self) -> bool: ... # type: ignore - # Signature of "foreign_keys" incompatible with supertype "ColumnElement" - @property - def foreign_keys(self) -> List[ForeignKey]: ... # type: ignore - def get_children(self, **kwargs: Any) -> Any: ... - -class ColumnClause(Immutable, ColumnElement[_T]): - __visit_name__: str = ... - onupdate: Any = ... - default: Any = ... - server_default: Any = ... - server_onupdate: Any = ... - key: str = ... - name: str = ... - table: Optional[TableClause] = ... - type: TypeEngine[_T] = ... - is_literal: bool = ... - @overload - def __init__(self, text: str, type_: Optional[Type[TypeEngine[_T]]] = ..., is_literal: bool = ..., - _selectable: Optional[TableClause] = ...) -> None: ... - @overload - def __init__(self, text: str, type_: Optional[TypeEngine[_T]] = ..., is_literal: bool = ..., - _selectable: Optional[TableClause] = ...) -> None: ... - @property - def description(self) -> str: ... - -class _IdentifiedClause(Executable, ClauseElement): - __visit_name__: str = ... - ident: Any = ... - def __init__(self, ident: Any) -> None: ... - -class SavepointClause(_IdentifiedClause): - __visit_name__: str = ... - -class RollbackToSavepointClause(_IdentifiedClause): - __visit_name__: str = ... - -class ReleaseSavepointClause(_IdentifiedClause): - __visit_name__: str = ... - -class quoted_name(util.MemoizedSlots, util.text_type): - quote: Any = ... - def __new__(cls, value, quote): ... - def __reduce__(self): ... - -class _truncated_label(quoted_name): - def __new__(cls, value, quote: Optional[Any] = ...): ... - def __reduce__(self): ... - def apply_map(self, map_): ... - -class conv(_truncated_label): ... - -class _anonymous_label(_truncated_label): ... - -class AnnotatedColumnElement(Annotated[ColumnElement[_T]], Generic[_T]): - def __init__(self, element: ColumnElement[_T], values: Any) -> None: ... - @property - def name(self) -> str: ... - @property - def table(self) -> TableClause: ... - @property - def key(self) -> str: ... - @property - def info(self) -> Any: ... - @property - def anon_label(self) -> str: ... diff --git a/sqlalchemy/sql/expression.pyi b/sqlalchemy/sql/expression.pyi deleted file mode 100644 index f3f414ee..00000000 --- a/sqlalchemy/sql/expression.pyi +++ /dev/null @@ -1,123 +0,0 @@ -from .functions import func as func, modifier as modifier, Function as Function, FunctionElement as FunctionElement -from .elements import ( - ClauseElement as ClauseElement, - ColumnElement as ColumnElement, - BindParameter as BindParameter, - CollectionAggregate as CollectionAggregate, - UnaryExpression as UnaryExpression, - BooleanClauseList as BooleanClauseList, - Label as Label, - Cast as Cast, - Case as Case, - ColumnClause as ColumnClause, - TextClause as TextClause, - Over as Over, - Null as Null, - BinaryExpression as BinaryExpression, - Tuple as Tuple, - TypeClause as TypeClause, - Extract as Extract, - WithinGroup as WithinGroup, - TypeCoerce as TypeCoerce, - ClauseList as ClauseList, - not_ as not_, - collate as collate, - literal_column as literal_column, - between as between, - literal as literal, - outparam as outparam, - FunctionFilter as FunctionFilter, - True_ as True_, - False_ as False_, - Grouping as Grouping, -) -from .base import ColumnCollection as ColumnCollection, Generative as Generative, Executable as Executable -from .selectable import ( - Alias as Alias, - Join as Join, - Select as Select, - Selectable as Selectable, - TableClause as TableClause, - CompoundSelect as CompoundSelect, - CTE as CTE, - FromClause as FromClause, - Lateral as Lateral, - alias as alias, - subquery as subquery, - lateral as lateral, - TableSample as TableSample, - tablesample as tablesample, - ScalarSelect as ScalarSelect, - FromGrouping as FromGrouping, - Exists as Exists, - SelectBase as SelectBase, - GenerativeSelect as GenerativeSelect, - HasCTE as HasCTE, - HasPrefixes as HasPrefixes, - HasSuffixes as HasSuffixes, - TextAsFrom as TextAsFrom, -) -from .dml import Insert as Insert, Update as Update, Delete as Delete - - -all_ = CollectionAggregate._create_all -any_ = CollectionAggregate._create_any -and_ = BooleanClauseList.and_ -or_ = BooleanClauseList.or_ -bindparam = BindParameter -select = Select -text = TextClause._create_text -table = TableClause -column = ColumnClause -over = Over -within_group = WithinGroup -label = Label -case = Case -cast = Cast -extract = Extract -tuple_ = Tuple -except_ = CompoundSelect._create_except -except_all = CompoundSelect._create_except_all -intersect = CompoundSelect._create_intersect -intersect_all = CompoundSelect._create_intersect_all -union = CompoundSelect._create_union -union_all = CompoundSelect._create_union_all -exists = Exists -nullsfirst = UnaryExpression._create_nullsfirst -nullslast = UnaryExpression._create_nullslast -asc = UnaryExpression._create_asc -desc = UnaryExpression._create_desc -distinct = UnaryExpression._create_distinct -type_coerce = TypeCoerce -true = True_._instance -false = False_._instance -null = Null._instance -join = Join._create_join -outerjoin = Join._create_outerjoin -insert = Insert -update = Update -delete = Delete -funcfilter = FunctionFilter - -# old names for compatibility -_Executable = Executable -_BindParamClause = BindParameter -_Label = Label -_SelectBase = SelectBase -_BinaryExpression = BinaryExpression -_Cast = Cast -_Null = Null -_False = False_ -_True = True_ -_TextClause = TextClause -_UnaryExpression = UnaryExpression -_Case = Case -_Tuple = Tuple -_Over = Over -_Generative = Generative -_TypeClause = TypeClause -_Extract = Extract -_Exists = Exists -_Grouping = Grouping -_FromGrouping = FromGrouping -_ScalarSelect = ScalarSelect diff --git a/sqlalchemy/sql/functions.pyi b/sqlalchemy/sql/functions.pyi deleted file mode 100644 index ce3c584b..00000000 --- a/sqlalchemy/sql/functions.pyi +++ /dev/null @@ -1,178 +0,0 @@ -from typing import Any, Optional, Union, Iterable, Tuple, TypeVar, Type, Generic, List, overload, Text -from .base import Executable as Executable, ColumnCollection -from .elements import ( - ColumnElement as ColumnElement, Grouping, ClauseList, ColumnElement, Over, WithinGroup, FunctionFilter, AsBoolean -) -from .selectable import FromClause as FromClause, Alias, Select -from . import util as sqlutil -from .visitors import VisitableType as VisitableType -from .type_api import TypeEngine -from .schema import Sequence -from . import sqltypes -from datetime import datetime, date, time -from ..engine.result import ResultProxy -from ..engine.base import Engine, Connection - -_T = TypeVar('_T') - -def register_function(identifier, fn, package: str = ...): ... - -_FE = TypeVar('_FE', bound=FunctionElement) - -class FunctionElement(Executable, ColumnElement[_T], FromClause, Generic[_T]): # type: ignore - # ColumnElement.foreign_keys() is not compatible with FromClause.foreign_keys() - packagenames: Any = ... - clause_expr: Grouping[Any] = ... - def __init__(self, *clauses: Any, **kwargs: Any) -> None: ... - # Return type of "columns" incompatible with supertype "FromClause" - @property - def columns(self) -> ColumnCollection: ... # type: ignore - @property - def clauses(self) -> ClauseList: ... - @overload - def over(self, partition_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - order_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - range_: Optional[Tuple[Optional[int], Optional[int]]] = ...) -> Over[_T]: ... - @overload - def over(self, partition_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - order_by: Optional[Union[str, ColumnElement[Any], Iterable[Union[str, ColumnElement[Any]]]]] = ..., - rows: Optional[Tuple[Optional[int], Optional[int]]] = ...) -> Over[_T]: ... - def within_group(self, *order_by: Union[str, - ColumnElement[Any], - Iterable[Union[str, ColumnElement[Any]]]]) -> WithinGroup[_T]: ... - @overload - def filter(self: _FE) -> _FE: ... - @overload - def filter(self, criteria: Any, *criterion: Any) -> FunctionFilter[_T]: ... - def get_children(self, **kwargs: Any) -> Tuple[Grouping[Any]]: ... - def within_group_type(self, within_group: Any) -> Any: ... - def alias(self, name: Optional[str] = ..., flat: bool = ...) -> Alias: ... - def select(self) -> Select: ... # type: ignore # incompatible with FromClause.select - def scalar(self) -> Any: ... # type: ignore # incompatible with Executable.scalar - def execute(self) -> ResultProxy: ... # type: ignore # incompatible with Executable.execute - def self_group(self: _FE, against: Optional[Any] = ...) -> Union[AsBoolean, Grouping[_T], _FE]: ... - -class _FunctionGenerator(object): - opts: Any = ... - def __init__(self, **opts: Any) -> None: ... - def __getattr__(self, name: str) -> Any: ... - def __call__(self, *c: Any, **kwargs: Any) -> Function[Any]: ... - -func: _FunctionGenerator = ... -modifier: _FunctionGenerator = ... - -class Function(FunctionElement[_T]): - __visit_name__: str = ... - packagenames: Any = ... - name: str = ... - type: TypeEngine[_T] = ... - def __init__(self, name: str, *clauses: Any, **kw: Any) -> None: ... - -class _GenericMeta(VisitableType): - def __init__(cls, clsname, bases, clsdict) -> None: ... - -class GenericFunction(Function[_T], metaclass=_GenericMeta): - coerce_arguments: bool = ... - packagenames: Any = ... - clause_expr: Grouping[Any] = ... - type: TypeEngine[_T] = ... - @overload - def __init__(self, *args: ColumnElement[Any], bind: Optional[Union[Engine, Connection]] = ..., - type_: Type[TypeEngine[_T]]) -> None: ... - @overload - def __init__(self, *args: ColumnElement[Any], bind: Optional[Union[Engine, Connection]] = ..., - type_: TypeEngine[_T]) -> None: ... - @overload - def __init__(self, *args: Union[_T, ColumnElement[_T]], bind: Optional[Union[Engine, Connection]] = ...) -> None: ... - @overload - def __init__(self, *, _parsed_args: List[ColumnElement[Any]], bind: Optional[Union[Engine, Connection]] = ..., - type_: Type[TypeEngine[_T]]) -> None: ... - @overload - def __init__(self, *, _parsed_args: List[ColumnElement[Any]], bind: Optional[Union[Engine, Connection]] = ..., - type_: TypeEngine[_T]) -> None: ... - @overload - def __init__(self, *, _parsed_args: List[ColumnElement[_T]], bind: Optional[Union[Engine, Connection]] = ...) -> None: ... - -class next_value(GenericFunction[_T]): - type: TypeEngine[_T] = ... - name: str = ... - sequence: Sequence[_T] = ... - def __init__(self, seq: Sequence[_T], **kw) -> None: ... - -class AnsiFunction(GenericFunction[_T]): - def __init__(self, **kwargs) -> None: ... - -class ReturnTypeFromArgs(GenericFunction[_T]): - def __init__(self, *args, **kwargs) -> None: ... - -class coalesce(ReturnTypeFromArgs[Any]): ... -class max(ReturnTypeFromArgs[Any]): ... -class min(ReturnTypeFromArgs[Any]): ... -class sum(ReturnTypeFromArgs[Any]): ... - -class now(GenericFunction[datetime]): ... - -class concat(GenericFunction[Optional[Text]]): ... - -class char_length(GenericFunction[int]): ... - -class random(GenericFunction[_T]): ... - -class count(GenericFunction[int]): - def __init__(self, expression: Optional[Any] = ..., **kwargs: Any) -> None: ... - -class current_date(AnsiFunction[date]): ... - -class current_time(AnsiFunction[time]): ... - -class current_timestamp(AnsiFunction[datetime]): ... - -class current_user(AnsiFunction[Text]): ... - -class localtime(AnsiFunction[datetime]): ... - -class localtimestamp(AnsiFunction[datetime]): ... - -class session_user(AnsiFunction[Text]): ... - -class sysdate(AnsiFunction[datetime]): ... - -class user(AnsiFunction[Text]): ... - -class array_agg(GenericFunction[List[_T]], Generic[_T]): - @overload - def __init__(self, *args: ColumnElement[Any], bind: Optional[Union[Engine, Connection]] = ..., - type_: Type[TypeEngine[_T]]) -> None: ... - @overload - def __init__(self, *args: ColumnElement[Any], bind: Optional[Union[Engine, Connection]] = ..., - type_: TypeEngine[_T]) -> None: ... - @overload - def __init__(self, *args: ColumnElement[_T], bind: Optional[Union[Engine, Connection]] = ...) -> None: ... - @overload - def __init__(self, *args: ColumnElement[Any], bind: Optional[Union[Engine, Connection]] = ..., - type_: Type[TypeEngine[_T]], _default_array_type: Type[TypeEngine[Any]]) -> None: ... - @overload - def __init__(self, *args: ColumnElement[Any], bind: Optional[Union[Engine, Connection]] = ..., - type_: TypeEngine[_T], _default_array_type: Type[TypeEngine[Any]]) -> None: ... - @overload - def __init__(self, *args: ColumnElement[_T], bind: Optional[Union[Engine, Connection]] = ..., - _default_array_type: Type[TypeEngine[Any]]) -> None: ... - -class OrderedSetAgg(GenericFunction[_T]): - array_for_multi_clause: bool = ... - def within_group_type(self, within_group: WithinGroup[_T]) -> Union[TypeEngine[_T], sqltypes.ARRAY[_T]]: ... - -class mode(OrderedSetAgg[_T]): - def within_group_type(self, within_group: WithinGroup[_T]) -> TypeEngine[_T]: ... - -class percentile_cont(OrderedSetAgg[Any]): ... - -class percentile_disc(OrderedSetAgg[Any]): ... - -class rank(GenericFunction[int]): ... - -class dense_rank(GenericFunction[int]): ... - -class percent_rank(GenericFunction[float]): ... - -class cume_dist(GenericFunction[float]): ... diff --git a/sqlalchemy/sql/naming.pyi b/sqlalchemy/sql/naming.pyi deleted file mode 100644 index 5b6cd27b..00000000 --- a/sqlalchemy/sql/naming.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Any - -from .elements import conv as conv - -class ConventionDict(object): - const: Any = ... - table: Any = ... - convention: Any = ... - def __init__(self, const, table, convention) -> None: ... - def __getitem__(self, key): ... diff --git a/sqlalchemy/sql/operators.pyi b/sqlalchemy/sql/operators.pyi deleted file mode 100644 index 89a08e10..00000000 --- a/sqlalchemy/sql/operators.pyi +++ /dev/null @@ -1,120 +0,0 @@ -from typing import Any, Iterable, Optional, Text, Union -from .selectable import Select, Alias -from .elements import BindParameter, UnaryExpression - -class Operators(object): - def __and__(self, other): ... - def __or__(self, other): ... - def __invert__(self): ... - def op(self, opstring, precedence: int = ..., is_comparison: bool = ...): ... - def operate(self, op, *other, **kwargs): ... - def reverse_operate(self, op, other, **kwargs): ... - -class custom_op(object): - __name__: str = ... - opstring: str = ... - precedence: Any = ... - is_comparison: Any = ... - natural_self_precedent: Any = ... - eager_grouping: Any = ... - def __init__(self, opstring, precedence: int = ..., is_comparison: bool = ..., - natural_self_precedent: bool = ..., eager_grouping: bool = ...) -> None: ... - def __eq__(self, other): ... - def __hash__(self): ... - def __call__(self, left, right, **kw): ... - -class ColumnOperators(Operators): - timetuple: Any = ... - def __lt__(self, other): ... - def __le__(self, other): ... - __hash__: Any = ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def is_distinct_from(self, other): ... - def isnot_distinct_from(self, other): ... - def __gt__(self, other): ... - def __ge__(self, other): ... - def __neg__(self): ... - def __contains__(self, other): ... - def __getitem__(self, index): ... - def __lshift__(self, other): ... - def __rshift__(self, other): ... - def concat(self, other): ... - def like(self, other: Text, escape: Optional[Any] = ...): ... - def ilike(self, other: Text, escape: Optional[Any] = ...): ... - def in_(self, other: Union[Iterable[Any], BindParameter, Select, Alias]): ... - def notin_(self, other: Union[Iterable[Any], BindParameter, Select, Alias]): ... - def notlike(self, other, escape: Optional[Any] = ...): ... - def notilike(self, other, escape: Optional[Any] = ...): ... - def is_(self, other): ... - def isnot(self, other): ... - def startswith(self, other: str, **kwargs): ... - def endswith(self, other, **kwargs): ... - def contains(self, other, **kwargs): ... - def match(self, other, **kwargs): ... - def desc(self) -> UnaryExpression: ... - def asc(self) -> UnaryExpression: ... - def nullsfirst(self): ... - def nullslast(self): ... - def collate(self, collation): ... - def __radd__(self, other): ... - def __rsub__(self, other): ... - def __rmul__(self, other): ... - def __rdiv__(self, other): ... - def __rmod__(self, other): ... - def between(self, cleft, cright, symmetric: bool = ...): ... - def distinct(self): ... - def any_(self): ... - def all_(self): ... - def __add__(self, other): ... - def __sub__(self, other): ... - def __mul__(self, other): ... - def __div__(self, other): ... - def __mod__(self, other): ... - def __truediv__(self, other): ... - def __rtruediv__(self, other): ... - -def from_(): ... -def as_(): ... -def exists(): ... -def istrue(a): ... -def isfalse(a): ... -def is_distinct_from(a, b): ... -def isnot_distinct_from(a, b): ... -def is_(a, b): ... -def isnot(a, b): ... -def collate(a, b): ... -def op(a, opstring, b): ... -def like_op(a, b, escape: Optional[Any] = ...): ... -def notlike_op(a, b, escape: Optional[Any] = ...): ... -def ilike_op(a, b, escape: Optional[Any] = ...): ... -def notilike_op(a, b, escape: Optional[Any] = ...): ... -def between_op(a, b, c, symmetric: bool = ...): ... -def notbetween_op(a, b, c, symmetric: bool = ...): ... -def in_op(a, b): ... -def notin_op(a, b): ... -def distinct_op(a): ... -def any_op(a): ... -def all_op(a): ... -def startswith_op(a, b, escape: Optional[Any] = ...): ... -def notstartswith_op(a, b, escape: Optional[Any] = ...): ... -def endswith_op(a, b, escape: Optional[Any] = ...): ... -def notendswith_op(a, b, escape: Optional[Any] = ...): ... -def contains_op(a, b, escape: Optional[Any] = ...): ... -def notcontains_op(a, b, escape: Optional[Any] = ...): ... -def match_op(a, b, **kw): ... -def notmatch_op(a, b, **kw): ... -def comma_op(a, b): ... -def concat_op(a, b): ... -def desc_op(a): ... -def asc_op(a): ... -def nullsfirst_op(a): ... -def nullslast_op(a): ... -def json_getitem_op(a, b): ... -def json_path_getitem_op(a, b): ... -def is_comparison(op): ... -def is_commutative(op): ... -def is_ordering_modifier(op): ... -def is_natural_self_precedent(op): ... -def mirror(op): ... -def is_precedent(operator, against): ... diff --git a/sqlalchemy/sql/schema.pyi b/sqlalchemy/sql/schema.pyi deleted file mode 100644 index 4d24906d..00000000 --- a/sqlalchemy/sql/schema.pyi +++ /dev/null @@ -1,356 +0,0 @@ -from typing import ( - Any, Optional, Union, Generic, TypeVar, Type, List, Tuple, Set, Sequence as SequenceType, Mapping, - Callable, Iterable, Iterator, overload -) -from . import visitors, functions -from .base import SchemaEventTarget as SchemaEventTarget, DialectKWArgs as DialectKWArgs, ColumnCollection -from .elements import ColumnClause as ColumnClause, TextClause, ColumnElement -from .selectable import TableClause as TableClause -from .type_api import TypeEngine -from .. import util -from ..engine import Engine, Connection, Connectable -from ..engine.url import URL -from .compiler import DDLCompiler -from .expression import FunctionElement -import threading - -_T = TypeVar('_T') - -RETAIN_SCHEMA: util.symbol = ... -BLANK_SCHEMA: util.symbol = ... - -class SchemaItem(SchemaEventTarget, visitors.Visitable): - __visit_name__: str = ... - def get_children(self, **kwargs: Any) -> Iterable[Any]: ... - @property - def quote(self) -> str: ... - @property - def info(self) -> Optional[Mapping[str, Any]]: ... - -# Definition of "get_children" in base class "SchemaItem" is incompatible with definition in base class "TableClause" -class Table(DialectKWArgs, SchemaItem, TableClause): # type: ignore - __visit_name__: str - metadata: MetaData - schema: Optional[str] - indexes: Set[Index] - constraints: Set[Constraint] - foreign_keys: Set[ForeignKey] - primary_key: PrimaryKeyConstraint # type: ignore # TableClause.primary_key defines this as "ColumnSet" - fullname: str - implicit_returning: bool - comment: Any - def __new__(cls, *args, **kw): ... - @property - def quote_schema(self) -> Optional[bool]: ... - def __init__(self, name: str, metadata: MetaData, *args: Any, autoload: bool = ..., autoload_replace: bool = ..., - autoload_with: Union[Engine, Connection] = ..., extend_existing: bool = ..., implicit_returning: bool = ..., - include_columns: SequenceType[str] = ..., info: Mapping[str, Any] = ..., keep_existing: bool = ..., - listeners: SequenceType[Tuple[str, Callable[..., Any]]] = ..., mustexist: bool = ..., - prefixes: SequenceType[str] = ..., quote: Optional[bool] = ..., quote_schema: Optional[bool] = ..., - schema: Optional[str] = ..., comment: str = ..., **kw: Any) -> None: ... - @property - def foreign_key_constraints(self) -> Set[ForeignKeyConstraint]: ... - @property - def key(self) -> str: ... - @property - def bind(self) -> Optional[Union[Engine, Connection]]: ... - def add_is_dependent_on(self, table: Table) -> None: ... - def append_column(self, column: ColumnClause[Any]) -> None: ... - def append_constraint(self, constraint: Constraint) -> None: ... - def append_ddl_listener(self, event_name: str, listener: Callable[..., Any]) -> None: ... - def get_children(self, column_collections: bool = ..., schema_visitor: bool = ..., **kw: Any) -> List[Any]: ... - def exists(self, bind: Optional[Union[Engine, Connection]] = ...) -> bool: ... - def create(self, bind: Optional[Connectable] = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Optional[Connectable] = ..., checkfirst: bool = ...) -> None: ... - def tometadata(self, metadata: MetaData, schema: str = ..., - referred_schema_fn: Optional[Callable[[Table, str, ForeignKeyConstraint, str], str]] = ..., - name: Optional[str] = ...) -> Table: ... - -_C = TypeVar('_C', bound=Column) - -class Column(SchemaItem, ColumnClause[_T]): - __visit_name__: str = ... - key: str = ... - primary_key: bool = ... - nullable: bool = ... - default: Optional[Any] = ... - server_default: Optional[Any] = ... - server_onupdate: Optional[FetchedValue] = ... - index: Optional[bool] = ... - unique: Optional[bool] = ... - system: bool = ... - doc: Optional[str] = ... - onupdate: Optional[Any] = ... - autoincrement: Union[bool, str] = ... - constraints: Set[Constraint] = ... - foreign_keys: Set[ForeignKey] = ... # type: ignore # incompatible with ColumnElement.foreign_keys - info: Optional[Mapping[str, Any]] = ... - comment: Optional[str] = ... - table: Table = ... # TODO: double-check this. - @overload - def __init__(self, name: str, type_: Type[TypeEngine[_T]], *args: Any, autoincrement: Union[bool, str] = ..., - default: Any = ..., doc: str = ..., key: str = ..., index: bool = ..., info: Mapping[str, Any] = ..., - nullable: bool = ..., onupdate: Any = ..., primary_key: bool = ..., server_default: Any = ..., - server_onupdate: Union[FetchedValue, FunctionElement] = ..., quote: Optional[bool] = ..., unique: bool = ..., - system: bool = ..., comment: str = ...) -> None: ... - @overload - def __init__(self, name: str, type_: TypeEngine[_T], *args: Any, autoincrement: Union[bool, str] = ..., - default: Any = ..., doc: str = ..., key: str = ..., index: bool = ..., info: Mapping[str, Any] = ..., - nullable: bool = ..., onupdate: Any = ..., primary_key: bool = ..., server_default: Any = ..., - server_onupdate: Union[FetchedValue, FunctionElement] = ..., quote: Optional[bool] = ..., unique: bool = ..., - system: bool = ..., comment: str = ...) -> None: ... - @overload - def __init__(self, name: str, type_: ForeignKey, *args: Any, autoincrement: Union[bool, str] = ..., - default: Any = ..., doc: str = ..., key: str = ..., index: bool = ..., info: Mapping[str, Any] = ..., - nullable: bool = ..., onupdate: Any = ..., primary_key: bool = ..., server_default: Any = ..., - server_onupdate: Union[FetchedValue, FunctionElement] = ..., quote: Optional[bool] = ..., unique: bool = ..., - system: bool = ..., comment: str = ...) -> None: ... - # Now without a name argument. - @overload - def __init__(self, type_: Type[TypeEngine[_T]], *args: Any, autoincrement: Union[bool, str] = ..., - default: Any = ..., doc: str = ..., key: str = ..., index: bool = ..., info: Mapping[str, Any] = ..., - nullable: bool = ..., onupdate: Any = ..., primary_key: bool = ..., server_default: Any = ..., - server_onupdate: Union[FetchedValue, FunctionElement] = ..., quote: Optional[bool] = ..., unique: bool = ..., - system: bool = ..., comment: str = ...) -> None: ... - @overload - def __init__(self, type_: TypeEngine[_T], *args: Any, autoincrement: Union[bool, str] = ..., - default: Any = ..., doc: str = ..., key: str = ..., index: bool = ..., info: Mapping[str, Any] = ..., - nullable: bool = ..., onupdate: Any = ..., primary_key: bool = ..., server_default: Any = ..., - server_onupdate: Union[FetchedValue, FunctionElement] = ..., quote: Optional[bool] = ..., unique: bool = ..., - system: bool = ..., comment: str = ...) -> None: ... - @overload - def __init__(self, type_: ForeignKey, *args: Any, autoincrement: Union[bool, str] = ..., - default: Any = ..., doc: str = ..., key: str = ..., index: bool = ..., info: Mapping[str, Any] = ..., - nullable: bool = ..., onupdate: Any = ..., primary_key: bool = ..., server_default: Any = ..., - server_onupdate: Union[FetchedValue, FunctionElement] = ..., quote: Optional[bool] = ..., unique: bool = ..., - system: bool = ..., comment: str = ...) -> None: ... - def references(self, column: Column[Any]) -> bool: ... - def append_foreign_key(self, fk: ForeignKey) -> None: ... - def copy(self: _C, **kw: Any) -> _C: ... - def get_children(self, schema_visitor: bool = ..., **kwargs) -> List[Any]: ... - @overload - def __get__(self, instance: None, owner: Any) -> Column[_T]: ... - @overload - def __get__(self, instance: object, owner: Any) -> _T: ... - -class ForeignKey(DialectKWArgs, SchemaItem): - __visit_name__: str = ... - constraint: Optional[ForeignKeyConstraint] = ... - parent: Column[Any] = ... - use_alter: bool = ... - name: Optional[str] = ... - onupdate: Optional[str] = ... - ondelete: Optional[str] = ... - deferrable: Optional[bool] = ... - initially: Optional[str] = ... - link_to_name: bool = ... - match: Optional[str] = ... - info: Optional[Mapping[str, Any]] = ... - def __init__(self, column: Union[Column[Any], str], _constraint: Optional[Any] = ..., use_alter: bool = ..., - name: Optional[str] = ..., onupdate: Optional[str] = ..., ondelete: Optional[str] = ..., - deferrable: Optional[bool] = ..., initially: Optional[str] = ..., link_to_name: bool = ..., - match: Optional[str] = ..., info: Optional[Mapping[str, Any]] = ..., **dialect_kw: Any) -> None: ... - def copy(self, schema: Optional[str] = ...) -> ForeignKey: ... - target_fullname: str = ... - def references(self, table: Table) -> bool: ... - def get_referent(self, table: Table) -> Column[Any]: ... - @property - def column(self) -> Column[Any]: ... - -class _NotAColumnExpr(object): - __clause_element__: Any = ... - self_group: Any = ... - -class DefaultGenerator(_NotAColumnExpr, SchemaItem): - __visit_name__: str = ... - is_sequence: bool = ... - is_server_default: bool = ... - column: Column[Any] = ... - for_update: bool = ... - def __init__(self, for_update: bool = ...) -> None: ... - def execute(self, bind: Optional[Union[Engine, Connection]] = ..., **kwargs: Any) -> Any: ... - @property - def bind(self) -> Optional[Union[Engine, Connection]]: ... - -class ColumnDefault(DefaultGenerator): - arg: Any = ... - def __init__(self, arg: Any, **kwargs: Any) -> None: ... - @property - def is_callable(self) -> bool: ... - @property - def is_clause_element(self) -> bool: ... - @property - def is_scalar(self) -> bool: ... - __visit_name__: Any = ... - -class Sequence(DefaultGenerator, Generic[_T]): - __visit_name__: str = ... - is_sequence: bool = ... - name: str = ... - start: Optional[int] = ... - increment: Optional[int] = ... - minvalue: Optional[int] = ... - maxvalue: Optional[int] = ... - nominvalue: Optional[int] = ... - nomaxvalue: Optional[int] = ... - cycle: Optional[bool] = ... - optional: bool = ... - schema: Optional[str] = ... - metadata: Optional[MetaData] = ... - def __init__(self, name: str, start: Optional[int] = ..., increment: Optional[int] = ..., - minvalue: Optional[int] = ..., maxvalue: Optional[int] = ..., nominvalue: Optional[int] = ..., - nomaxvalue: Optional[int] = ..., cycle: Optional[bool] = ..., schema: Optional[str] = ..., - optional: bool = ..., quote: Optional[bool] = ..., metadata: Optional[MetaData] = ..., - quote_schema: Optional[bool] = ..., for_update: bool = ...) -> None: ... - @property - def is_callable(self) -> bool: ... - @property - def is_clause_element(self) -> bool: ... - def next_value(self) -> functions.next_value[_T]: ... - @property - def bind(self) -> Optional[Union[Engine, Connection]]: ... - def create(self, bind: Optional[Union[Engine, Connection]] = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Optional[Union[Engine, Connection]] = ..., checkfirst: bool = ...) -> None: ... - -class FetchedValue(_NotAColumnExpr, SchemaEventTarget): - is_server_default: bool = ... - reflected: bool = ... - has_argument: bool = ... - for_update: bool = ... - def __init__(self, for_update: bool = ...) -> None: ... - -class DefaultClause(FetchedValue): - has_argument: bool = ... - arg: Any = ... - reflected: bool = ... - def __init__(self, arg: Any, for_update: bool = ..., _reflected: bool = ...) -> None: ... - -class PassiveDefault(DefaultClause): - def __init__(self, *arg: Any, **kw: Any) -> None: ... - -class Constraint(DialectKWArgs, SchemaItem): - __visit_name__: str = ... - name: Optional[str] = ... - deferrable: Optional[bool] = ... - initially: Optional[str] = ... - info: Optional[Mapping[str, Any]] = ... - def __init__(self, name: Optional[str] = ..., deferrable: Optional[bool] = ..., - initially: Optional[str] = ..., _create_rule: Optional[Callable[[DDLCompiler], bool]] = ..., - info: Optional[Mapping[str, Any]] = ..., _type_bound: bool = ..., **dialect_kw: Any) -> None: ... - @property - def table(self) -> Table: ... - def copy(self, **kw: Any) -> Any: ... - -class ColumnCollectionMixin(object): - columns: ColumnCollection = ... - def __init__(self, *columns: Union[Column[Any], str], **kw: Any) -> None: ... - -_CCC = TypeVar('_CCC', bound=ColumnCollectionConstraint) - -class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint): - def __init__(self, *columns: Union[Column[Any], str], name: Optional[str] = ..., deferrable: Optional[bool] = ..., - initially: Optional[str] = ..., _create_rule: Optional[Callable[[DDLCompiler], bool]] = ..., - info: Optional[Mapping[str, Any]] = ..., _type_bound: bool = ..., **dialect_kw: Any) -> None: ... - def __contains__(self, x: Any) -> bool: ... - def copy(self: _CCC, **kw: Any) -> _CCC: ... - def contains_column(self, col: Column[Any]) -> bool: ... - def __iter__(self) -> Iterator[Column[Any]]: ... - def __len__(self) -> int: ... - -class CheckConstraint(ColumnCollectionConstraint): - sqltext: str = ... - def __init__(self, sqltext: str, name: Optional[str] = ..., deferrable: Optional[bool] = ..., - initially: Optional[str] = ..., table: Optional[Table] = ..., info: Optional[Mapping[str, Any]] = ..., - _create_rule: Optional[Callable[[DDLCompiler], bool]] = ..., _autoattach: bool = ..., - _type_bound: bool = ...) -> None: ... - __visit_name__: Any = ... - def copy(self, target_table: Optional[Table] = ..., **kw: Any) -> CheckConstraint: ... - -class ForeignKeyConstraint(ColumnCollectionConstraint): - __visit_name__: str = ... - onupdate: Optional[str] = ... - ondelete: Optional[str] = ... - link_to_name: bool = ... - use_alter: bool = ... - match: Optional[str] = ... - elements: List[ForeignKey] = ... - def __init__(self, columns: SequenceType[str], refcolumns: SequenceType[Union[str, Column[Any]]], name: Optional[str] = ..., - onupdate: Optional[str] = ..., ondelete: Optional[str] = ..., deferrable: Optional[bool] = ..., - initially: Optional[str] = ..., use_alter: bool = ..., link_to_name: bool = ..., match: Optional[str] = ..., - table: Optional[Table] = ..., info: Optional[Mapping[str, Any]] = ..., **dialect_kw: Any) -> None: ... - @property - def referred_table(self) -> Table: ... - @property - def column_keys(self) -> List[str]: ... - def copy(self, schema: Optional[str] = ..., target_table: Optional[Table] = ..., **kw: Any) -> ForeignKeyConstraint: ... - -class PrimaryKeyConstraint(ColumnCollectionConstraint): - __visit_name__: str = ... - def __init__(self, *columns: Union[Column[Any], str], name: Optional[str] = ..., deferrable: Optional[bool] = ..., - initially: Optional[str] = ..., _create_rule: Optional[Callable[[DDLCompiler], bool]] = ..., - info: Optional[Mapping[str, Any]] = ..., _type_bound: bool = ..., **dialect_kw: Any) -> None: ... - @property - def columns_autoinc_first(self) -> List[Column[Any]]: ... - -class UniqueConstraint(ColumnCollectionConstraint): - __visit_name__: str = ... - -_I = TypeVar('_I', bound=Index) - -class Index(DialectKWArgs, ColumnCollectionMixin, SchemaItem): - __visit_name__: str = ... - table: Optional[Table] = ... - expressions: List[Union[Column[Any], str]] = ... - name: str = ... - unique: bool = ... - info: Optional[Mapping[str, Any]] = ... - def __init__(self, name: Optional[str], *expressions: Union[TextClause, ColumnElement[Any], str], unique: bool = ..., - quote: Optional[bool] = ..., info: Optional[Mapping[str, Any]] = ..., **kw: Any) -> None: ... - @property - def bind(self) -> Optional[Union[Engine, Connection]]: ... - def create(self: _I, bind: Optional[Union[Engine, Connection]] = ...) -> _I: ... - def drop(self, bind: Optional[Union[Engine, Connection]] = ...) -> None: ... - -DEFAULT_NAMING_CONVENTION: util.immutabledict[str, str] = ... - -class _MetaDataBind: - @overload - def __get__(self, instance: None, owner: Any) -> None: ... - @overload - def __get__(self, instance: MetaData, owner: Any) -> Optional[Union[Engine, Connection]]: ... - def __set__(self, instance: Any, value: Optional[Union[Engine, Connection, str, URL]]) -> None: ... - -class MetaData(SchemaItem): - __visit_name__: str = ... - tables: util.immutabledict[str, Table] = ... - schema: Optional[str] = ... - # `naming_convention` should be Mapping[Union[str, Index, Constraint], str] but because Mapping is invariant in the key type, - # we must use Mapping[Any, Any] or list all subclasses of Index and Constraint in the Union - naming_convention: Mapping[Any, Any] = ... - info: Optional[Mapping[str, Any]] = ... - bind: _MetaDataBind = ... - def __init__(self, bind: Optional[Union[Engine, Connection]] = ..., reflect: bool = ..., schema: Optional[str] = ..., - quote_schema: Optional[bool] = ..., naming_convention: Mapping[Any, Any] = ..., - info: Optional[Mapping[str, Any]] = ...) -> None: ... - def __contains__(self, table_or_key: Union[str, Table]) -> bool: ... - def is_bound(self) -> bool: ... - def clear(self) -> None: ... - def remove(self, table: Table) -> None: ... - @property - def sorted_tables(self) -> List[Table]: ... - def reflect(self, bind: Optional[Connectable] = ..., schema: Optional[str] = ..., views: bool = ..., - only: Optional[Union[SequenceType[str], Callable[[str, MetaData], bool]]] = ..., extend_existing: bool = ..., - autoload_replace: bool = ..., **dialect_kwargs: Any) -> None: ... - def append_ddl_listener(self, event_name: str, listener: Callable[[str, MetaData, Connection], None]) -> None: ... - def create_all(self, bind: Optional[Connectable] = ..., tables: Optional[SequenceType[Table]] = ..., - checkfirst: bool = ...) -> None: ... - def drop_all(self, bind: Optional[Connectable] = ..., tables: Optional[SequenceType[Table]] = ..., - checkfirst: bool = ...) -> None: ... - -class ThreadLocalMetaData(MetaData): - __visit_name__: str = ... - context: threading.local = ... - bind: _MetaDataBind = ... - def __init__(self) -> None: ... - def is_bound(self) -> bool: ... - def dispose(self) -> None: ... diff --git a/sqlalchemy/sql/selectable.pyi b/sqlalchemy/sql/selectable.pyi deleted file mode 100644 index 74a50004..00000000 --- a/sqlalchemy/sql/selectable.pyi +++ /dev/null @@ -1,327 +0,0 @@ -from typing import Any, Optional, Union, TypeVar, List, Iterable, Sequence, Mapping, Set, Tuple, Type -from .elements import ( - ClauseElement as ClauseElement, Grouping as Grouping, UnaryExpression as UnaryExpression, ColumnElement, ColumnClause, - TextClause, Label, BindParameter -) -from .base import Immutable as Immutable, Executable as Executable, Generative as Generative, ImmutableColumnCollection, ColumnSet -from .annotation import Annotated as Annotated -from ..engine import Engine, Connection -from .schema import ForeignKey, Table -from .functions import Function -from .dml import Insert, Update, Delete -from .type_api import TypeEngine -from .visitors import Visitable -from .. import util - -_T = TypeVar('_T') - -def subquery(alias: str, *args: Any, **kwargs: Any) -> Alias: ... -def alias(selectable: FromClause, name: Optional[Any] = ..., flat: bool = ...) -> Alias: ... -def lateral(selectable: FromClause, name: Optional[Any] = ...) -> Lateral: ... -def tablesample(selectable: FromClause, sampling: float, name: Optional[str] = ..., seed: Optional[Any] = ...) -> TableSample: ... - -_S = TypeVar('_S', bound=Selectable) - -class Selectable(ClauseElement): - __visit_name__: str = ... - is_selectable: bool = ... - @property - def selectable(self: _S) -> _S: ... - -_HP = TypeVar('_HP', bound=HasPrefixes) - -class HasPrefixes(object): - def prefix_with(self: _HP, *expr: Union[str, ClauseElement], **kw: Any) -> _HP: ... - -_HS = TypeVar('_HS', bound=HasSuffixes) - -class HasSuffixes(object): - def suffix_with(self: _HS, *expr: Union[str, ClauseElement], **kw: Any) -> _HS: ... - -class FromClause(Selectable): - __visit_name__: str = ... - named_with_column: bool = ... - schema: Optional[str] = ... - def count(self, whereclause: Optional[Union[str, bool, Visitable]] = ..., **params: Any) -> Select: ... - def select(self, whereclause: Optional[Union[str, bool, Visitable]] = ..., **params: Any) -> Select: ... - def join(self, right: FromClause, onclause: Optional[ClauseElement] = ..., isouter: bool = ..., full: bool = ...) -> Join: ... - def outerjoin(self, right: FromClause, onclause: Optional[ClauseElement] = ..., full: bool = ...) -> Join: ... - def alias(self, name: Optional[str] = ..., flat: bool = ...) -> Alias: ... - def lateral(self, name: Optional[str] = ...) -> Lateral: ... - def tablesample(self, sampling: Union[float, Function[float]], name: Optional[str] = ..., - seed: Optional[Any] = ...) -> TableSample: ... - def is_derived_from(self, fromclause: FromClause) -> bool: ... - def replace_selectable(self, old: FromClause, alias: Alias) -> FromClause: ... - def correspond_on_equivalents(self, column: ColumnElement[Any], - equivalents: Mapping[Any, Any]) -> Optional[ColumnElement[Any]]: ... - def corresponding_column(self, column: ColumnElement[Any], require_embedded: bool = ...) -> ColumnElement[Any]: ... - @property - def description(self) -> str: ... - @property - def columns(self) -> ImmutableColumnCollection: ... - @property - def primary_key(self) -> ColumnSet: ... - @property - def foreign_keys(self) -> Set[ForeignKey]: ... - c: ImmutableColumnCollection = ... - -_J = TypeVar('_J', bound=Join) - -class Join(FromClause): - __visit_name__: str = ... - left: FromClause = ... - right: FromClause = ... - onclause: ClauseElement = ... - isouter: bool = ... - full: bool = ... - def __init__(self, left: FromClause, right: FromClause, onclause: Optional[ClauseElement] = ..., - isouter: bool = ..., full: bool = ...) -> None: ... - @property - def description(self) -> str: ... - def is_derived_from(self, fromclause: FromClause) -> bool: ... - def self_group(self, against: Optional[Any] = ...) -> FromGrouping: ... - def get_children(self, **kwargs: Any) -> Tuple[FromClause, FromClause, ClauseElement]: ... - def select(self, whereclause: Optional[Union[str, bool, Visitable]] = ..., **kwargs: Any) -> Select: ... - @property - def bind(self) -> Optional[Union[Engine, Connection]]: ... - # Return type of "alias" incompatible with supertype "FromClause" - def alias(self, name: Optional[str] = ..., flat: bool = ...) -> Union[Alias, Join]: ... # type: ignore - @classmethod - def _create_outerjoin(cls: Type[_J], left: FromClause, right: FromClause, onclause: Optional[ClauseElement] = ..., - full: bool = ...) -> _J: ... - @classmethod - def _create_join(cls: Type[_J], left: FromClause, right: FromClause, onclause: Optional[ClauseElement] = ..., - isouter: bool = ..., full: bool = ...) -> _J: ... - -_A = TypeVar('_A', bound=Alias) - -class Alias(FromClause): - __visit_name__: str = ... - named_with_column: bool = ... - original: Selectable = ... - supports_execution: bool = ... - element: Selectable = ... - name: Optional[str] = ... - def __init__(self, selectable: Selectable, name: Optional[str] = ...) -> None: ... - def self_group(self: _A, against: Optional[Any] = ...) -> Union[FromGrouping, _A]: ... - @property - def description(self) -> str: ... - def as_scalar(self) -> Any: ... - def is_derived_from(self, fromclause: FromClause) -> bool: ... - def get_children(self, column_collections: bool = ..., **kw: Any) -> Iterable[Union[ColumnElement[Any], Selectable]]: ... - @property - def bind(self) -> Optional[Union[Engine, Connection]]: ... - -class Lateral(Alias): - __visit_name__: str = ... - -class TableSample(Alias): - __visit_name__: str = ... - sampling: Any = ... - seed: Any = ... - def __init__(self, selectable: FromClause, sampling: Union[float, Function[float]], name: Optional[str] = ..., - seed: Optional[Any] = ...) -> None: ... - -class CTE(Generative, HasPrefixes, HasSuffixes, Alias): - __visit_name__: str = ... - recursive: bool = ... - def __init__(self, selectable: Select, name: Optional[str] = ..., recursive: bool = ..., - _cte_alias: Optional[Any] = ..., _restates: Any = ..., _prefixes: Optional[Any] = ..., - _suffixes: Optional[Any] = ...) -> None: ... - def alias(self, name: Optional[str] = ..., flat: bool = ...) -> CTE: ... - def union(self, other: Select) -> CTE: ... - def union_all(self, other: Select) -> CTE: ... - -class HasCTE(object): - def cte(self, name: Optional[str] = ..., recursive: bool = ...) -> CTE: ... - -class FromGrouping(FromClause): - __visit_name__: str = ... - element: FromClause = ... - def __init__(self, element: FromClause) -> None: ... - @property - def columns(self) -> ImmutableColumnCollection: ... - @property - def primary_key(self) -> ColumnSet: ... - @property - def foreign_keys(self) -> Set[ForeignKey]: ... - def is_derived_from(self, element: FromClause) -> bool: ... - # Return type of "alias" incompatible with supertype "FromClause" - def alias(self, name: Optional[str] = ..., flat: bool = ...) -> FromGrouping: ... # type: ignore - def get_children(self, **kwargs: Any) -> Tuple[FromClause]: ... - def __getattr__(self, attr: str) -> Any: ... - -class TableClause(Immutable, FromClause): - __visit_name__: str = ... - named_with_column: bool = ... - implicit_returning: bool = ... - name: str = ... - primary_key: ColumnSet = ... - foreign_keys: Set[ForeignKey] = ... - def __init__(self, name: str, *columns: ColumnClause[Any]) -> None: ... - @property - def description(self) -> str: ... - def append_column(self, c: ColumnClause[Any]): ... - def get_children(self, column_collections: bool = ..., **kwargs: Any) -> List[ColumnClause[Any]]: ... - # `values` should be Mapping[Union[ColumnClause[Any], str]] but because Mapping is invariant in the key type, - # we must use Mapping[Any, Any] or list all subclasses of ColumnClause in the Union - def insert(self, values: Union[Mapping[Any, Any], Sequence[Any]] = ..., inline: bool = ..., **kwargs: Any) -> Insert: ... - def update(self, whereclause: Optional[Union[str, bool, Visitable]] = ..., - values: Union[Mapping[Any, Any], Sequence[Any]] = ..., - inline: bool = ..., **kwargs: Any) -> Update: ... - def delete(self, whereclause: Optional[Union[str, bool, Visitable]] = ..., **kwargs: Any) -> Delete: ... - -class ForUpdateArg(ClauseElement): - @classmethod - def parse_legacy_select(self, arg: Optional[str]) -> Optional[ForUpdateArg]: ... - @property - def legacy_for_update_value(self) -> Union[str, bool]: ... - nowait: bool = ... - read: bool = ... - skip_locked: bool = ... - key_share: bool = ... - of: Any = ... - def __init__(self, nowait: bool = ..., read: bool = ..., of: Optional[Union[TextClause, Sequence[ColumnClause[Any]]]] = ..., - skip_locked: bool = ..., key_share: bool = ...) -> None: ... - -_SB = TypeVar('_SB', bound=SelectBase) - -class SelectBase(HasCTE, Executable, FromClause): - def as_scalar(self) -> ScalarSelect[Any]: ... - def label(self, name: str) -> Label: ... - def autocommit(self: _SB) -> _SB: ... - -_GS = TypeVar('_GS', bound=GenerativeSelect) - -class GenerativeSelect(SelectBase): - use_labels: bool = ... - for_update: Union[str, bool] = ... - def __init__(self, use_labels: bool = ..., for_update: bool = ..., limit: Optional[int] = ..., - offset: Optional[int] = ..., - order_by: Optional[Union[int, str, Visitable, Iterable[Union[int, str, Visitable]]]] = ..., - group_by: Optional[Union[int, str, Visitable, Iterable[Union[int, str, Visitable]]]] = ..., - bind: Optional[Union[Engine, Connection]] = ..., - autocommit: Optional[bool] = ...) -> None: ... - def with_for_update(self: _GS, nowait: bool = ..., read: bool = ..., - of: Optional[Union[TextClause, Sequence[ColumnClause[Any]], TableClause, Sequence[TableClause]]] = ..., - skip_locked: bool = ..., key_share: bool = ...) -> _GS: ... - def apply_labels(self: _GS) -> _GS: ... - def limit(self: _GS, limit: Optional[Union[int, str, Visitable]]) -> _GS: ... - def offset(self: _GS, offset: Optional[Union[int, str, Visitable]]) -> _GS: ... - def order_by(self: _GS, *clauses: Optional[Union[str, bool, Visitable]]) -> _GS: ... - def group_by(self: _GS, *clauses: Optional[Union[str, bool, Visitable]]) -> _GS: ... - def append_order_by(self, *clauses: Optional[Union[str, bool, Visitable]]): ... - def append_group_by(self, *clauses: Optional[Union[str, bool, Visitable]]): ... - -class CompoundSelect(GenerativeSelect): - __visit_name__: str = ... - UNION: util.symbol = ... - UNION_ALL: util.symbol = ... - EXCEPT: util.symbol = ... - EXCEPT_ALL: util.symbol = ... - INTERSECT: util.symbol = ... - INTERSECT_ALL: util.symbol = ... - keyword: util.symbol = ... - selects: List[Selectable] = ... - def __init__(self, keyword: util.symbol, *selects: Selectable, **kwargs: Any) -> None: ... - def self_group(self, against: Optional[Any] = ...) -> FromGrouping: ... - def is_derived_from(self, fromclause: FromClause): ... - def get_children(self, column_collections: bool = ..., - **kwargs: Any) -> List[Union[ColumnClause[Any], ClauseElement, Selectable]]: ... - def bind(self) -> Optional[Union[Engine, Connection]]: ... - @classmethod - def _create_union(cls, *selects: Selectable, **kwargs: Any) -> CompoundSelect: ... - @classmethod - def _create_union_all(cls, *selects: Selectable, **kwargs: Any) -> CompoundSelect: ... - @classmethod - def _create_except(cls, *selects: Selectable, **kwargs: Any) -> CompoundSelect: ... - @classmethod - def _create_except_all(cls, *selects: Selectable, **kwargs: Any) -> CompoundSelect: ... - @classmethod - def _create_intersect(cls, *selects: Selectable, **kwargs: Any) -> CompoundSelect: ... - @classmethod - def _create_intersect_all(cls, *selects: Selectable, **kwargs: Any) -> CompoundSelect: ... - -_SE = TypeVar('_SE', bound=Select) - -class Select(HasPrefixes, HasSuffixes, GenerativeSelect): - __visit_name__: str = ... - def __init__(self, columns: Optional[Iterable[Union[ColumnElement[Any], FromClause, int]]] = ..., - whereclause: Optional[Union[str, bool, Visitable]] = ..., - from_obj: Optional[Union[str, Selectable, Iterable[Union[str, Selectable]]]] = ..., - group_by: Optional[Union[int, str, Visitable, Iterable[Union[int, str, Visitable]]]] = ..., - having: Optional[Union[str, bool, Visitable]] = ..., - order_by: Optional[Union[int, str, Visitable, Iterable[Union[int, str, Visitable]]]] = ..., - distinct: bool = ..., correlate: bool = ..., limit: Optional[int] = ..., offset: Optional[int] = ..., - use_labels: bool = ..., autocommit: bool = ..., bind: Union[Engine, Connection] = ..., - prefixes: Optional[Any] = ..., suffixes: Optional[Any] = ..., - **kwargs: Any) -> None: ... - @property - def froms(self) -> List[FromClause]: ... - def with_statement_hint(self: _SE, text: str, dialect_name: str = ...) -> _SE: ... - def with_hint(self: _SE, selectable: Union[Table, Alias], text: str, dialect_name: str = ...) -> _SE: ... - @property - def type(self) -> Any: ... - @property - def locate_all_froms(self) -> List[FromClause]: ... - @property - def inner_columns(self) -> Iterable[ColumnElement[Any]]: ... - def is_derived_from(self, fromclause: FromClause) -> bool: ... - def get_children(self, column_collections: bool = ..., **kwargs: Any) -> List[ClauseElement]: ... - def column(self: _SE, column: ColumnElement[Any]) -> _SE: ... - def reduce_columns(self: _SE, only_synonyms: bool = ...) -> _SE: ... - def with_only_columns(self: _SE, columns: Iterable[ColumnElement[Any]]) -> _SE: ... - def where(self: _SE, whereclause: Union[str, bool, Visitable]) -> _SE: ... - def having(self: _SE, having: Union[str, bool, Visitable]) -> _SE: ... - def distinct(self: _SE, *expr: ColumnElement[Any]) -> _SE: ... - def select_from(self: _SE, fromclause: FromClause) -> _SE: ... - def correlate(self: _SE, *fromclauses: FromClause) -> _SE: ... - def correlate_except(self: _SE, *fromclauses: FromClause) -> _SE: ... - def append_correlation(self, fromclause: FromClause) -> None: ... - def append_column(self, column: ColumnElement[Any]) -> None: ... - def append_prefix(self, clause) -> None: ... - def append_whereclause(self, whereclause: Union[str, bool, Visitable]) -> None: ... - def append_having(self, having: Union[str, bool, Visitable]) -> None: ... - def append_from(self, fromclause: FromClause) -> None: ... - def self_group(self: _SE, against: Optional[Any] = ...) -> Union[_SE, FromGrouping]: ... - def union(self, other: Selectable, **kwargs: Any) -> CompoundSelect: ... - def union_all(self, other: Selectable, **kwargs: Any) -> CompoundSelect: ... - def except_(self, other: Selectable, **kwargs: Any) -> CompoundSelect: ... - def except_all(self, other: Selectable, **kwargs: Any) -> CompoundSelect: ... - def intersect(self, other: Selectable, **kwargs: Any) -> CompoundSelect: ... - def intersect_all(self, other: Selectable, **kwargs: Any) -> CompoundSelect: ... - def bind(self) -> Optional[Union[Engine, Connection]]: ... - -_SS = TypeVar('_SS', bound=ScalarSelect) - -class ScalarSelect(Generative, Grouping[_T]): - element: ClauseElement = ... - type: TypeEngine[_T] = ... - def __init__(self, element: ClauseElement) -> None: ... - @property - def columns(self): ... - c: Any = ... - def where(self: _SS, crit: ClauseElement) -> _SS: ... - def self_group(self: _SS, **kwargs: Any) -> _SS: ... # type: ignore # return type incompatible with all supertypes - -class Exists(UnaryExpression): - __visit_name__: Any = ... - def __init__(self, *args: Union[Select, str], **kwargs: Any) -> None: ... - def select(self, whereclause: Optional[Union[str, bool, Visitable]] = ..., **params: Any) -> Select: ... - def correlate(self, *fromclause: FromClause) -> Exists: ... - def correlate_except(self, *fromclause: FromClause) -> Exists: ... - def select_from(self, clause: FromClause) -> Exists: ... - def where(self, clause: ClauseElement) -> Exists: ... - -_TAF = TypeVar('_TAF', bound=TextAsFrom) - -class TextAsFrom(SelectBase): - __visit_name__: str = ... - element: TextClause = ... - column_args: Any = ... - positional: Any = ... - def __init__(self, text: TextClause, columns: ColumnClause[Any], positional: bool = ...) -> None: ... - def bindparams(self: _TAF, *binds: BindParameter[Any], **bind_as_values: Any) -> _TAF: ... - -class AnnotatedFromClause(Annotated[FromClause]): - def __init__(self, element: FromClause, values: Any) -> None: ... diff --git a/sqlalchemy/sql/sqltypes.pyi b/sqlalchemy/sql/sqltypes.pyi deleted file mode 100644 index b3d84ba7..00000000 --- a/sqlalchemy/sql/sqltypes.pyi +++ /dev/null @@ -1,370 +0,0 @@ -from typing import Any, Optional, Union, TypeVar, Dict, List, Tuple, Callable, Type, IO, overload, Text as typing_Text -from typing_extensions import Protocol -from .type_api import TypeEngine as TypeEngine, TypeDecorator as TypeDecorator, Emulated, NativeForEmulated as NativeForEmulated -from .base import SchemaEventTarget as SchemaEventTarget -from .schema import MetaData -from datetime import datetime, date, time, timedelta -from ..engine import Dialect, Engine, Connection, Connectable -from .. import util -import decimal -import sys - -_T = TypeVar('_T') - -class _LookupExpressionAdapter(object): - comparator_factory: Type[Any] = ... - -class Concatenable(object): - comparator_factory: Type[Any] = ... - -class Indexable(object): - comparator_factory: Type[Any] = ... - -# Docs say that String is unicode when DBAPI supports it -# but it should be all major DBAPIs now. -class String(Concatenable, TypeEngine[typing_Text]): - __visit_name__: str = ... - length: Optional[int] = ... - collation: Optional[str] = ... - convert_unicode: Union[bool, str] = ... - unicode_error: Optional[str] = ... - @overload - def __init__(self, length: Optional[int] = ..., collation: Optional[str] = ..., - convert_unicode: bool = ..., _warn_on_bytestring: bool = ...) -> None: ... - @overload - def __init__(self, length: Optional[int] = ..., collation: Optional[str] = ..., - convert_unicode: str = ..., unicode_error: Optional[str] = ..., - _warn_on_bytestring: bool = ...) -> None: ... - def literal_processor(self, dialect: Dialect) -> Callable[[str], str]: ... - def bind_processor(self, dialect: Dialect) -> Optional[Callable[[str], str]]: ... - def result_processor(self, dialect: Dialect, coltype: Any) -> Optional[Callable[[Optional[Any]], Optional[str]]]: ... - @property - def python_type(self) -> Type[typing_Text]: ... - def get_dbapi_type(self, dbapi: Any) -> Any: ... - -class Text(String): - __visit_name__: str = ... - -class Unicode(String): - __visit_name__: str = ... - @overload - def __init__(self, length: Optional[int] = ..., collation: Optional[str] = ..., - convert_unicode: bool = ..., _warn_on_bytestring: bool = ...) -> None: ... - @overload - def __init__(self, length: Optional[int] = ..., collation: Optional[str] = ..., - convert_unicode: str = ..., unicode_error: Optional[str] = ..., - _warn_on_bytestring: bool = ...) -> None: ... - -class UnicodeText(Text): - __visit_name__: str = ... - @overload - def __init__(self, length: Optional[int] = ..., collation: Optional[str] = ..., - convert_unicode: bool = ..., _warn_on_bytestring: bool = ...) -> None: ... - @overload - def __init__(self, length: Optional[int] = ..., collation: Optional[str] = ..., - convert_unicode: str = ..., unicode_error: Optional[str] = ..., - _warn_on_bytestring: bool = ...) -> None: ... - -class Integer(_LookupExpressionAdapter, TypeEngine[int]): - __visit_name__: str = ... - def get_dbapi_type(self, dbapi): ... - @property - def python_type(self) -> Type[int]: ... - def literal_processor(self, dialect: Dialect) -> Callable[[int], str]: ... - -class SmallInteger(Integer): - __visit_name__: str = ... - -class BigInteger(Integer): - __visit_name__: str = ... - -# TODO: This can also be float (however, decimal is the default) -class Numeric(_LookupExpressionAdapter, TypeEngine[decimal.Decimal]): - __visit_name__: str = ... - precision: Optional[int] = ... - scale: Optional[int] = ... - decimal_return_scale: Optional[int] = ... - asdecimal: bool = ... - def __init__(self, precision: Optional[int] = ..., scale: Optional[int] = ..., - decimal_return_scale: Optional[int] = ..., asdecimal: bool = ...) -> None: ... - def get_dbapi_type(self, dbapi: Any) -> Any: ... - def literal_processor(self, dialect: Dialect) -> Callable[[Union[float, decimal.Decimal]], str]: ... - @property - def python_type(self) -> Union[Type[float], Type[decimal.Decimal]]: ... # type: ignore # return type incompatible - def bind_processor(self, dialect: Dialect) -> Optional[Callable[[Optional[str]], decimal.Decimal]]: ... - def result_processor(self, dialect: Dialect, coltype: Any) -> Optional[Callable[[Optional[Any]], - Optional[Union[float, decimal.Decimal]]]]: ... - -class Float(Numeric): - __visit_name__: str = ... - scale: Optional[int] = ... - precision: Optional[int] = ... - asdecimal: bool = ... - decimal_return_scale: Optional[int] = ... - def __init__(self, precision: Optional[int] = ..., asdecimal: bool = ..., - decimal_return_scale: Optional[int] = ..., **kwargs: Any) -> None: ... - def result_processor(self, dialect: Dialect, coltype: Any) -> Optional[Callable[[Optional[Any]], - Optional[Union[float, decimal.Decimal]]]]: ... - -class DateTime(_LookupExpressionAdapter, TypeEngine[datetime]): - __visit_name__: str = ... - timezone: bool = ... - def __init__(self, timezone: bool = ...) -> None: ... - def get_dbapi_type(self, dbapi: Any) -> Any: ... - @property - def python_type(self) -> Type[datetime]: ... - -class Date(_LookupExpressionAdapter, TypeEngine[date]): - __visit_name__: str = ... - def get_dbapi_type(self, dbapi: Any) -> Any: ... - @property - def python_type(self) -> Type[date]: ... - -class Time(_LookupExpressionAdapter, TypeEngine[time]): - __visit_name__: str = ... - timezone: bool = ... - def __init__(self, timezone: bool = ...) -> None: ... - def get_dbapi_type(self, dbapi: Any) -> Any: ... - @property - def python_type(self) -> Type[time]: ... - -if sys.version_info[0] < 3: - _BinaryType = str -else: - _BinaryType = bytes - -class _Binary(TypeEngine[_BinaryType]): - length: int = ... - def __init__(self, length: Optional[int] = ...) -> None: ... - def literal_processor(self, dialect: Dialect) -> Callable[[_BinaryType], str]: ... - @property - def python_type(self) -> Type[_BinaryType]: ... - def bind_processor(self, dialect: Dialect) -> Optional[Callable[[_BinaryType], Any]]: ... - def result_processor(self, dialect: Dialect, coltype: Any) -> Optional[Callable[[Optional[Any]], Optional[_BinaryType]]]: ... - def coerce_compared_value(self, op: Any, value: Any) -> TypeEngine[Any]: ... - def get_dbapi_type(self, dbapi: Any) -> Any: ... - -class LargeBinary(_Binary): - __visit_name__: str = ... - def __init__(self, length: Optional[int] = ...) -> None: ... - -class Binary(LargeBinary): - def __init__(self, length: Optional[int] = ...) -> None: ... - -class SchemaType(SchemaEventTarget): - name: Optional[str] = ... - schema: Optional[str] = ... - metadata: Optional[MetaData] = ... - inherit_schema: bool = ... - def __init__(self, name: Optional[str] = ..., schema: Optional[str] = ..., - metadata: Optional[MetaData] = ..., inherit_schema: bool = ..., - quote: Optional[bool] = ..., _create_events: bool = ...) -> None: ... - def copy(self, **kw: Any) -> Any: ... - def adapt(self, cls: Type[_T], **kw: Any) -> _T: ... - @property - def bind(self) -> Optional[Union[Engine, Connection]]: ... - def create(self, bind: Optional[Connectable] = ..., checkfirst: bool = ...) -> None: ... - def drop(self, bind: Optional[Connectable] = ..., checkfirst: bool = ...) -> None: ... - -_E = TypeVar('_E', bound=Enum) - -class Enum(Emulated, String, SchemaType): - __visit_name__: str = ... - native_enum: bool = ... - create_constraint: bool = ... - validate_strings: bool = ... - enums: List[typing_Text] = ... # This is set inside _setup_for_values. - def __init__(self, *enums: Any, **kw: Any) -> None: ... - @property - def native(self) -> bool: ... - comparator_factory: Type[Any] = ... - def adapt_to_emulated(self, impltype: Type[_T], **kw: Any) -> _T: ... - def adapt(self, cls: Type[Any], **kw: Any) -> Any: ... - def literal_processor(self, dialect: Dialect): ... - def bind_processor(self, dialect: Dialect): ... - def result_processor(self, dialect: Dialect, coltype: Any): ... - def copy(self: _E, **kw: Any) -> _E: ... - @property - def python_type(self): ... - -class _Pickler(Protocol): - if sys.version_info >= (3, 0): - def dump(self, obj: Any, file: IO[bytes], protocol: Optional[int] = ..., *, - fix_imports: bool = ...) -> None: ... - def dumps(self, obj: Any, protocol: Optional[int] = ..., *, - fix_imports: bool = ...) -> bytes: ... - def loads(self, bytes_object: bytes, *, fix_imports: bool = ..., - encoding: str = ..., errors: str = ...) -> Any: ... - def load(self, file: IO[bytes], *, fix_imports: bool = ..., encoding: str = ..., - errors: str = ...) -> Any: ... - else: - def dump(self, obj: Any, file: IO[bytes], protocol: Optional[int] = ...) -> None: ... - def dumps(self, obj: Any, protocol: Optional[int] = ...) -> bytes: ... - def load(self, file: IO[bytes]) -> Any: ... - def loads(self, string: bytes) -> Any: ... - -class PickleType(TypeDecorator[Any]): - impl: Any = ... # impl is Type[TypeEngine[LargeBinary]] on the class, but TypeEngine[LargeBinary] on instances - protocol: int = ... - pickler: _Pickler = ... - comparator: Optional[Callable[[Any, Any], bool]] = ... - def __init__(self, protocol: int = ..., pickler: Optional[_Pickler] = ..., - comparator: Optional[Callable[[Any, Any], bool]] = ...) -> None: ... - def __reduce__(self) -> Tuple[Type[PickleType], Tuple[int, None, Optional[Callable[[Any, Any], bool]]]]: ... - def bind_processor(self, dialect: Dialect) -> Callable[[Optional[Any]], Optional[str]]: ... - def result_processor(self, dialect: Dialect, coltype: Any) -> Callable[[Optional[Any]], Any]: ... - def compare_values(self, x: Any, y: Any) -> bool: ... - -class Boolean(Emulated, TypeEngine[bool], SchemaType): - __visit_name__: str = ... - create_constraint: bool = ... - name: str = ... - def __init__(self, create_constraint: bool = ..., name: Optional[str] = ..., - _create_events: bool = ...) -> None: ... - @property - def python_type(self) -> Type[bool]: ... - def literal_processor(self, dialect: Dialect) -> Callable[[Optional[bool]], str]: ... - def bind_processor(self, dialect: Dialect) -> Callable[[Optional[bool]], Optional[Union[bool, int]]]: ... - def result_processor(self, dialect: Dialect, coltype: Any) -> Optional[Callable[[Optional[int]], bool]]: ... - -class _AbstractInterval(_LookupExpressionAdapter, TypeEngine[_T]): - def coerce_compared_value(self, op: Any, value: Any) -> TypeEngine[Any]: ... - -# "comparator_factory" of "_LookupExpressionAdapter" and "TypeDecorator" are incompatible -class Interval(Emulated, _AbstractInterval[timedelta], TypeDecorator[timedelta]): # type: ignore - impl: Any = ... # impl is Type[TypeEngine[DateTime]] on the class, but TypeEngine[DateTime] on instances - epoch: datetime = ... - native: bool = ... - second_precision: Optional[float] = ... - day_precision: Optional[float] = ... - def __init__(self, native: bool = ..., second_precision: Optional[float] = ..., - day_precision: Optional[float] = ...) -> None: ... - def adapt_to_emulated(self, impltype: Type[Any], **kw: Any) -> Any: ... - @property - def python_type(self) -> Type[timedelta]: ... - def bind_processor(self, dialect: Dialect) -> Callable[[Optional[timedelta]], str]: ... - def result_processor(self, dialect: Dialect, coltype: Any) -> Callable[[Optional[str]], Optional[timedelta]]: ... - -_JSONT = Union[Dict[str, Any], List[Any]] - -class JSON(Indexable, TypeEngine[_JSONT]): - __visit_name__: str = ... - hashable: bool = ... - NULL: util.symbol = ... - none_as_null: bool = ... - def __init__(self, none_as_null: bool = ...) -> None: ... - class JSONElementType(TypeEngine[Union[int, str]]): - def string_bind_processor(self, dialect): ... - def string_literal_processor(self, dialect): ... - def bind_processor(self, dialect): ... - def literal_processor(self, dialect): ... - class JSONIndexType(JSONElementType): ... - class JSONPathType(JSONElementType): ... - comparator_factory: Type[Any] = ... - # This method returns `dict`, but it seems to be a bug in SQLAlchemy. - @property - def python_type(self) -> Type[Dict[str, Any]]: ... - @property - def should_evaluate_none(self) -> bool: ... # type: ignore # incompatible with supertype "TypeEngine" - def bind_processor(self, dialect: Dialect) -> Callable[[Optional[_JSONT]], Optional[str]]: ... - def result_processor(self, dialect: Dialect, coltype: Any) -> Callable[[Optional[str]], Optional[_JSONT]]: ... - -class ARRAY(Indexable, Concatenable, TypeEngine[List[_T]]): - __visit_name__: str = ... - zero_indexes: bool = ... - comparator_factory: Type[Any] = ... - item_type: TypeEngine[_T] = ... - as_tuple: bool = ... - dimensions: Optional[int] = ... - @overload - def __init__(self, item_type: TypeEngine[_T], as_tuple: bool = ..., dimensions: Optional[int] = ..., - zero_indexes: bool = ...) -> None: ... - @overload - def __init__(self, item_type: Type[TypeEngine[_T]], as_tuple: bool = ..., dimensions: Optional[int] = ..., - zero_indexes: bool = ...) -> None: ... - @property - def hashable(self) -> bool: ... # type: ignore # incompatible with supertype "TypeEngine" - @property - def python_type(self) -> Type[List[_T]]: ... - def compare_values(self, x: Any, y: Any) -> bool: ... # this function just does a simple comparison - -class REAL(Float): - __visit_name__: str = ... - -class FLOAT(Float): - __visit_name__: str = ... - -class NUMERIC(Numeric): - __visit_name__: str = ... - -class DECIMAL(Numeric): - __visit_name__: str = ... - -class INTEGER(Integer): - __visit_name__: str = ... - -INT = INTEGER - -class SMALLINT(SmallInteger): - __visit_name__: str = ... - -class BIGINT(BigInteger): - __visit_name__: str = ... - -class TIMESTAMP(DateTime): - __visit_name__: str = ... - def __init__(self, timezone: bool = ...) -> None: ... - def get_dbapi_type(self, dbapi: Any) -> Any: ... - -class DATETIME(DateTime): - __visit_name__: str = ... - -class DATE(Date): - __visit_name__: str = ... - -class TIME(Time): - __visit_name__: str = ... - -class TEXT(Text): - __visit_name__: str = ... - -class CLOB(Text): - __visit_name__: str = ... - -class VARCHAR(String): - __visit_name__: str = ... - -class NVARCHAR(Unicode): - __visit_name__: str = ... - -class CHAR(String): - __visit_name__: str = ... - -class NCHAR(Unicode): - __visit_name__: str = ... - -class BLOB(LargeBinary): - __visit_name__: str = ... - -class BINARY(_Binary): - __visit_name__: str = ... - -class VARBINARY(_Binary): - __visit_name__: str = ... - -class BOOLEAN(Boolean): - __visit_name__: str = ... - -class NullType(TypeEngine[None]): - __visit_name__: str = ... - hashable: bool = ... - def literal_processor(self, dialect: Dialect) -> Callable[[Any], str]: ... - comparator_factory: Type[Any] = ... - -class MatchType(Boolean): ... - -NULLTYPE: NullType = ... -BOOLEANTYPE: Boolean = ... -STRINGTYPE: String = ... -INTEGERTYPE: Integer = ... -MATCHTYPE: MatchType = ... diff --git a/sqlalchemy/sql/type_api.pyi b/sqlalchemy/sql/type_api.pyi deleted file mode 100644 index 16752574..00000000 --- a/sqlalchemy/sql/type_api.pyi +++ /dev/null @@ -1,121 +0,0 @@ -from typing import Any, Optional, Union, TypeVar, Generic, Type, Callable, ClassVar, Tuple, Mapping, overload, Text as typing_Text -from .. import util -from .visitors import Visitable as Visitable, VisitableType as VisitableType -from .base import SchemaEventTarget as SchemaEventTarget -from . import operators -from .sqltypes import NullType, Integer, Boolean, String, MatchType, Indexable -from ..engine.interfaces import Dialect -from .elements import ColumnElement, BindParameter - -_T = TypeVar('_T') -_T_co = TypeVar('_T_co', covariant=True) -_U = TypeVar('_U') - -# TODO: simplify import cycle with sqltypes -BOOLEANTYPE: Boolean = ... -INTEGERTYPE: Integer = ... -NULLTYPE: NullType = ... -STRINGTYPE: String = ... -MATCHTYPE: MatchType = ... -INDEXABLE: Indexable = ... - -_TE = TypeVar('_TE', bound=TypeEngine) - -# It is not 100% clear that TypeEngine is covariant at this stage since -# many types are still missing. Anyway, this looks plausible and practical. -class TypeEngine(Visitable, Generic[_T_co]): - class Comparator(operators.ColumnOperators): - default_comparator: Any = ... - expr: Any = ... - type: Any = ... - def __init__(self, expr) -> None: ... - def operate(self, op, *other, **kwargs): ... - def reverse_operate(self, op, other, **kwargs): ... - def __reduce__(self): ... - hashable: bool = ... - comparator_factory: Type[Any] = ... - should_evaluate_none: bool = ... - def evaluates_none(self: _TE) -> _TE: ... - def copy(self: _TE, **kw: Any) -> _TE: ... - def compare_against_backend(self, dialect: Dialect, conn_type: Any) -> Any: ... - def copy_value(self, value: _T) -> _T: ... - def literal_processor(self, dialect: Dialect) -> Optional[Callable[..., Any]]: ... - def bind_processor(self, dialect: Dialect) -> Optional[Callable[..., Any]]: ... - def result_processor(self, dialect: Dialect, coltype: Any) -> Optional[Callable[..., Any]]: ... - def column_expression(self, colexpr: Union[str, ColumnElement[Any]]) -> Optional[ColumnElement[Any]]: ... - def bind_expression(self, bindvalue: BindParameter[Any]) -> Optional[Any]: ... - def compare_values(self, x: Any, y: Any) -> bool: ... - def get_dbapi_type(self, dbapi: Any) -> Any: ... - @property - def python_type(self) -> Type[_T_co]: ... - def with_variant(self, type_: TypeEngine[_U], dialect_name: str) -> Variant[_U]: ... - def dialect_impl(self, dialect: Dialect): ... - def adapt(self, cls: Type[_U], **kw: Any) -> _U: ... - def coerce_compared_value(self, op: Any, value: Any) -> TypeEngine[Any]: ... - def compile(self, dialect: Optional[Dialect] = ...): ... - -class VisitableCheckKWArg(util.EnsureKWArgType, VisitableType): ... - -_UDT = TypeVar('_UDT', bound=UserDefinedType) - -class UserDefinedType(TypeEngine[_T], metaclass=VisitableCheckKWArg): - __visit_name__: str = ... - ensure_kwarg: str = ... - class Comparator(TypeEngine.Comparator): ... - comparator_factory: Type[Any] = ... - def coerce_compared_value(self: _UDT, op: Any, value: Any) -> _UDT: ... - -class Emulated(object): - def adapt_to_emulated(self, impltype: Type[Any], **kw: Any) -> Any: ... - def adapt(self, cls: Type[Any], **kw: Any) -> Any: ... - -_NFE = TypeVar('_NFE', bound=NativeForEmulated) - -class NativeForEmulated(object): - @classmethod - def adapt_emulated_to_native(cls: Type[_NFE], impl: Any, **kw: Any) -> _NFE: ... - -_TD = TypeVar('_TD', bound=TypeDecorator) - -class TypeDecorator(SchemaEventTarget, TypeEngine[_T]): - __visit_name__: str = ... - impl: Any = ... # impl is Type[TypeEngine[Any]] on the class, but TypeEngine[Any] on instances - def __init__(self, *args: Any, **kwargs: Any) -> None: ... - coerce_to_is_types: Tuple[Type[Any], ...] = ... - class Comparator(TypeEngine.Comparator): - def operate(self, op, *other, **kwargs): ... - def reverse_operate(self, op, other, **kwargs): ... - # Signature of comparator factory incompatible with supertype TypeEngine - @property - def comparator_factory(self) -> Type[Any]: ... # type: ignore - def type_engine(self, dialect: Dialect) -> TypeEngine[Any]: ... - def load_dialect_impl(self, dialect: Dialect) -> TypeEngine[Any]: ... - def __getattr__(self, key: str) -> Any: ... - def process_literal_param(self, value: Optional[_T], dialect: Dialect) -> Optional[str]: ... - def process_bind_param(self, value: Optional[_T], dialect: Dialect) -> Optional[typing_Text]: ... - def process_result_value(self, value: Optional[Any], dialect: Dialect) -> Optional[_T]: ... - def literal_processor(self, dialect: Dialect) -> Callable[[Optional[_T]], Optional[str]]: ... - def bind_processor(self, dialect: Dialect) -> Callable[[Optional[_T]], Optional[str]]: ... - def result_processor(self, dialect: Dialect, coltype) -> Callable[[Optional[Any]], Optional[_T]]: ... - def coerce_compared_value(self: _TD, op: Any, value: Any) -> Union[_TD, TypeEngine[Any]]: ... - def copy(self: _TD, **kw: Any) -> _TD: ... - def get_dbapi_type(self, dbapi: Any) -> Any: ... - def compare_values(self, x: Any, y: Any) -> bool: ... - -_VT = TypeVar('_VT', bound=Variant) - -class Variant(TypeDecorator[_T]): - mapping: Any = ... - def __init__(self, base: TypeEngine[_T], mapping: Mapping[str, TypeEngine[Any]]) -> None: ... - def coerce_compared_value(self: _VT, operator: Any, value: Any) -> Union[_VT, TypeEngine[_T]]: ... - def load_dialect_impl(self, dialect: Dialect) -> TypeEngine[Any]: ... - def with_variant(self, type_: TypeEngine[_U], dialect_name: str) -> Variant[_U]: ... - # Signature of comparator factory incompatible with supertype TypeEngine - @property - def comparator_factory(self) -> Type[Any]: ... # type: ignore - -@overload -def to_instance(typeobj: Type[TypeEngine[_T]], *arg: Any, **kw: Any) -> TypeEngine[_T]: ... -@overload -def to_instance(typeobj: TypeEngine[_T], *arg: Any, **kw: Any) -> TypeEngine[_T]: ... -def adapt_type(typeobj: Any, colspecs: Mapping[Any, Any]) -> Any: ... diff --git a/sqlalchemy/sql/util.pyi b/sqlalchemy/sql/util.pyi deleted file mode 100644 index 9f9adcb2..00000000 --- a/sqlalchemy/sql/util.pyi +++ /dev/null @@ -1,46 +0,0 @@ -from typing import Any, Optional -from . import visitors - -join_condition: Any = ... - -def find_join_source(clauses, join_to): ... -def visit_binary_product(fn, expr): ... -def find_tables(clause, check_columns: bool = ..., include_aliases: bool = ..., include_joins: bool = ..., - include_selects: bool = ..., include_crud: bool = ...): ... -def unwrap_order_by(clause): ... -def unwrap_label_reference(element): ... -def expand_column_list_from_order_by(collist, order_by): ... -def clause_is_present(clause, search): ... -def surface_selectables(clause): ... -def surface_column_elements(clause): ... -def selectables_overlap(left, right): ... -def bind_values(clause): ... - -def adapt_criterion_to_null(crit, nulls): ... -def splice_joins(left, right, stop_on: Optional[Any] = ...): ... -def reduce_columns(columns, *clauses, **kw): ... -def criterion_as_pairs(expression, consider_as_foreign_keys: Optional[Any] = ..., - consider_as_referenced_keys: Optional[Any] = ..., any_operator: bool = ...): ... - -class ClauseAdapter(visitors.ReplacingCloningVisitor): - __traverse_options__: Any = ... - selectable: Any = ... - include_fn: Any = ... - exclude_fn: Any = ... - equivalents: Any = ... - adapt_on_names: Any = ... - def __init__(self, selectable, equivalents: Optional[Any] = ..., include_fn: Optional[Any] = ..., - exclude_fn: Optional[Any] = ..., adapt_on_names: bool = ..., anonymize_labels: bool = ...) -> None: ... - def replace(self, col): ... - -class ColumnAdapter(ClauseAdapter): - columns: Any = ... - adapt_required: Any = ... - allow_label_resolve: Any = ... - def __init__(self, selectable, equivalents: Optional[Any] = ..., chain_to: Optional[Any] = ..., - adapt_required: bool = ..., include_fn: Optional[Any] = ..., exclude_fn: Optional[Any] = ..., - adapt_on_names: bool = ..., allow_label_resolve: bool = ..., anonymize_labels: bool = ...) -> None: ... - def wrap(self, adapter): ... - def traverse(self, obj): ... - adapt_clause: Any = ... - adapt_list: Any = ... diff --git a/sqlalchemy/sql/visitors.pyi b/sqlalchemy/sql/visitors.pyi deleted file mode 100644 index 3a1e542a..00000000 --- a/sqlalchemy/sql/visitors.pyi +++ /dev/null @@ -1,29 +0,0 @@ -from typing import Any - -class VisitableType(type): - def __init__(cls, clsname, bases, clsdict) -> None: ... - -class Visitable(object, metaclass=VisitableType): ... - -class ClauseVisitor(object): - __traverse_options__: Any = ... - def traverse_single(self, obj, **kw): ... - def iterate(self, obj): ... - def traverse(self, obj): ... - def chain(self, visitor): ... - -class CloningVisitor(ClauseVisitor): - def copy_and_process(self, list_): ... - def traverse(self, obj): ... - -class ReplacingCloningVisitor(CloningVisitor): - def replace(self, elem): ... - def traverse(self, obj): ... - -def iterate(obj, opts): ... -def iterate_depthfirst(obj, opts): ... -def traverse_using(iterator, obj, visitors): ... -def traverse(obj, opts, visitors): ... -def traverse_depthfirst(obj, opts, visitors): ... -def cloned_traverse(obj, opts, visitors): ... -def replacement_traverse(obj, opts, replace): ... diff --git a/sqlalchemy/types.pyi b/sqlalchemy/types.pyi deleted file mode 100644 index baae8898..00000000 --- a/sqlalchemy/types.pyi +++ /dev/null @@ -1,57 +0,0 @@ -from .sql.type_api import ( - adapt_type as adapt_type, - TypeEngine as TypeEngine, - TypeDecorator as TypeDecorator, - Variant as Variant, - to_instance as to_instance, - UserDefinedType as UserDefinedType -) - -from .sql.sqltypes import ( - ARRAY as ARRAY, - BIGINT as BIGINT, - BINARY as BINARY, - BLOB as BLOB, - BOOLEAN as BOOLEAN, - BigInteger as BigInteger, - Binary as Binary, - Boolean as Boolean, - CHAR as CHAR, - CLOB as CLOB, - Concatenable as Concatenable, - DATE as DATE, - DATETIME as DATETIME, - DECIMAL as DECIMAL, - Date as Date, - DateTime as DateTime, - Enum as Enum, - FLOAT as FLOAT, - Float as Float, - Indexable as Indexable, - INT as INT, - INTEGER as INTEGER, - Integer as Integer, - Interval as Interval, - JSON as JSON, - LargeBinary as LargeBinary, - NCHAR as NCHAR, - NVARCHAR as NVARCHAR, - NUMERIC as NUMERIC, - Numeric as Numeric, - PickleType as PickleType, - REAL as REAL, - SMALLINT as SMALLINT, - SmallInteger as SmallInteger, - String as String, - TEXT as TEXT, - TIME as TIME, - TIMESTAMP as TIMESTAMP, - Text as Text, - Time as Time, - Unicode as Unicode, - UnicodeText as UnicodeText, - VARBINARY as VARBINARY, - VARCHAR as VARCHAR, - _Binary as _Binary, - MatchType as MatchType -) diff --git a/sqlalchemy/util/__init__.pyi b/sqlalchemy/util/__init__.pyi deleted file mode 100644 index a94beb2c..00000000 --- a/sqlalchemy/util/__init__.pyi +++ /dev/null @@ -1,134 +0,0 @@ -from .compat import ( - callable as callable, - cmp as cmp, - reduce as reduce, - threading as threading, - py3k as py3k, - py33 as py33, - py36 as py36, - py2k as py2k, - jython as jython, - pypy as pypy, - cpython as cpython, - win32 as win32, - pickle as pickle, - dottedgetter as dottedgetter, - parse_qsl as parse_qsl, - namedtuple as namedtuple, - next as next, - reraise as reraise, - raise_from_cause as raise_from_cause, - text_type as text_type, - safe_kwarg as safe_kwarg, - string_types as string_types, - int_types as int_types, - binary_type as binary_type, - nested as nested, - quote_plus as quote_plus, - with_metaclass as with_metaclass, - print_ as print_, - itertools_filterfalse as itertools_filterfalse, - u as u, - ue as ue, - b as b, - unquote_plus as unquote_plus, - unquote as unquote, - b64decode as b64decode, - b64encode as b64encode, - byte_buffer as byte_buffer, - itertools_filter as itertools_filter, - iterbytes as iterbytes, - StringIO as StringIO, - inspect_getargspec as inspect_getargspec, - zip_longest as zip_longest -) -from ._collections import ( - KeyedTuple as KeyedTuple, - ImmutableContainer as ImmutableContainer, - immutabledict as immutabledict, - Properties as Properties, - OrderedProperties as OrderedProperties, - ImmutableProperties as ImmutableProperties, - OrderedDict as OrderedDict, - OrderedSet as OrderedSet, - IdentitySet as IdentitySet, - OrderedIdentitySet as OrderedIdentitySet, - column_set as column_set, - column_dict as column_dict, - ordered_column_set as ordered_column_set, - populate_column_dict as populate_column_dict, - unique_list as unique_list, - UniqueAppender as UniqueAppender, - PopulateDict as PopulateDict, - EMPTY_SET as EMPTY_SET, - to_list as to_list, - to_set as to_set, - to_column_set as to_column_set, - update_copy as update_copy, - flatten_iterator as flatten_iterator, - has_intersection as has_intersection, - LRUCache as LRUCache, - ScopedRegistry as ScopedRegistry, - ThreadLocalRegistry as ThreadLocalRegistry, - WeakSequence as WeakSequence, - coerce_generator_arg as coerce_generator_arg, - lightweight_named_tuple as lightweight_named_tuple -) -from .langhelpers import ( - iterate_attributes as iterate_attributes, - class_hierarchy as class_hierarchy, - portable_instancemethod as portable_instancemethod, - unbound_method_to_callable as unbound_method_to_callable, - getargspec_init as getargspec_init, - format_argspec_init as format_argspec_init, - format_argspec_plus as format_argspec_plus, - get_func_kwargs as get_func_kwargs, - get_cls_kwargs as get_cls_kwargs, - decorator as decorator, - as_interface as as_interface, - memoized_property as memoized_property, - memoized_instancemethod as memoized_instancemethod, - md5_hex as md5_hex, - group_expirable_memoized_property as group_expirable_memoized_property, - dependencies as dependencies, - decode_slice as decode_slice, - monkeypatch_proxied_specials as monkeypatch_proxied_specials, - asbool as asbool, - bool_or_str as bool_or_str, - coerce_kw_type as coerce_kw_type, - duck_type_collection as duck_type_collection, - assert_arg_type as assert_arg_type, - symbol as symbol, - dictlike_iteritems as dictlike_iteritems, - classproperty as classproperty, - set_creation_order as set_creation_order, - warn_exception as warn_exception, - warn as warn, - NoneType as NoneType, - constructor_copy as constructor_copy, - methods_equivalent as methods_equivalent, - chop_traceback as chop_traceback, - asint as asint, - generic_repr as generic_repr, - counter as counter, - PluginLoader as PluginLoader, - hybridproperty as hybridproperty, - hybridmethod as hybridmethod, - safe_reraise as safe_reraise, - get_callable_argspec as get_callable_argspec, - only_once as only_once, - attrsetter as attrsetter, - ellipses_string as ellipses_string, - warn_limited as warn_limited, - map_bits as map_bits, - MemoizedSlots as MemoizedSlots, - EnsureKWArgType as EnsureKWArgType, - wrap_callable as wrap_callable -) -from .deprecations import ( - warn_deprecated as warn_deprecated, - warn_pending_deprecation as warn_pending_deprecation, - deprecated as deprecated, - pending_deprecation as pending_deprecation, - inject_docstring_text as inject_docstring_text -) diff --git a/sqlalchemy/util/_collections.pyi b/sqlalchemy/util/_collections.pyi deleted file mode 100644 index 66406076..00000000 --- a/sqlalchemy/util/_collections.pyi +++ /dev/null @@ -1,247 +0,0 @@ -from typing import ( - Any, Optional, Union, FrozenSet, Generic, Type, TypeVar, Set, Iterator, Iterable, Tuple, List, Callable, Dict, Mapping, - AbstractSet, overload -) -import sys - -_T = TypeVar('_T') -_U = TypeVar('_U') - -_KT = TypeVar('_KT') -_VT = TypeVar('_VT') - -EMPTY_SET: FrozenSet[Any] = ... - -class AbstractKeyedTuple(Tuple[_T, ...], Generic[_T]): - def keys(self) -> List[str]: ... - -class KeyedTuple(AbstractKeyedTuple[_T]): - def __new__(cls, vals, labels: Optional[Any] = ...): ... - def __setattr__(self, key, value): ... - -class ImmutableContainer(object): ... - -class immutabledict(ImmutableContainer, Dict[_KT, _VT]): - clear: Any = ... - pop: Any = ... - popitem: Any = ... - setdefault: Any = ... - update: Any = ... - def __new__(cls, *args): ... - @overload - def __init__(self, **kwargs: _VT) -> None: ... - @overload - def __init__(self, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... - @overload - def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... - def __reduce__(self) -> Tuple[Type[immutabledict[_KT, _VT]], Tuple[Dict[_KT, _VT]]]: ... - @overload - def union(self, d: Mapping[_U, _T]) -> immutabledict[Union[_U, _KT], Union[_VT, _T]]: ... - @overload - def union(self, d: Iterable[Tuple[_U, _T]]) -> immutabledict[Union[_U, _KT], Union[_VT, _T]]: ... - -class Properties(Generic[_T]): - def __init__(self, data) -> None: ... - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[_T]: ... - def __add__(self, other: Iterable[_U]) -> List[Union[_T, _U]]: ... - def __setitem__(self, key: str, object: _T) -> None: ... - def __getitem__(self, key: str) -> _T: ... - def __delitem__(self, key: str) -> None: ... - def __setattr__(self, key: str, obj: _T) -> None: ... - def __getattr__(self, key: str) -> _T: ... - def __contains__(self, key: str) -> bool: ... - def as_immutable(self) -> ImmutableProperties[_T]: ... - @overload - def update(self, value: Mapping[str, _T]) -> None: ... - @overload - def update(self, value: Iterable[Tuple[str, _T]]) -> None: ... - @overload - def get(self, k: str) -> Optional[_T]: ... - @overload - def get(self, k: str, default: Union[_T, _U]) -> Union[_T, _U]: ... - def keys(self) -> List[str]: ... - def values(self) -> List[_T]: ... - def items(self) -> List[Tuple[str, _T]]: ... - def has_key(self, key: str) -> bool: ... - def clear(self) -> None: ... - -class OrderedProperties(Properties[_T]): - def __init__(self) -> None: ... - -class ImmutableProperties(ImmutableContainer, Properties[_T]): ... - -class OrderedDict(Dict[_KT, _VT]): - def __reduce__(self): ... - def __init__(self, ____sequence: Optional[Any] = ..., **kwargs) -> None: ... - def clear(self) -> None: ... - def copy(self) -> OrderedDict[_KT, _VT]: ... - def __copy__(self) -> OrderedDict[_KT, _VT]: ... - if sys.version_info < (3, 0): - def sort(self, cmp: Callable[[_VT, _VT], Any] = ..., key: Callable[[_VT], Any] = ..., reverse: bool = ...) -> None: ... - else: - def sort(self, *, key: Optional[Callable[[_VT], Any]] = ..., reverse: bool = ...) -> None: ... - @overload - def update(self, ____sequence: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... - @overload - def update(self, ____sequence: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... - @overload - def update(self, **kwargs: _VT) -> None: ... - # Signature of "setdefault" incompatible with supertype "dict" and "MutableMapping" - def setdefault(self, key: _KT, value: _VT) -> _VT: ... # type: ignore - def __iter__(self) -> Iterator[_KT]: ... - # Return type of "keys" incompatible with supertype "dict" and "Mapping" - def keys(self) -> List[_KT]: ... # type: ignore - # Return type of "values" incompatible with supertype "dict" and "Mapping" - def values(self) -> List[_VT]: ... # type: ignore - # Return type of "items" incompatible with supertype "dict" and "Mapping" - def items(self) -> List[Tuple[_KT, _VT]]: ... # type: ignore - if sys.version_info < (3, 0): - def itervalues(self) -> Iterator[_VT]: ... - def iterkeys(self) -> Iterator[_KT]: ... - def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... - def __setitem__(self, key: _KT, object: _VT) -> None: ... - def __delitem__(self, key: _KT) -> None: ... - @overload - def pop(self, key: _KT) -> _VT: ... - @overload - def pop(self, key: _KT, *default: Union[_VT, _T]) -> Union[_VT, _T]: ... - def popitem(self) -> Tuple[_KT, _VT]: ... - -_OS = TypeVar('_OS', bound=OrderedSet) - -class OrderedSet(Set[_T]): - # TODO: double-check method signatures in this class. - # We can potentially find some compromises to avoid a bunch of '# type: ignore's - def __init__(self, d: Optional[Iterable[_T]] = ...) -> None: ... - def add(self, element: _T) -> None: ... - def remove(self, element: _T) -> None: ... - def insert(self, pos: int, element: _T) -> None: ... - def discard(self, element: _T) -> None: ... - def clear(self) -> None: ... - def __getitem__(self, key: int) -> _T: ... - def __iter__(self) -> Iterator[_T]: ... - def __add__(self: _OS, other: Iterable[_T]) -> _OS: ... - def update(self: _OS, iterable: Iterable[_T]) -> _OS: ... # type: ignore # signature incompatible with supertype - def __ior__(self: _OS, iterable: Iterable[_U]) -> OrderedSet[Union[_T, _U]]: ... - def union(self: _OS, other: Iterable[_T]) -> _OS: ... # type: ignore # signature incompatible with supertype - def __or__(self: _OS, other: Iterable[_U]) -> OrderedSet[Union[_T, _U]]: ... - def intersection(self: _OS, other: Iterable[object]) -> _OS: ... # type: ignore # signature incompatible with supertype - def __and__(self: _OS, other: Iterable[object]) -> _OS: ... - def symmetric_difference(self: _OS, other: Iterable[_T]) -> _OS: ... - def __xor__(self: _OS, other: Iterable[_U]) -> OrderedSet[Union[_T, _U]]: ... - def difference(self: _OS, other: Iterable[object]) -> _OS: ... # type: ignore # signature incompatible with supertype - def __sub__(self: _OS, other: Iterable[object]) -> _OS: ... - def intersection_update(self: _OS, other: Iterable[_T]) -> _OS: ... # type: ignore # signature incompatible with supertype - def __iand__(self: _OS, other: Iterable[object]) -> _OS: ... - # Return type incompatible with supertype - def symmetric_difference_update(self: _OS, other: Iterable[_T]) -> _OS: ... # type: ignore - def __ixor__(self: _OS, other: Iterable[_U]) -> OrderedSet[Union[_T, _U]]: ... - def difference_update(self: _OS, other: Iterable[object]) -> _OS: ... # type: ignore # signature incompatible with supertype - def __isub__(self: _OS, other: Iterable[object]) -> _OS: ... - -class IdentitySet(object): - def __init__(self, iterable: Optional[Any] = ...) -> None: ... - def add(self, value): ... - def __contains__(self, value): ... - def remove(self, value): ... - def discard(self, value): ... - def pop(self): ... - def clear(self): ... - def __cmp__(self, other): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def issubset(self, iterable): ... - def __le__(self, other): ... - def __lt__(self, other): ... - def issuperset(self, iterable): ... - def __ge__(self, other): ... - def __gt__(self, other): ... - def union(self, iterable): ... - def __or__(self, other): ... - def update(self, iterable): ... - def __ior__(self, other): ... - def difference(self, iterable): ... - def __sub__(self, other): ... - def difference_update(self, iterable): ... - def __isub__(self, other): ... - def intersection(self, iterable): ... - def __and__(self, other): ... - def intersection_update(self, iterable): ... - def __iand__(self, other): ... - def symmetric_difference(self, iterable): ... - def __xor__(self, other): ... - def symmetric_difference_update(self, iterable): ... - def __ixor__(self, other): ... - def copy(self): ... - __copy__: Any = ... - def __len__(self): ... - def __iter__(self): ... - def __hash__(self): ... - -class WeakSequence(object): - def __init__(self, __elements: Any = ...) -> None: ... - def append(self, item): ... - def __len__(self): ... - def __iter__(self): ... - def __getitem__(self, index): ... - -class OrderedIdentitySet(IdentitySet): - def __init__(self, iterable: Optional[Any] = ...) -> None: ... - -class PopulateDict(dict): - creator: Any = ... - def __init__(self, creator) -> None: ... - def __missing__(self, key): ... - -column_set = set -column_dict = dict -ordered_column_set = OrderedSet -populate_column_dict = PopulateDict - -def unique_list(seq: Iterable[_T], hashfunc: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ... - -class UniqueAppender(object): - data: Any = ... - def __init__(self, data, via: Optional[Any] = ...) -> None: ... - def append(self, item): ... - def __iter__(self): ... - -def coerce_generator_arg(arg): ... -def to_list(x, default: Optional[Any] = ...): ... -def has_intersection(set_, iterable): ... -def to_set(x): ... -def to_column_set(x): ... -def update_copy(d, _new: Optional[Any] = ..., **kw): ... -def flatten_iterator(x): ... - -class LRUCache(dict): - capacity: Any = ... - threshold: Any = ... - def __init__(self, capacity: int = ..., threshold: float = ...) -> None: ... - def get(self, key, default: Optional[Any] = ...): ... - def __getitem__(self, key): ... - def values(self): ... - def setdefault(self, key, value): ... - def __setitem__(self, key, value): ... - -def lightweight_named_tuple(name, fields): ... - -class ScopedRegistry(object): - createfunc: Any = ... - scopefunc: Any = ... - registry: Any = ... - def __init__(self, createfunc, scopefunc) -> None: ... - def __call__(self): ... - def has(self): ... - def set(self, obj): ... - def clear(self): ... - -class ThreadLocalRegistry(ScopedRegistry): - createfunc: Any = ... - registry: Any = ... - def __init__(self, createfunc) -> None: ... - def __call__(self): ... - def has(self): ... - def set(self, obj): ... - def clear(self): ... diff --git a/sqlalchemy/util/compat.pyi b/sqlalchemy/util/compat.pyi deleted file mode 100644 index bc3b24c5..00000000 --- a/sqlalchemy/util/compat.pyi +++ /dev/null @@ -1,77 +0,0 @@ -import sys -import builtins -from typing import Any, Optional, Text -import threading as threading -from collections import namedtuple as namedtuple -from io import BytesIO -from io import StringIO as StringIO -from inspect import getargspec as inspect_getfullargspec -from operator import attrgetter - -byte_buffer = BytesIO -dottedgetter = attrgetter - -if sys.version_info < (3, 0): - from itertools import izip_longest - zip_longest = izip_longest - import cPickle - pickle = cPickle - from urllib import quote_plus as quote_plus, unquote_plus as unquote_plus, quote as quote, unquote as unquote - from urlparse import parse_qsl as parse_qsl -else: - from itertools import zip_longest as zip_longest - import pickle as pickle - from urllib.parse import (quote_plus as quote_plus, unquote_plus as unquote_plus, - parse_qsl as parse_qsl, quote as quote, unquote as unquote) - -py36: bool = ... -py33: bool = ... -py32: bool = ... -py3k: bool = ... -py2k: bool = ... -py265: bool = ... -jython: bool = ... -pypy: bool = ... -win32: bool = ... -cpython: bool = ... -next = builtins.next -safe_kwarg: Any = ... - -ArgSpec = namedtuple('ArgSpec', ['args', 'varargs', 'keywords', 'defaults']) - -def inspect_getargspec(func): ... - -string_types: Any = ... -binary_types: Any = ... -binary_type: Any = ... -text_type = Text -int_types: Any = ... -iterbytes: Any = ... - -def u(s): ... -def ue(s): ... -def b(s): ... - -callable = builtins.callable - -def cmp(a, b): ... - -print_: Any = ... -import_: Any = ... -itertools_filterfalse: Any = ... -itertools_filter: Any = ... -itertools_imap: Any = ... - -def b64encode(x): ... -def b64decode(x): ... - -reduce: Any = ... -time_func: Any = ... - -def reraise(tp, value, tb: Optional[Any] = ..., cause: Optional[Any] = ...): ... -def raise_from_cause(exception, exc_info: Optional[Any] = ...): ... - -exec_: Any = ... - -def with_metaclass(meta, *bases): ... -def nested(*managers): ... diff --git a/sqlalchemy/util/deprecations.pyi b/sqlalchemy/util/deprecations.pyi deleted file mode 100644 index 93f0173f..00000000 --- a/sqlalchemy/util/deprecations.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from typing import Any, Optional - -def warn_deprecated(msg, stacklevel: int = ...): ... -def warn_pending_deprecation(msg, stacklevel: int = ...): ... -def deprecated(version, message: Optional[Any] = ..., add_deprecation_to_docstring: bool = ...): ... -def pending_deprecation(version, message: Optional[Any] = ..., add_deprecation_to_docstring: bool = ...): ... -def inject_docstring_text(doctext, injecttext, pos): ... diff --git a/sqlalchemy/util/langhelpers.pyi b/sqlalchemy/util/langhelpers.pyi deleted file mode 100644 index c1147bef..00000000 --- a/sqlalchemy/util/langhelpers.pyi +++ /dev/null @@ -1,120 +0,0 @@ -from typing import Any, Optional - -def md5_hex(x): ... - -class safe_reraise(object): - def __enter__(self): ... - def __exit__(self, type_, value, traceback): ... - -def decode_slice(slc): ... -def map_bits(fn, n): ... -def decorator(target): ... -def public_factory(target, location): ... - -class PluginLoader(object): - group: Any = ... - impls: Any = ... - auto_fn: Any = ... - def __init__(self, group, auto_fn: Optional[Any] = ...) -> None: ... - def load(self, name): ... - def register(self, name, modulepath, objname): ... - -def get_cls_kwargs(cls, _set: Optional[Any] = ...): ... -def inspect_func_args(fn): ... -def get_func_kwargs(func): ... -def get_callable_argspec(fn, no_self: bool = ..., _is_init: bool = ...): ... -def format_argspec_plus(fn, grouped: bool = ...): ... -def format_argspec_init(method, grouped: bool = ...): ... -def getargspec_init(method): ... -def unbound_method_to_callable(func_or_cls): ... -def generic_repr(obj, additional_kw: Any = ..., to_inspect: Optional[Any] = ..., omit_kwarg: Any = ...): ... - -class portable_instancemethod(object): - target: Any = ... - name: Any = ... - def __init__(self, meth) -> None: ... - def __call__(self, *arg, **kw): ... - -def class_hierarchy(cls): ... -def iterate_attributes(cls): ... -def monkeypatch_proxied_specials(into_cls, from_cls, skip: Optional[Any] = ..., only: Optional[Any] = ..., name: str = ..., - from_instance: Optional[Any] = ...): ... -def methods_equivalent(meth1, meth2): ... -def as_interface(obj, cls: Optional[Any] = ..., methods: Optional[Any] = ..., required: Optional[Any] = ...): ... - -class memoized_property(object): - fget: Any = ... - __doc__: Any = ... - __name__: Any = ... - def __init__(self, fget, doc: Optional[Any] = ...) -> None: ... - def __get__(self, obj, cls): ... - @classmethod - def reset(cls, obj, name): ... - -def memoized_instancemethod(fn): ... - -class group_expirable_memoized_property(object): - attributes: Any = ... - def __init__(self, attributes: Any = ...) -> None: ... - def expire_instance(self, instance): ... - def __call__(self, fn): ... - def method(self, fn): ... - -class MemoizedSlots(object): - def __getattr__(self, key): ... - -def dependency_for(modulename): ... - -class dependencies(object): - import_deps: Any = ... - def __init__(self, *deps) -> None: ... - def __call__(self, fn): ... - @classmethod - def resolve_all(cls, path): ... - -def asbool(obj): ... -def bool_or_str(*text): ... -def asint(value): ... -def coerce_kw_type(kw, key, type_, flexi_bool: bool = ...): ... -def constructor_copy(obj, cls, *args, **kw): ... -def counter(): ... -def duck_type_collection(specimen, default: Optional[Any] = ...): ... -def assert_arg_type(arg, argtype, name): ... -def dictlike_iteritems(dictlike): ... - -class classproperty(property): - __doc__: str = ... - def __init__(self, fget, *arg, **kw) -> None: ... - def __get__(desc, self, cls): ... - -class hybridproperty(object): - func: Any = ... - def __init__(self, func) -> None: ... - def __get__(self, instance, owner): ... - -class hybridmethod(object): - func: Any = ... - def __init__(self, func) -> None: ... - def __get__(self, instance, owner): ... - -class symbol(object): - symbols: Any = ... - def __new__(cls, name, doc: Optional[Any] = ..., canonical: Optional[Any] = ...): ... - -def set_creation_order(instance): ... -def warn_exception(func, *args, **kwargs): ... -def ellipses_string(value, len_: int = ...): ... - -def warn(msg): ... -def warn_limited(msg, args): ... -def only_once(fn): ... -def chop_traceback(tb, exclude_prefix: Any = ..., exclude_suffix: Any = ...): ... - -NoneType = type(None) - -def attrsetter(attrname): ... - -class EnsureKWArgType(type): - def __init__(cls, clsname, bases, clsdict) -> None: ... - -def wrap_callable(wrapper, fn): ... diff --git a/sqlalchemy/util/queue.pyi b/sqlalchemy/util/queue.pyi deleted file mode 100644 index 867058fa..00000000 --- a/sqlalchemy/util/queue.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from typing import Any, Deque, Optional -import threading - -class Empty(Exception): ... -class Full(Exception): ... - -class Queue(object): - mutex: threading.RLock - not_empty: threading.Condition - not_full: threading.Condition - maxsize: int - queue: Deque[Any] - def __init__(self, maxsize: int = ...) -> None: ... - def qsize(self): ... - def empty(self): ... - def full(self): ... - def put(self, item, block: bool = ..., timeout: Optional[Any] = ...): ... - def put_nowait(self, item): ... - def get(self, block: bool = ..., timeout: Optional[Any] = ...): ... - def get_nowait(self): ... diff --git a/sqlalchemy/util/topological.pyi b/sqlalchemy/util/topological.pyi deleted file mode 100644 index b281a442..00000000 --- a/sqlalchemy/util/topological.pyi +++ /dev/null @@ -1,3 +0,0 @@ -def sort_as_subsets(tuples, allitems, deterministic_order: bool = ...): ... -def sort(tuples, allitems, deterministic_order: bool = ...): ... -def find_cycles(tuples, allitems): ... diff --git a/utils/build_bundle/build.sh b/utils/build_bundle/build.sh index 48694645..5f0fcbd5 100755 --- a/utils/build_bundle/build.sh +++ b/utils/build_bundle/build.sh @@ -8,7 +8,7 @@ mkdir -p stubs # Copy over the stubs from here -for d in cv2-stubs gym-stubs matplotlib openpyxl scipy-stubs sklearn-stubs sqlalchemy transformers-stubs +for d in cv2-stubs gym-stubs matplotlib openpyxl scipy-stubs sklearn-stubs transformers-stubs do cp -R ../../$d stubs done