Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 76 additions & 81 deletions third_party/2and3/pymysql/connections.pyi
Original file line number Diff line number Diff line change
@@ -1,97 +1,63 @@
from typing import Any, Optional, Type
from socket import SocketType
from typing import Any, AnyStr, Mapping, Optional, Tuple, Type

from .charset import MBLENGTH as MBLENGTH, charset_by_id as charset_by_id, charset_by_name as charset_by_name
from .constants import (
CLIENT as CLIENT,
COMMAND as COMMAND,
FIELD_TYPE as FIELD_TYPE,
FLAG as FLAG,
SERVER_STATUS as SERVER_STATUS,
)
from .converters import decoders as decoders, encoders as encoders, escape_item as escape_item
from .cursors import Cursor as Cursor
from .err import (
DatabaseError as DatabaseError,
DataError as DataError,
Error as Error,
IntegrityError as IntegrityError,
InterfaceError as InterfaceError,
InternalError as InternalError,
NotSupportedError as NotSupportedError,
OperationalError as OperationalError,
ProgrammingError as ProgrammingError,
Warning as Warning,
raise_mysql_exception as raise_mysql_exception,
)
from .util import byte2int as byte2int, int2byte as int2byte, join_bytes as join_bytes
from .charset import charset_by_id as charset_by_id, charset_by_name as charset_by_name
from .constants import CLIENT as CLIENT, COMMAND as COMMAND, FIELD_TYPE as FIELD_TYPE, SERVER_STATUS as SERVER_STATUS
from .cursors import Cursor
from .util import byte2int as byte2int, int2byte as int2byte

sha_new: Any
SSL_ENABLED: Any
DEFAULT_USER: Any
DEBUG: Any
NULL_COLUMN: Any
UNSIGNED_CHAR_COLUMN: Any
UNSIGNED_SHORT_COLUMN: Any
UNSIGNED_INT24_COLUMN: Any
UNSIGNED_INT64_COLUMN: Any
UNSIGNED_CHAR_LENGTH: Any
UNSIGNED_SHORT_LENGTH: Any
UNSIGNED_INT24_LENGTH: Any
UNSIGNED_INT64_LENGTH: Any
DEFAULT_CHARSET: Any

def dump_packet(data): ...

SCRAMBLE_LENGTH_323: Any

class RandStruct_323:
max_value: Any
seed1: Any
seed2: Any
def __init__(self, seed1, seed2): ...
def my_rnd(self): ...

def pack_int24(n): ...
def unpack_uint16(n): ...
def unpack_int24(n): ...
def unpack_int32(n): ...
def unpack_int64(n): ...
def defaulterrorhandler(connection, cursor, errorclass, errorvalue): ...
def lenenc_int(i: int) -> bytes: ...

class MysqlPacket:
connection: Any
def __init__(self, connection): ...
def packet_number(self): ...
def __init__(self, data, encoding): ...
def get_all_data(self): ...
def read(self, size): ...
def read_all(self): ...
def advance(self, length): ...
def rewind(self, position: int = ...): ...
def peek(self, size): ...
def get_bytes(self, position, length: int = ...): ...
def read_length_coded_binary(self): ...
def read_length_coded_string(self): ...
def is_ok_packet(self): ...
def is_eof_packet(self): ...
def is_resultset_packet(self): ...
def is_error_packet(self): ...
def read_string(self) -> bytes: ...
def read_uint8(self) -> Any: ...
def read_uint16(self) -> Any: ...
def read_uint24(self) -> Any: ...
def read_uint32(self) -> Any: ...
def read_uint64(self) -> Any: ...
def read_length_encoded_integer(self) -> int: ...
def read_length_coded_string(self) -> bytes: ...
def read_struct(self, fmt: str) -> Tuple[Any, ...]: ...
def is_ok_packet(self) -> bool: ...
def is_eof_packet(self) -> bool: ...
def is_auth_switch_request(self) -> bool: ...
def is_extra_auth_data(self) -> bool: ...
def is_resultset_packet(self) -> bool: ...
def is_load_local_packet(self) -> bool: ...
def is_error_packet(self) -> bool: ...
def check_error(self): ...
def raise_for_error(self) -> None: ...
def dump(self): ...

