@@ -573,6 +573,38 @@ Module constants
573
573
package, a third-party library which used to upstream changes to
574
574
:mod: `!sqlite3 `. Today, it carries no meaning or practical value.
575
575
576
+ .. _sqlite3-dbconfig-constants :
577
+
578
+ .. data :: SQLITE_DBCONFIG_DEFENSIVE
579
+ SQLITE_DBCONFIG_DQS_DDL
580
+ SQLITE_DBCONFIG_DQS_DML
581
+ SQLITE_DBCONFIG_ENABLE_FKEY
582
+ SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
583
+ SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
584
+ SQLITE_DBCONFIG_ENABLE_QPSG
585
+ SQLITE_DBCONFIG_ENABLE_TRIGGER
586
+ SQLITE_DBCONFIG_ENABLE_VIEW
587
+ SQLITE_DBCONFIG_LEGACY_ALTER_TABLE
588
+ SQLITE_DBCONFIG_LEGACY_FILE_FORMAT
589
+ SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
590
+ SQLITE_DBCONFIG_RESET_DATABASE
591
+ SQLITE_DBCONFIG_TRIGGER_EQP
592
+ SQLITE_DBCONFIG_TRUSTED_SCHEMA
593
+ SQLITE_DBCONFIG_WRITABLE_SCHEMA
594
+
595
+ These constants are used for the :meth: `Connection.setconfig `
596
+ and :meth: `~Connection.getconfig ` methods.
597
+
598
+ The availability of these constants varies depending on the version of SQLite
599
+ Python was compiled with.
600
+
601
+ .. versionadded :: 3.12
602
+
603
+ .. seealso ::
604
+
605
+ https://www.sqlite.org/c3ref/c_dbconfig_defensive.html
606
+ SQLite docs: Database Connection Configuration Options
607
+
576
608
577
609
.. _sqlite3-connection-objects :
578
610
@@ -1041,19 +1073,37 @@ Connection objects
1041
1073
(2, 'broccoli pie', 'broccoli cheese onions flour')
1042
1074
(3, 'pumpkin pie', 'pumpkin sugar flour butter')
1043
1075
1044
- .. method :: load_extension(path, /)
1076
+ .. method :: load_extension(path, /, *, entrypoint=None )
1045
1077
1046
- Load an SQLite extension from a shared library located at * path * .
1078
+ Load an SQLite extension from a shared library.
1047
1079
Enable extension loading with :meth: `enable_load_extension ` before
1048
1080
calling this method.
1049
1081
1082
+ :param str path:
1083
+
1084
+ The path to the SQLite extension.
1085
+
1086
+ :param entrypoint:
1087
+
1088
+ Entry point name.
1089
+ If ``None `` (the default),
1090
+ SQLite will come up with an entry point name of its own;
1091
+ see the SQLite docs `Loading an Extension `_ for details.
1092
+
1093
+ :type entrypoint: str | None
1094
+
1050
1095
.. audit-event :: sqlite3.load_extension connection,path sqlite3.Connection.load_extension
1051
1096
1052
1097
.. versionadded :: 3.2
1053
1098
1054
1099
.. versionchanged :: 3.10
1055
1100
Added the ``sqlite3.load_extension `` auditing event.
1056
1101
1102
+ .. versionadded :: 3.12
1103
+ The *entrypoint * parameter.
1104
+
1105
+ .. _Loading an Extension : https://www.sqlite.org/loadext.html#loading_an_extension_
1106
+
1057
1107
.. method :: iterdump
1058
1108
1059
1109
Return an :term: `iterator ` to dump the database as SQL source code.
@@ -1201,6 +1251,30 @@ Connection objects
1201
1251
.. _SQLite limit category : https://www.sqlite.org/c3ref/c_limit_attached.html
1202
1252
1203
1253
1254
+ .. method :: getconfig(op, /)
1255
+
1256
+ Query a boolean connection configuration option.
1257
+
1258
+ :param int op:
1259
+ A :ref: `SQLITE_DBCONFIG code <sqlite3-dbconfig-constants >`.
1260
+
1261
+ :rtype: bool
1262
+
1263
+ .. versionadded :: 3.12
1264
+
1265
+ .. method :: setconfig(op, enable=True, /)
1266
+
1267
+ Set a boolean connection configuration option.
1268
+
1269
+ :param int op:
1270
+ A :ref: `SQLITE_DBCONFIG code <sqlite3-dbconfig-constants >`.
1271
+
1272
+ :param bool enable:
1273
+ ``True `` if the configuration option should be enabled (default);
1274
+ ``False `` if it should be disabled.
1275
+
1276
+ .. versionadded :: 3.12
1277
+
1204
1278
.. method :: serialize(*, name="main")
1205
1279
1206
1280
Serialize a database into a :class: `bytes ` object. For an
0 commit comments