# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
"""
This file contains the exact signatures for all functions in module
PySide6.QtSql, except for defaults which are replaced by "...".
"""

# mypy: disable-error-code="override, overload-overlap"
# Module `PySide6.QtSql`

import PySide6.QtSql
import PySide6.QtCore
import PySide6.QtWidgets

import enum
import typing
from PySide6.QtCore import Signal
from shiboken6 import Shiboken


class QIntList: ...


class QSql(Shiboken.Object):

    class Location(enum.Enum):

        AfterLastRow              = -2
        BeforeFirstRow            = -1

    class NumericalPrecisionPolicy(enum.Enum):

        HighPrecision             = 0x0
        LowPrecisionInt32         = 0x1
        LowPrecisionInt64         = 0x2
        LowPrecisionDouble        = 0x4

    class ParamTypeFlag(enum.Flag):

        In                        = 0x1
        Out                       = 0x2
        InOut                     = 0x3
        Binary                    = 0x4

    class TableType(enum.Enum):

        Tables                    = 0x1
        SystemTables              = 0x2
        Views                     = 0x4
        AllTables                 = 0xff


class QSqlDatabase(Shiboken.Object): ...
    def __repr__(self, /) -> str: ...


class QSqlDriver(PySide6.QtCore.QObject):

    notification             : typing.ClassVar[Signal] = ... # notification(QString,QSqlDriver::NotificationSource,QVariant)

    class DbmsType(enum.Enum):

        UnknownDbms               = 0x0
        MSSqlServer               = 0x1
        MySqlServer               = 0x2
        PostgreSQL                = 0x3
        Oracle                    = 0x4
        Sybase                    = 0x5
        SQLite                    = 0x6
        Interbase                 = 0x7
        DB2                       = 0x8
        MimerSQL                  = 0x9

    class DriverFeature(enum.Enum):

        Transactions              = 0x0
        QuerySize                 = 0x1
        BLOB                      = 0x2
        Unicode                   = 0x3
        PreparedQueries           = 0x4
        NamedPlaceholders         = 0x5
        PositionalPlaceholders    = 0x6
        LastInsertId              = 0x7
        BatchOperations           = 0x8
        SimpleLocking             = 0x9
        LowPrecisionNumbers       = 0xa
        EventNotifications        = 0xb
        FinishQuery               = 0xc
        MultipleResultSets        = 0xd
        CancelQuery               = 0xe

    class IdentifierType(enum.Enum):

        FieldName                 = 0x0
        TableName                 = 0x1

    class NotificationSource(enum.Enum):

        UnknownSource             = 0x0
        SelfSource                = 0x1
        OtherSource               = 0x2

    class StatementType(enum.Enum):

        WhereStatement            = 0x0
        SelectStatement           = 0x1
        UpdateStatement           = 0x2
        InsertStatement           = 0x3
        DeleteStatement           = 0x4


class QSqlDriverCreatorBase(Shiboken.Object): ...


class QSqlError(Shiboken.Object):

    class ErrorType(enum.Enum):

        NoError                   = 0x0
        ConnectionError           = 0x1
        StatementError            = 0x2
        TransactionError          = 0x3
        UnknownError              = 0x4


    def __repr__(self, /) -> str: ...


class QSqlField(Shiboken.Object):

    class RequiredStatus(enum.Enum):

        Unknown                   = -1
        Optional                  = 0x0
        Required                  = 0x1


    def __repr__(self, /) -> str: ...


class QSqlIndex(PySide6.QtSql.QSqlRecord): ...


class QSqlQuery(Shiboken.Object):

    class BatchExecutionMode(enum.Enum):

        ValuesAsRows              = 0x0
        ValuesAsColumns           = 0x1


class QSqlQueryModel(PySide6.QtCore.QAbstractTableModel): ...


class QSqlRecord(Shiboken.Object): ...
    def __repr__(self, /) -> str: ...


class QSqlRelation(Shiboken.Object): ...


class QSqlRelationalDelegate(PySide6.QtWidgets.QStyledItemDelegate): ...


class QSqlRelationalTableModel(PySide6.QtSql.QSqlTableModel):

    class JoinMode(enum.Enum):

        InnerJoin                 = 0x0
        LeftJoin                  = 0x1


class QSqlResult(Shiboken.Object):

    class BindingSyntax(enum.Enum):

        PositionalBinding         = 0x0
        NamedBinding              = 0x1

    class VirtualHookOperation(enum.Enum): ...  # type: ignore[misc]


class QSqlTableModel(PySide6.QtSql.QSqlQueryModel):

    beforeDelete             : typing.ClassVar[Signal] = ... # beforeDelete(int)
    beforeInsert             : typing.ClassVar[Signal] = ... # beforeInsert(QSqlRecord&)
    beforeUpdate             : typing.ClassVar[Signal] = ... # beforeUpdate(int,QSqlRecord&)
    primeInsert              : typing.ClassVar[Signal] = ... # primeInsert(int,QSqlRecord&)

    class EditStrategy(enum.Enum):

        OnFieldChange             = 0x0
        OnRowChange               = 0x1
        OnManualSubmit            = 0x2


# eof