class FieldDescriptorPacket(MysqlPacket):
def __init__(self, *args): ...
def __init__(self, data, encoding): ...
def description(self): ...
def get_column_length(self): ...

class Connection:
errorhandler: Any
ssl: Any
host: Any
port: Any
user: Any
password: Any
db: Any
unix_socket: Any
bind_address: Any
charset: Any
use_unicode: Any
client_flag: Any
Expand All @@ -101,48 +67,70 @@ class Connection:
encoders: Any
decoders: Any
host_info: Any
sql_mode: Any
init_command: Any
max_allowed_packet: int
server_public_key: bytes
def __init__(
self,
host: str = ...,
host: Optional[str] = ...,
user: Optional[Any] = ...,
passwd: str = ...,
db: Optional[Any] = ...,
password: str = ...,
database: Optional[Any] = ...,
port: int = ...,
unix_socket: Optional[Any] = ...,
charset: str = ...,
sql_mode: Optional[Any] = ...,
read_default_file: Optional[Any] = ...,
conv=...,
use_unicode: Optional[Any] = ...,
use_unicode: Optional[bool] = ...,
client_flag: int = ...,
cursorclass=...,
cursorclass: Optional[Type[Cursor]] = ...,
init_command: Optional[Any] = ...,
connect_timeout: Optional[Any] = ...,
ssl: Optional[Any] = ...,
connect_timeout: Optional[int] = ...,
ssl: Optional[Mapping] = ...,
read_default_group: Optional[Any] = ...,
compress: Optional[Any] = ...,
named_pipe: Optional[Any] = ...,
autocommit: Optional[bool] = ...,
db: Optional[Any] = ...,
passwd: Optional[Any] = ...,
local_infile: Optional[Any] = ...,
max_allowed_packet: int = ...,
defer_connect: Optional[bool] = ...,
auth_plugin_map: Optional[Mapping] = ...,
read_timeout: Optional[float] = ...,
write_timeout: Optional[float] = ...,
bind_address: Optional[Any] = ...,
binary_prefix: Optional[bool] = ...,
program_name: Optional[Any] = ...,
server_public_key: Optional[bytes] = ...,
): ...
socket: Any
rfile: Any
wfile: Any
def close(self) -> None: ...
def autocommit(self, value): ...
def commit(self): ...
@property
def open(self) -> bool: ...
def autocommit(self, value) -> None: ...
def get_autocommit(self) -> bool: ...
def commit(self) -> None: ...
def begin(self) -> None: ...
def rollback(self): ...
def escape(self, obj): ...
def rollback(self) -> None: ...
def select_db(self, db) -> None: ...
def escape(self, obj, mapping: Optional[Mapping] = ...): ...
def literal(self, obj): ...
def escape_string(self, s: AnyStr) -> AnyStr: ...
def cursor(self, cursor: Optional[Type[Cursor]] = ...) -> Cursor: ...
def __enter__(self): ...
def __exit__(self, exc, value, traceback): ...
def query(self, sql): ...
def next_result(self, unbuffered: bool = ...): ...
def query(self, sql, unbuffered: bool = ...) -> int: ...
def next_result(self, unbuffered: bool = ...) -> int: ...
def affected_rows(self): ...
def kill(self, thread_id): ...
def ping(self, reconnect: bool = ...): ...
def set_charset(self, charset): ...
def read_packet(self, packet_type=...): ...
def ping(self, reconnect: bool = ...) -> None: ...
def set_charset(self, charset) -> None: ...
def connect(self, sock: Optional[SocketType] = ...) -> None: ...
def write_packet(self, payload) -> None: ...
def _read_packet(self, packet_type=...): ...
def insert_id(self): ...
def thread_id(self): ...
def character_set_name(self): ...
Expand Down Expand Up @@ -172,6 +160,13 @@ class MySQLResult:
description: Any
rows: Any
has_next: Any
def __init__(self, connection): ...
def __init__(self, connection: Connection) -> None: ...
first_packet: Any
def read(self): ...
def read(self) -> None: ...
def init_unbuffered_query(self) -> None: ...

class LoadLocalFile:
filename: Any
connection: Connection
def __init__(self, filename: Any, connection: Connection) -> None: ...
def send_data(self) -> None: ...