@@ -267,15 +267,14 @@ Module functions and constants
267
267
in RAM instead of on disk.
268
268
:type database: :term: `path-like object `
269
269
270
- :param timeout:
270
+ :param float timeout:
271
271
How many seconds the connection should wait before raising
272
272
an exception, if the database is locked by another connection.
273
273
If another connection opens a transaction to modify the database,
274
274
it will be locked until that transaction is committed.
275
275
Default five seconds.
276
- :type timeout: float
277
276
278
- :param detect_types:
277
+ :param int detect_types:
279
278
Control whether and how data types not
280
279
:ref: `natively supported by SQLite <sqlite3-types >`
281
280
are looked up to be converted to Python types,
@@ -288,7 +287,6 @@ Module functions and constants
288
287
even when the *detect_types * parameter is set; :class: `str ` will be
289
288
returned instead.
290
289
By default (``0 ``), type detection is disabled.
291
- :type detect_types: int
292
290
293
291
:param isolation_level:
294
292
The :attr: `~Connection.isolation_level ` of the connection,
@@ -298,33 +296,29 @@ Module functions and constants
298
296
See :ref: `sqlite3-controlling-transactions ` for more.
299
297
:type isolation_level: str | None
300
298
301
- :param check_same_thread:
299
+ :param bool check_same_thread:
302
300
If ``True `` (default), only the creating thread may use the connection.
303
301
If ``False ``, the connection may be shared across multiple threads;
304
302
if so, write operations should be serialized by the user to avoid data
305
303
corruption.
306
- :type check_same_thread: bool
307
304
308
- :param factory:
305
+ :param Connection factory:
309
306
A custom subclass of :class: `Connection ` to create the connection with,
310
307
if not the default :class: `Connection ` class.
311
- :type factory: :class: `Connection `
312
308
313
- :param cached_statements:
309
+ :param int cached_statements:
314
310
The number of statements that ``sqlite3 ``
315
311
should internally cache for this connection, to avoid parsing overhead.
316
312
By default, 100 statements.
317
- :type cached_statements: int
318
313
319
- :param uri:
314
+ :param bool uri:
320
315
If set to ``True ``, *database * is interpreted as a
321
316
:abbr: `URI ( Uniform Resource Identifier ) ` with a file path
322
317
and an optional query string.
323
318
The scheme part *must * be ``"file:" ``,
324
319
and the path can be relative or absolute.
325
320
The query string allows passing parameters to SQLite,
326
321
enabling various :ref: `sqlite3-uri-tricks `.
327
- :type uri: bool
328
322
329
323
:rtype: Connection
330
324
@@ -475,14 +469,12 @@ Connection objects
475
469
476
470
Create or remove a user-defined SQL function.
477
471
478
- :param name:
472
+ :param str name:
479
473
The name of the SQL function.
480
- :type name: str
481
474
482
- :param narg:
475
+ :param int narg:
483
476
The number of arguments the SQL function can accept.
484
477
If ``-1 ``, it may take any number of arguments.
485
- :type narg: int
486
478
487
479
:param func:
488
480
A callable that is called when the SQL function is invoked.
@@ -491,11 +483,10 @@ Connection objects
491
483
Set to ``None `` to remove an existing SQL function.
492
484
:type func: :term: `callback ` | None
493
485
494
- :param deterministic:
486
+ :param bool deterministic:
495
487
If ``True ``, the created SQL function is marked as
496
488
`deterministic <https://sqlite.org/deterministic.html >`_,
497
489
which allows SQLite to perform additional optimizations.
498
- :type deterministic: bool
499
490
500
491
:raises NotSupportedError:
501
492
If *deterministic * is used with SQLite versions older than 3.8.3.
@@ -512,14 +503,12 @@ Connection objects
512
503
513
504
Create or remove a user-defined SQL aggregate function.
514
505
515
- :param name:
506
+ :param str name:
516
507
The name of the SQL aggregate function.
517
- :type name: str
518
508
519
- :param n_arg:
509
+ :param int n_arg:
520
510
The number of arguments the SQL aggregate function can accept.
521
511
If ``-1 ``, it may take any number of arguments.
522
- :type n_arg: int
523
512
524
513
:param aggregate_class:
525
514
A class must implement the following methods:
@@ -727,16 +716,14 @@ Connection objects
727
716
Works even if the database is being accessed by other clients
728
717
or concurrently by the same connection.
729
718
730
- :param target:
719
+ :param Connection target:
731
720
The database connection to save the backup to.
732
- :type target: Connection
733
721
734
- :param pages:
722
+ :param int pages:
735
723
The number of pages to copy at a time.
736
724
If equal to or less than ``0 ``,
737
725
the entire database is copied in a single step.
738
726
Defaults to ``-1 ``.
739
- :type pages: int
740
727
741
728
:param progress:
742
729
If set to a callable, it is invoked with three integer arguments for
@@ -747,18 +734,16 @@ Connection objects
747
734
Defaults to ``None ``.
748
735
:type progress: :term: `callback ` | None
749
736
750
- :param name:
737
+ :param str name:
751
738
The name of the database to back up.
752
739
Either ``"main" `` (the default) for the main database,
753
740
``"temp" `` for the temporary database,
754
741
or the name of a custom database as attached using the
755
742
``ATTACH DATABASE `` SQL statement.
756
- :type name: str
757
743
758
- :param sleep:
744
+ :param float sleep:
759
745
The number of seconds to sleep between successive attempts
760
746
to back up remaining pages.
761
- :type sleep: float
762
747
763
748
Example 1, copy an existing database into another::
764
749
@@ -872,13 +857,13 @@ Cursor objects
872
857
873
858
.. method :: fetchone()
874
859
875
- Fetch the next row of a query result set as a :class: `tuple `.
860
+ Return the next row of a query result set as a :class: `tuple `.
876
861
Return ``None `` if no more data is available.
877
862
878
863
879
864
.. method :: fetchmany(size=cursor.arraysize)
880
865
881
- Fetch the next set of rows of a query result as a :class: `list `.
866
+ Return the next set of rows of a query result as a :class: `list `.
882
867
Return an empty list if no more rows are available.
883
868
884
869
The number of rows to fetch per call is specified by the *size * parameter.
@@ -894,7 +879,7 @@ Cursor objects
894
879
895
880
.. method :: fetchall()
896
881
897
- Fetch all (remaining) rows of a query result as a :class: `list `.
882
+ Return all (remaining) rows of a query result as a :class: `list `.
898
883
Return an empty list if no rows are available.
899
884
Note that the :attr: `arraysize ` attribute can affect the performance of
900
885
this operation.
0 commit comments