@@ -348,7 +348,7 @@ class Value(ColumnBase):
348348class ValueLiterals (WrappedNode ):
349349 def __sql__ (self , ctx ): ...
350350
351- def AsIs (value ) : ...
351+ def AsIs (value , converter = None ) -> Value : ...
352352
353353class Cast (WrappedNode ):
354354 def __init__ (self , node , cast ) -> None : ...
@@ -668,30 +668,17 @@ class Delete(_WriteQuery):
668668
669669class Index (Node ):
670670 def __init__ (
671- self ,
672- name ,
673- table ,
674- expressions ,
675- unique : bool = ...,
676- safe : bool = ...,
677- where : Incomplete | None = ...,
678- using : Incomplete | None = ...,
671+ self , name , table , expressions , unique : bool = False , safe : bool = False , where = None , using = None , nulls_distinct = None
679672 ) -> None : ...
680- def safe (self , _safe : bool = ... ) -> Self : ...
673+ def safe (self , _safe : bool = True ) -> Self : ...
681674 def where (self , * expressions ) -> Self : ...
682- def using (self , _using : Incomplete | None = ...) -> Self : ...
675+ def using (self , _using = None ) -> Self : ...
676+ def nulls_distinct (self , nulls_distinct = None ) -> Self : ...
683677 def __sql__ (self , ctx ): ...
684678
685679class ModelIndex (Index ):
686680 def __init__ (
687- self ,
688- model ,
689- fields ,
690- unique : bool = ...,
691- safe : bool = ...,
692- where : Incomplete | None = ...,
693- using : Incomplete | None = ...,
694- name : Incomplete | None = ...,
681+ self , model , fields , unique : bool = False , safe : bool = True , where = None , using = None , name = None , nulls_distinct = None
695682 ) -> None : ...
696683
697684class PeeweeException (Exception ):
@@ -792,10 +779,10 @@ class Database(_callable_context_manager):
792779 database ,
793780 thread_safe : bool = ...,
794781 autorollback : bool = ...,
795- field_types : Incomplete | None = ... ,
796- operations : Incomplete | None = ... ,
797- autocommit : Incomplete | None = ... ,
798- autoconnect : bool = ... ,
782+ field_types = None ,
783+ operations = None ,
784+ autocommit = None ,
785+ autoconnect : bool = True ,
799786 ** kwargs ,
800787 ) -> None : ...
801788 database : Incomplete
@@ -811,14 +798,14 @@ class Database(_callable_context_manager):
811798 def is_closed (self ) -> bool : ...
812799 def is_connection_usable (self ) -> bool : ...
813800 def connection (self ): ...
814- def cursor (self , commit = None , named_cursor = None ): ...
815- def execute_sql (self , sql , params : Incomplete | None = ..., commit = ... ): ...
816- def execute (self , query , commit = ..., ** context_options ): ...
801+ def cursor (self , named_cursor = None ): ...
802+ def execute_sql (self , sql , params = None ): ...
803+ def execute (self , query , ** context_options ): ...
817804 def get_context_options (self ): ...
818805 def get_sql_context (self , ** context_options ): ...
819- def conflict_statement (self , on_conflict , query ) -> None : ...
820- def conflict_update (self , on_conflict , query ) -> None : ...
821- def last_insert_id (self , cursor , query_type : Incomplete | None = ... ): ...
806+ def conflict_statement (self , on_conflict , query ): ...
807+ def conflict_update (self , on_conflict , query ): ...
808+ def last_insert_id (self , cursor , query_type = None ): ...
822809 def rows_affected (self , cursor ): ...
823810 def default_values_insert (self , ctx ): ...
824811 def session_start (self ): ...
@@ -843,13 +830,13 @@ class Database(_callable_context_manager):
843830 def get_columns (self , table , schema : str | None = None ) -> list [ColumnMetadata ]: ...
844831 def get_primary_keys (self , table , schema : str | None = None ) -> None : ...
845832 def get_foreign_keys (self , table , schema : str | None = None ) -> list [ForeignKeyMetadata ]: ...
846- def sequence_exists (self , seq ) -> None : ...
833+ def sequence_exists (self , seq ) -> bool : ...
847834 def create_tables (self , models : Iterable [type [Model ]], ** options ) -> None : ...
848835 def drop_tables (self , models : Iterable [type [Model ]], ** kwargs ) -> None : ...
849- def extract_date (self , date_part , date_field ) -> None : ...
850- def truncate_date (self , date_part , date_field ) -> None : ...
851- def to_timestamp (self , date_field ) -> None : ...
852- def from_timestamp (self , date_field ) -> None : ...
836+ def extract_date (self , date_part , date_field ): ...
837+ def truncate_date (self , date_part , date_field ): ...
838+ def to_timestamp (self , date_field ): ...
839+ def from_timestamp (self , date_field ): ...
853840 def random (self ): ...
854841 def bind (self , models : Iterable [type [Model ]], bind_refs : bool = ..., bind_backrefs : bool = ...) -> None : ...
855842 def bind_ctx (self , models : Iterable [type [Model ]], bind_refs : bool = ..., bind_backrefs : bool = ...): ...
@@ -864,8 +851,8 @@ class SqliteDatabase(Database):
864851 limit_max : int
865852 server_version : Incomplete
866853 truncate_table : bool
867- nulls_ordering : Incomplete
868- def __init__ (self , database , * args , ** kwargs ) -> None : ...
854+ nulls_ordering : bool
855+ def __init__ (self , database , regexp_function : bool = False , * args , ** kwargs ) -> None : ...
869856 returning_clause : Incomplete
870857 def init (
871858 self , database , pragmas : Incomplete | None = ..., timeout : int = ..., returning_clause : Incomplete | None = ..., ** kwargs
@@ -895,13 +882,10 @@ class SqliteDatabase(Database):
895882 def func (self , name : str | None = None , num_params : int = - 1 , deterministic : bool | None = None ) -> Callable [[_F ], _F ]: ...
896883 def register_window_function (self , klass , name : Incomplete | None = ..., num_params : int = ...) -> None : ...
897884 def window_function (self , name : Incomplete | None = ..., num_params : int = ...): ...
898- def register_table_function (self , klass , name : Incomplete | None = ...) -> None : ...
899- def table_function (self , name : Incomplete | None = ...): ...
900885 def unregister_aggregate (self , name ) -> None : ...
901886 def unregister_collation (self , name ) -> None : ...
902887 def unregister_function (self , name ) -> None : ...
903888 def unregister_window_function (self , name ) -> None : ...
904- def unregister_table_function (self , name ): ...
905889 def load_extension (self , extension ) -> None : ...
906890 def unload_extension (self , extension ) -> None : ...
907891 def attach (self , filename , name ): ...
@@ -923,6 +907,34 @@ class SqliteDatabase(Database):
923907 def to_timestamp (self , date_field ): ...
924908 def from_timestamp (self , date_field ): ...
925909
910+ class Psycopg2Adapter :
911+ json_type : Incomplete
912+ jsonb_type : Incomplete
913+ cast_json_case : bool
914+ def __init__ (self ) -> None : ...
915+ def check_driver (self ) -> None : ...
916+ def get_binary_type (self ) -> type [Incomplete ]: ...
917+ def connect (self , db , ** params ): ...
918+ def get_server_version (self , conn ): ...
919+ def is_connection_usable (self , conn ) -> bool : ...
920+ def is_connection_reusable (self , conn ) -> bool : ...
921+ def is_connection_closed (self , conn ) -> bool : ...
922+ def extract_date (self , date_part , date_field ) -> Function : ...
923+
924+ class Psycopg3Adapter :
925+ json_type : Incomplete
926+ jsonb_type : Incomplete
927+ cast_json_case : bool
928+ def __init__ (self ): ...
929+ def check_driver (self ) -> None : ...
930+ def get_binary_type (self ) -> type [Incomplete ]: ...
931+ def connect (self , db , ** params ): ...
932+ def get_server_version (self , conn ): ...
933+ def is_connection_usable (self , conn ) -> bool : ...
934+ def is_connection_reusable (self , conn ) -> bool : ...
935+ def is_connection_closed (self , conn ) -> bool : ...
936+ def extract_date (self , date_part , date_field ) -> Function : ...
937+
926938class PostgresqlDatabase (Database ):
927939 field_types : Incomplete
928940 operations : Incomplete
@@ -934,12 +946,16 @@ class PostgresqlDatabase(Database):
934946 returning_clause : bool
935947 safe_create_index : bool
936948 sequences : bool
949+ psycopg2_adapter : Incomplete
950+ psycopg3_adapter : Incomplete
937951 def init (
938952 self ,
939953 database ,
940954 register_unicode : bool = ...,
941955 encoding : Incomplete | None = ...,
942956 isolation_level : Incomplete | None = ...,
957+ * ,
958+ prefer_psycopg3 : bool = False ,
943959 ** kwargs ,
944960 ) -> None : ...
945961 def is_connection_usable (self ) -> bool : ...
@@ -952,14 +968,14 @@ class PostgresqlDatabase(Database):
952968 def get_columns (self , table , schema : str | None = None ) -> list [ColumnMetadata ]: ...
953969 def get_primary_keys (self , table , schema : str | None = None ): ...
954970 def get_foreign_keys (self , table , schema : str | None = None ) -> list [ForeignKeyMetadata ]: ...
955- def sequence_exists (self , sequence ): ...
956- def get_binary_type (self ): ...
971+ def sequence_exists (self , sequence ) -> bool : ...
972+ def get_binary_type (self ) -> type [ Incomplete ] : ...
957973 def conflict_statement (self , on_conflict , query ) -> None : ...
958- def conflict_update (self , oc , query ): ...
959- def extract_date (self , date_part , date_field ): ...
960- def truncate_date (self , date_part , date_field ): ...
961- def to_timestamp (self , date_field ): ...
962- def from_timestamp (self , date_field ): ...
974+ def conflict_update (self , oc , query ) -> NodeList : ...
975+ def extract_date (self , date_part , date_field ) -> Function : ...
976+ def truncate_date (self , date_part , date_field ) -> Function : ...
977+ def to_timestamp (self , date_field ) -> Function : ...
978+ def from_timestamp (self , date_field ) -> Function : ...
963979 def get_noop_select (self , ctx ): ...
964980 def set_time_zone (self , timezone ) -> None : ...
965981
@@ -1147,7 +1163,7 @@ class Field(ColumnBase):
11471163 def adapt (self , value ): ...
11481164 def db_value (self , value ): ...
11491165 def python_value (self , value ): ...
1150- def to_value (self , value ): ...
1166+ def to_value (self , value , case : bool = False ): ...
11511167 def get_sort_key (self , ctx ): ...
11521168 def __sql__ (self , ctx ): ...
11531169 def get_modifiers (self ) -> None : ...
@@ -1212,8 +1228,10 @@ class FixedCharField(CharField):
12121228
12131229class TextField (_StringField ): ...
12141230
1215- class BlobField (Field ):
1216- def bind (self , model , name , set_attribute : bool = ...): ...
1231+ class FieldDatabaseHook :
1232+ def bind (self , model , name , set_attribute : bool = True ): ...
1233+
1234+ class BlobField (FieldDatabaseHook , Field ):
12171235 def db_value (self , value ): ...
12181236
12191237class BitField (BitwiseMixin , BigIntegerField ):
@@ -1654,6 +1672,8 @@ class Model(metaclass=ModelBase):
16541672 def is_dirty (self ) -> bool : ...
16551673 @property
16561674 def dirty_fields (self ): ...
1675+ @property
1676+ def dirty_field_names (self ) -> list [Incomplete ]: ...
16571677 def dependencies (
16581678 self , search_nullable : bool = True , exclude_null_children : bool = False
16591679 ) -> Generator [Incomplete , None , None ]: ...
0 commit comments