From 1650e502b15a4875470b9c9ff61fef8273e3ca23 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 26 Jul 2022 00:19:19 +0000 Subject: [PATCH 1/6] sync with cpython 0418d9f2 --- library/sqlite3.po | 320 +++++++++++++++++++++++---------------------- 1 file changed, 161 insertions(+), 159 deletions(-) diff --git a/library/sqlite3.po b/library/sqlite3.po index 26ee869167..d5a26312a1 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-23 00:17+0000\n" +"POT-Creation-Date: 2022-07-26 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -472,7 +472,7 @@ msgid "The *deterministic* parameter was added." msgstr "新增 *deterministic* 參數。" #: ../../library/sqlite3.rst:442 ../../library/sqlite3.rst:459 -#: ../../library/sqlite3.rst:588 ../../library/sqlite3.rst:746 +#: ../../library/sqlite3.rst:590 ../../library/sqlite3.rst:750 msgid "Example:" msgstr "範例:" @@ -530,8 +530,8 @@ msgstr "" #: ../../library/sqlite3.rst:490 msgid "" -"This routine registers a callback. The callback is invoked for each attempt " -"to access a column of a table in the database. The callback should return :" +"Register callable *authorizer_callback* to be invoked for each attempt to " +"access a column of a table in the database. The callback should return :" "const:`SQLITE_OK` if access is allowed, :const:`SQLITE_DENY` if the entire " "SQL statement should be aborted with an error and :const:`SQLITE_IGNORE` if " "the column should be treated as a NULL value. These constants are available " @@ -559,7 +559,7 @@ msgstr "" #: ../../library/sqlite3.rst:511 msgid "" -"This routine registers a callback. The callback is invoked for every *n* " +"Register callable *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " "get called from SQLite during long-running operations, for example to update " "a GUI." @@ -580,8 +580,8 @@ msgstr "" #: ../../library/sqlite3.rst:526 msgid "" -"Registers *trace_callback* to be called for each SQL statement that is " -"actually executed by the SQLite backend." +"Register callable *trace_callback* to be invoked for each SQL statement that " +"is actually executed by the SQLite backend." msgstr "" #: ../../library/sqlite3.rst:529 @@ -608,44 +608,45 @@ msgstr "" #: ../../library/sqlite3.rst:550 msgid "" -"This routine allows/disallows the SQLite engine to load SQLite extensions " -"from shared libraries. SQLite extensions can define new functions, " -"aggregates or whole new virtual table implementations. One well-known " -"extension is the fulltext-search extension distributed with SQLite." +"Enable the SQLite engine to load SQLite extensions from shared libraries if " +"*enabled* is :const:`True`; else, disallow loading SQLite extensions. SQLite " +"extensions can define new functions, aggregates or whole new virtual table " +"implementations. One well-known extension is the fulltext-search extension " +"distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:555 ../../library/sqlite3.rst:572 +#: ../../library/sqlite3.rst:557 ../../library/sqlite3.rst:574 msgid "Loadable extensions are disabled by default. See [#f1]_." msgstr "" -#: ../../library/sqlite3.rst:557 +#: ../../library/sqlite3.rst:559 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" -#: ../../library/sqlite3.rst:561 +#: ../../library/sqlite3.rst:563 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:568 +#: ../../library/sqlite3.rst:570 msgid "" -"This routine loads an SQLite extension from a shared library. You have to " -"enable extension loading with :meth:`enable_load_extension` before you can " -"use this routine." +"Load an SQLite extension from a shared library located at *path*. Enable " +"extension loading with :meth:`enable_load_extension` before calling this " +"method." msgstr "" -#: ../../library/sqlite3.rst:574 +#: ../../library/sqlite3.rst:576 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" -#: ../../library/sqlite3.rst:578 +#: ../../library/sqlite3.rst:580 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:583 +#: ../../library/sqlite3.rst:585 msgid "" "You can change this attribute to a callable that accepts the cursor and the " "original row as a tuple and will return the real result row. This way, you " @@ -653,7 +654,7 @@ msgid "" "object that can also access columns by name." msgstr "" -#: ../../library/sqlite3.rst:592 +#: ../../library/sqlite3.rst:594 msgid "" "If returning a tuple doesn't suffice and you want name-based access to " "columns, you should consider setting :attr:`row_factory` to the highly " @@ -663,7 +664,7 @@ msgid "" "approach or even a db_row based solution." msgstr "" -#: ../../library/sqlite3.rst:604 +#: ../../library/sqlite3.rst:606 msgid "" "Using this attribute you can control what objects are returned for the " "``TEXT`` data type. By default, this attribute is set to :class:`str` and " @@ -671,23 +672,23 @@ msgid "" "you want to return :class:`bytes` instead, you can set it to :class:`bytes`." msgstr "" -#: ../../library/sqlite3.rst:609 +#: ../../library/sqlite3.rst:611 msgid "" "You can also set it to any other callable that accepts a single bytestring " "parameter and returns the resulting object." msgstr "" -#: ../../library/sqlite3.rst:612 +#: ../../library/sqlite3.rst:614 msgid "See the following example code for illustration:" msgstr "" -#: ../../library/sqlite3.rst:619 +#: ../../library/sqlite3.rst:621 msgid "" "Returns the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:625 +#: ../../library/sqlite3.rst:627 msgid "" "Returns an iterator to dump the database in an SQL text format. Useful when " "saving an in-memory database for later restoration. This function provides " @@ -695,14 +696,14 @@ msgid "" "shell." msgstr "" -#: ../../library/sqlite3.rst:630 +#: ../../library/sqlite3.rst:632 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/sqlite3.rst:644 +#: ../../library/sqlite3.rst:646 msgid "" "This method makes a backup of an SQLite database even while it's being " "accessed by other clients, or concurrently by the same connection. The copy " @@ -710,14 +711,14 @@ msgid "" "class:`Connection` instance." msgstr "" -#: ../../library/sqlite3.rst:649 +#: ../../library/sqlite3.rst:651 msgid "" "By default, or when *pages* is either ``0`` or a negative integer, the " "entire database is copied in a single step; otherwise the method performs a " "loop copying up to *pages* pages at a time." msgstr "" -#: ../../library/sqlite3.rst:653 +#: ../../library/sqlite3.rst:655 msgid "" "If *progress* is specified, it must either be ``None`` or a callable object " "that will be executed at each iteration with three integer arguments, " @@ -725,7 +726,7 @@ msgid "" "pages still to be copied and the *total* number of pages." msgstr "" -#: ../../library/sqlite3.rst:658 +#: ../../library/sqlite3.rst:660 msgid "" "The *name* argument specifies the database name that will be copied: it must " "be a string containing either ``\"main\"``, the default, to indicate the " @@ -734,36 +735,37 @@ msgid "" "an attached database." msgstr "" -#: ../../library/sqlite3.rst:664 +#: ../../library/sqlite3.rst:666 msgid "" "The *sleep* argument specifies the number of seconds to sleep by between " "successive attempts to backup remaining pages, can be specified either as an " "integer or a floating point value." msgstr "" -#: ../../library/sqlite3.rst:668 +#: ../../library/sqlite3.rst:670 msgid "Example 1, copy an existing database into another::" msgstr "" -#: ../../library/sqlite3.rst:682 +#: ../../library/sqlite3.rst:684 msgid "Example 2, copy an existing database into a transient copy::" msgstr "" -#: ../../library/sqlite3.rst:696 +#: ../../library/sqlite3.rst:698 msgid "Cursor Objects" msgstr "" -#: ../../library/sqlite3.rst:700 +#: ../../library/sqlite3.rst:702 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:707 +#: ../../library/sqlite3.rst:709 msgid "" -"Execute an SQL statement. Values may be bound to the statement using :ref:" -"`placeholders `." +"Execute SQL statement *sql*. Bind values to the statement using :ref:" +"`placeholders ` that map to the :term:`sequence` or :" +"class:`dict` *parameters*." msgstr "" -#: ../../library/sqlite3.rst:710 +#: ../../library/sqlite3.rst:714 msgid "" ":meth:`execute` will only execute a single SQL statement. If you try to " "execute more than one statement with it, it will raise a :exc:`Warning`. " @@ -771,7 +773,7 @@ msgid "" "with one call." msgstr "" -#: ../../library/sqlite3.rst:715 +#: ../../library/sqlite3.rst:719 msgid "" "If :attr:`~Connection.isolation_level` is not :const:`None`, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " @@ -779,44 +781,44 @@ msgid "" "*sql*." msgstr "" -#: ../../library/sqlite3.rst:723 +#: ../../library/sqlite3.rst:727 msgid "" -"Execute a :ref:`parameterized ` SQL command against " -"all parameter sequences or mappings found in the sequence " +"Execute :ref:`parameterized ` SQL statement *sql* " +"against all parameter sequences or mappings found in the sequence " "*seq_of_parameters*. It is also possible to use an :term:`iterator` " "yielding parameters instead of a sequence. Uses the same implicit " "transaction handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:731 +#: ../../library/sqlite3.rst:735 msgid "Here's a shorter example using a :term:`generator`:" msgstr "" -#: ../../library/sqlite3.rst:738 +#: ../../library/sqlite3.rst:742 msgid "" -"Execute multiple SQL statements at once. If there is a pending transaciton, " -"an implicit ``COMMIT`` statement is executed first. No other implicit " -"transaction control is performed; any transaction control must be added to " -"*sql_script*." +"Execute the SQL statements in *sql_script*. If there is a pending " +"transaciton, an implicit ``COMMIT`` statement is executed first. No other " +"implicit transaction control is performed; any transaction control must be " +"added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:744 +#: ../../library/sqlite3.rst:748 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:753 +#: ../../library/sqlite3.rst:757 msgid "" "Fetches the next row of a query result set, returning a single sequence, or :" "const:`None` when no more data is available." msgstr "" -#: ../../library/sqlite3.rst:759 +#: ../../library/sqlite3.rst:763 msgid "" "Fetches the next set of rows of a query result, returning a list. An empty " "list is returned when no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:762 +#: ../../library/sqlite3.rst:766 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If it is not given, the cursor's arraysize determines the number of rows to " @@ -825,7 +827,7 @@ msgid "" "not being available, fewer rows may be returned." msgstr "" -#: ../../library/sqlite3.rst:768 +#: ../../library/sqlite3.rst:772 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -833,29 +835,29 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:775 +#: ../../library/sqlite3.rst:779 msgid "" "Fetches all (remaining) rows of a query result, returning a list. Note that " "the cursor's arraysize attribute can affect the performance of this " "operation. An empty list is returned when no rows are available." msgstr "" -#: ../../library/sqlite3.rst:781 +#: ../../library/sqlite3.rst:785 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:783 +#: ../../library/sqlite3.rst:787 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: ../../library/sqlite3.rst:788 ../../library/sqlite3.rst:792 +#: ../../library/sqlite3.rst:792 ../../library/sqlite3.rst:796 msgid "Required by the DB-API. Does nothing in :mod:`sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:796 +#: ../../library/sqlite3.rst:800 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -864,7 +866,7 @@ msgid "" "methods." msgstr "" -#: ../../library/sqlite3.rst:804 +#: ../../library/sqlite3.rst:808 msgid "" "This read-only attribute provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -874,33 +876,33 @@ msgid "" "const:`None`." msgstr "" -#: ../../library/sqlite3.rst:812 +#: ../../library/sqlite3.rst:816 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:814 +#: ../../library/sqlite3.rst:818 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:819 +#: ../../library/sqlite3.rst:823 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: ../../library/sqlite3.rst:824 +#: ../../library/sqlite3.rst:828 msgid "" "This read-only attribute provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are :const:`None`." msgstr "" -#: ../../library/sqlite3.rst:828 +#: ../../library/sqlite3.rst:832 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:832 +#: ../../library/sqlite3.rst:836 msgid "" "This read-only attribute provides the SQLite database :class:`Connection` " "used by the :class:`Cursor` object. A :class:`Cursor` object created by " @@ -908,67 +910,67 @@ msgid "" "`connection` attribute that refers to *con*::" msgstr "" -#: ../../library/sqlite3.rst:845 +#: ../../library/sqlite3.rst:849 msgid "Row Objects" msgstr "" -#: ../../library/sqlite3.rst:849 +#: ../../library/sqlite3.rst:853 msgid "" "A :class:`Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It tries to mimic a tuple in " "most of its features." msgstr "" -#: ../../library/sqlite3.rst:853 +#: ../../library/sqlite3.rst:857 msgid "" "It supports mapping access by column name and index, iteration, " "representation, equality testing and :func:`len`." msgstr "" -#: ../../library/sqlite3.rst:856 +#: ../../library/sqlite3.rst:860 msgid "" "If two :class:`Row` objects have exactly the same columns and their members " "are equal, they compare equal." msgstr "" -#: ../../library/sqlite3.rst:861 +#: ../../library/sqlite3.rst:865 msgid "" "This method returns a list of column names. Immediately after a query, it is " "the first member of each tuple in :attr:`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:864 +#: ../../library/sqlite3.rst:868 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:867 +#: ../../library/sqlite3.rst:871 msgid "Let's assume we initialize a table as in the example given above::" msgstr "" -#: ../../library/sqlite3.rst:879 +#: ../../library/sqlite3.rst:883 msgid "Now we plug :class:`Row` in::" msgstr "" -#: ../../library/sqlite3.rst:909 +#: ../../library/sqlite3.rst:913 msgid "PrepareProtocol Objects" msgstr "" -#: ../../library/sqlite3.rst:913 +#: ../../library/sqlite3.rst:917 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:921 +#: ../../library/sqlite3.rst:925 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:923 +#: ../../library/sqlite3.rst:927 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:927 +#: ../../library/sqlite3.rst:931 msgid "" "This exception is raised by ``sqlite3`` if an SQL query is not a :class:" "`string `, or if multiple statements are passed to :meth:`~Cursor." @@ -976,21 +978,21 @@ msgid "" "`Exception`." msgstr "" -#: ../../library/sqlite3.rst:934 +#: ../../library/sqlite3.rst:938 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:940 +#: ../../library/sqlite3.rst:944 msgid "" "This exception is raised by ``sqlite3`` for fetch across rollback, or if " "``sqlite3`` is unable to bind parameters. ``InterfaceError`` is a subclass " "of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:946 +#: ../../library/sqlite3.rst:950 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -998,14 +1000,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:953 +#: ../../library/sqlite3.rst:957 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:959 +#: ../../library/sqlite3.rst:963 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1013,20 +1015,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:967 +#: ../../library/sqlite3.rst:971 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:972 +#: ../../library/sqlite3.rst:976 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:979 +#: ../../library/sqlite3.rst:983 msgid "" "Exception raised for ``sqlite3`` API programming errors, for example trying " "to operate on a closed :class:`Connection`, or trying to execute non-DML " @@ -1034,7 +1036,7 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:986 +#: ../../library/sqlite3.rst:990 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to :const:" @@ -1043,82 +1045,82 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:996 +#: ../../library/sqlite3.rst:1000 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1000 +#: ../../library/sqlite3.rst:1004 msgid "Introduction" msgstr "簡介" -#: ../../library/sqlite3.rst:1002 +#: ../../library/sqlite3.rst:1006 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1005 +#: ../../library/sqlite3.rst:1009 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1008 ../../library/sqlite3.rst:1025 +#: ../../library/sqlite3.rst:1012 ../../library/sqlite3.rst:1029 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1008 ../../library/sqlite3.rst:1025 +#: ../../library/sqlite3.rst:1012 ../../library/sqlite3.rst:1029 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1010 ../../library/sqlite3.rst:1027 +#: ../../library/sqlite3.rst:1014 ../../library/sqlite3.rst:1031 msgid ":const:`None`" msgstr ":const:`None`" -#: ../../library/sqlite3.rst:1010 ../../library/sqlite3.rst:1027 +#: ../../library/sqlite3.rst:1014 ../../library/sqlite3.rst:1031 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1012 ../../library/sqlite3.rst:1029 +#: ../../library/sqlite3.rst:1016 ../../library/sqlite3.rst:1033 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1012 ../../library/sqlite3.rst:1029 +#: ../../library/sqlite3.rst:1016 ../../library/sqlite3.rst:1033 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1014 ../../library/sqlite3.rst:1031 +#: ../../library/sqlite3.rst:1018 ../../library/sqlite3.rst:1035 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1014 ../../library/sqlite3.rst:1031 +#: ../../library/sqlite3.rst:1018 ../../library/sqlite3.rst:1035 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1016 +#: ../../library/sqlite3.rst:1020 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1016 ../../library/sqlite3.rst:1033 +#: ../../library/sqlite3.rst:1020 ../../library/sqlite3.rst:1037 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1018 ../../library/sqlite3.rst:1036 +#: ../../library/sqlite3.rst:1022 ../../library/sqlite3.rst:1040 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1018 ../../library/sqlite3.rst:1036 +#: ../../library/sqlite3.rst:1022 ../../library/sqlite3.rst:1040 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1022 +#: ../../library/sqlite3.rst:1026 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1033 +#: ../../library/sqlite3.rst:1037 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1039 +#: ../../library/sqlite3.rst:1043 msgid "" "The type system of the :mod:`sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via object " @@ -1126,18 +1128,18 @@ msgid "" "to different Python types via converters." msgstr "" -#: ../../library/sqlite3.rst:1046 +#: ../../library/sqlite3.rst:1050 msgid "Using adapters to store custom Python types in SQLite databases" msgstr "" -#: ../../library/sqlite3.rst:1048 +#: ../../library/sqlite3.rst:1052 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands`." msgstr "" -#: ../../library/sqlite3.rst:1052 +#: ../../library/sqlite3.rst:1056 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1147,11 +1149,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1064 +#: ../../library/sqlite3.rst:1068 msgid "Letting your object adapt itself" msgstr "" -#: ../../library/sqlite3.rst:1066 +#: ../../library/sqlite3.rst:1070 msgid "" "Suppose we have a ``Point`` class that represents a pair of coordinates, " "``x`` and ``y``, in a Cartesian coordinate system. The coordinate pair will " @@ -1161,107 +1163,107 @@ msgid "" "*protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1078 +#: ../../library/sqlite3.rst:1082 msgid "Registering an adapter callable" msgstr "" -#: ../../library/sqlite3.rst:1080 +#: ../../library/sqlite3.rst:1084 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1088 +#: ../../library/sqlite3.rst:1092 msgid "Converting SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1090 +#: ../../library/sqlite3.rst:1094 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1095 +#: ../../library/sqlite3.rst:1099 msgid "" "Let's go back to the :class:`Point` class. We stored the x and y coordinates " "separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1098 +#: ../../library/sqlite3.rst:1102 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1103 +#: ../../library/sqlite3.rst:1107 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1112 +#: ../../library/sqlite3.rst:1116 msgid "" "We now need to tell ``sqlite3`` when it should convert a given SQLite value. " "This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:1116 +#: ../../library/sqlite3.rst:1120 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1117 +#: ../../library/sqlite3.rst:1121 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1118 +#: ../../library/sqlite3.rst:1122 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1122 +#: ../../library/sqlite3.rst:1126 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:1128 +#: ../../library/sqlite3.rst:1132 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1130 +#: ../../library/sqlite3.rst:1134 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1133 +#: ../../library/sqlite3.rst:1137 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1137 +#: ../../library/sqlite3.rst:1141 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1141 +#: ../../library/sqlite3.rst:1145 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1145 +#: ../../library/sqlite3.rst:1149 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1151 +#: ../../library/sqlite3.rst:1155 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1269,25 +1271,25 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1160 +#: ../../library/sqlite3.rst:1164 msgid "Adapter and Converter Recipes" msgstr "" -#: ../../library/sqlite3.rst:1162 +#: ../../library/sqlite3.rst:1166 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:1205 +#: ../../library/sqlite3.rst:1209 msgid "Controlling Transactions" msgstr "" -#: ../../library/sqlite3.rst:1207 +#: ../../library/sqlite3.rst:1211 msgid "" "The ``sqlite3`` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:1210 +#: ../../library/sqlite3.rst:1214 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not :" "const:`None`, new transactions are implicitly opened before :meth:`~Cursor." @@ -1300,7 +1302,7 @@ msgid "" "isolation_level` attribute." msgstr "" -#: ../../library/sqlite3.rst:1222 +#: ../../library/sqlite3.rst:1226 msgid "" "If :attr:`~Connection.isolation_level` is set to :const:`None`, no " "transactions are implicitly opened at all. This leaves the underlying SQLite " @@ -1310,56 +1312,56 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:1230 +#: ../../library/sqlite3.rst:1234 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:1234 +#: ../../library/sqlite3.rst:1238 msgid "" ":mod:`sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:1248 +#: ../../library/sqlite3.rst:1252 msgid "SQLite URI tricks" msgstr "" -#: ../../library/sqlite3.rst:1250 +#: ../../library/sqlite3.rst:1254 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:1252 +#: ../../library/sqlite3.rst:1256 msgid "Open a database in read-only mode::" msgstr "" -#: ../../library/sqlite3.rst:1256 +#: ../../library/sqlite3.rst:1260 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file::" msgstr "" -#: ../../library/sqlite3.rst:1261 +#: ../../library/sqlite3.rst:1265 msgid "Create a shared named in-memory database::" msgstr "" -#: ../../library/sqlite3.rst:1270 +#: ../../library/sqlite3.rst:1274 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:1276 +#: ../../library/sqlite3.rst:1280 msgid "Using :mod:`sqlite3` efficiently" msgstr "" -#: ../../library/sqlite3.rst:1280 +#: ../../library/sqlite3.rst:1284 msgid "Using shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:1282 +#: ../../library/sqlite3.rst:1286 msgid "" "Using the nonstandard :meth:`execute`, :meth:`executemany` and :meth:" "`executescript` methods of the :class:`Connection` object, your code can be " @@ -1371,27 +1373,27 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:1294 +#: ../../library/sqlite3.rst:1298 msgid "Accessing columns by name instead of by index" msgstr "" -#: ../../library/sqlite3.rst:1296 +#: ../../library/sqlite3.rst:1300 msgid "" "One useful feature of the :mod:`sqlite3` module is the built-in :class:" "`sqlite3.Row` class designed to be used as a row factory." msgstr "" -#: ../../library/sqlite3.rst:1299 +#: ../../library/sqlite3.rst:1303 msgid "" "Rows wrapped with this class can be accessed both by index (like tuples) and " "case-insensitively by name:" msgstr "" -#: ../../library/sqlite3.rst:1308 +#: ../../library/sqlite3.rst:1312 msgid "Using the connection as a context manager" msgstr "" -#: ../../library/sqlite3.rst:1310 +#: ../../library/sqlite3.rst:1314 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1401,23 +1403,23 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:1319 +#: ../../library/sqlite3.rst:1323 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:1324 +#: ../../library/sqlite3.rst:1328 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:1331 +#: ../../library/sqlite3.rst:1335 msgid "Footnotes" msgstr "註解" -#: ../../library/sqlite3.rst:1332 +#: ../../library/sqlite3.rst:1336 msgid "" "The sqlite3 module is not built with loadable extension support by default, " "because some platforms (notably macOS) have SQLite libraries which are " From 193a53995f1d0566ea84b4b12573c4c6e5a3f0ed Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 27 Jul 2022 00:21:38 +0000 Subject: [PATCH 2/6] sync with cpython f118661a --- library/sqlite3.po | 451 +++++++++++++++++++++++++-------------------- 1 file changed, 250 insertions(+), 201 deletions(-) diff --git a/library/sqlite3.po b/library/sqlite3.po index d5a26312a1..573d5eb336 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-26 00:17+0000\n" +"POT-Creation-Date: 2022-07-27 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -449,86 +449,133 @@ msgid "" msgstr "" #: ../../library/sqlite3.rst:426 +msgid "Create or remove a user-defined SQL function." +msgstr "" + +#: ../../library/sqlite3.rst:428 +msgid "The name of the SQL function." +msgstr "" + +#: ../../library/sqlite3.rst:432 +msgid "" +"The number of arguments the SQL function can accept. If ``-1``, it may take " +"any number of arguments." +msgstr "" + +#: ../../library/sqlite3.rst:437 msgid "" -"Creates a user-defined function that you can later use from within SQL " -"statements under the function name *name*. *narg* is the number of " -"parameters the function accepts (if *narg* is -1, the function may take any " -"number of arguments), and *func* is a Python callable that is called as the " -"SQL function. If *deterministic* is true, the created function is marked as " -"`deterministic `_, which allows " -"SQLite to perform additional optimizations. This flag is supported by SQLite " -"3.8.3 or higher, :exc:`NotSupportedError` will be raised if used with older " -"versions." +"A callable that is called when the SQL function is invoked. The callable " +"must return :ref:`a type natively supported by SQLite `. Set " +"to :const:`None` to remove an existing SQL function." msgstr "" -#: ../../library/sqlite3.rst:436 +#: ../../library/sqlite3.rst:444 msgid "" -"The function can return any of :ref:`the types natively supported by SQLite " -"`." +"If :const:`True`, the created SQL function is marked as `deterministic " +"`_, which allows SQLite to perform " +"additional optimizations." +msgstr "" + +#: ../../library/sqlite3.rst:0 +msgid "Raises" msgstr "" -#: ../../library/sqlite3.rst:439 -msgid "The *deterministic* parameter was added." +#: ../../library/sqlite3.rst:450 +msgid "If *deterministic* is used with SQLite versions older than 3.8.3." +msgstr "" + +#: ../../library/sqlite3.rst:453 +#, fuzzy +msgid "The *deterministic* parameter." msgstr "新增 *deterministic* 參數。" -#: ../../library/sqlite3.rst:442 ../../library/sqlite3.rst:459 -#: ../../library/sqlite3.rst:590 ../../library/sqlite3.rst:750 +#: ../../library/sqlite3.rst:456 ../../library/sqlite3.rst:487 +#: ../../library/sqlite3.rst:618 ../../library/sqlite3.rst:792 msgid "Example:" msgstr "範例:" -#: ../../library/sqlite3.rst:449 -msgid "Creates a user-defined aggregate function." +#: ../../library/sqlite3.rst:463 +msgid "Create or remove a user-defined SQL aggregate function." +msgstr "" + +#: ../../library/sqlite3.rst:465 +msgid "The name of the SQL aggregate function." +msgstr "" + +#: ../../library/sqlite3.rst:469 +msgid "" +"The number of arguments the SQL aggregate function can accept. If ``-1``, it " +"may take any number of arguments." +msgstr "" + +#: ../../library/sqlite3.rst:474 +msgid "" +"A class must implement the following methods: * ``step()``: Add a row to " +"the aggregate. * ``finalize()``: Return the final result of the aggregate " +"as :ref:`a type natively supported by SQLite `. The number " +"of arguments that the ``step()`` method must accept is controlled by " +"*n_arg*. Set to :const:`None` to remove an existing SQL aggregate function." +msgstr "" + +#: ../../library/sqlite3.rst:475 +msgid "A class must implement the following methods:" +msgstr "" + +#: ../../library/sqlite3.rst:477 +msgid "``step()``: Add a row to the aggregate." msgstr "" -#: ../../library/sqlite3.rst:451 +#: ../../library/sqlite3.rst:478 msgid "" -"The aggregate class must implement a ``step`` method, which accepts the " -"number of parameters *n_arg* (if *n_arg* is -1, the function may take any " -"number of arguments), and a ``finalize`` method which will return the final " -"result of the aggregate." +"``finalize()``: Return the final result of the aggregate as :ref:`a type " +"natively supported by SQLite `." msgstr "" -#: ../../library/sqlite3.rst:456 +#: ../../library/sqlite3.rst:481 msgid "" -"The ``finalize`` method can return any of :ref:`the types natively supported " -"by SQLite `." +"The number of arguments that the ``step()`` method must accept is controlled " +"by *n_arg*." msgstr "" -#: ../../library/sqlite3.rst:466 +#: ../../library/sqlite3.rst:484 +msgid "Set to :const:`None` to remove an existing SQL aggregate function." +msgstr "" + +#: ../../library/sqlite3.rst:494 msgid "" "Create a collation named *name* using the collating function *callable*. " "*callable* is passed two :class:`string ` arguments, and it should " "return an :class:`integer `:" msgstr "" -#: ../../library/sqlite3.rst:470 +#: ../../library/sqlite3.rst:498 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: ../../library/sqlite3.rst:471 +#: ../../library/sqlite3.rst:499 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: ../../library/sqlite3.rst:472 +#: ../../library/sqlite3.rst:500 msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:474 +#: ../../library/sqlite3.rst:502 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:478 +#: ../../library/sqlite3.rst:506 msgid "Remove a collation function by setting *callable* to :const:`None`." msgstr "" -#: ../../library/sqlite3.rst:483 +#: ../../library/sqlite3.rst:511 msgid "" "You can call this method from a different thread to abort any queries that " "might be executing on the connection. The query will then abort and the " "caller will get an exception." msgstr "" -#: ../../library/sqlite3.rst:490 +#: ../../library/sqlite3.rst:518 msgid "" "Register callable *authorizer_callback* to be invoked for each attempt to " "access a column of a table in the database. The callback should return :" @@ -538,7 +585,7 @@ msgid "" "in the :mod:`sqlite3` module." msgstr "" -#: ../../library/sqlite3.rst:497 +#: ../../library/sqlite3.rst:525 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or :const:`None` " @@ -549,7 +596,7 @@ msgid "" "code." msgstr "" -#: ../../library/sqlite3.rst:504 +#: ../../library/sqlite3.rst:532 msgid "" "Please consult the SQLite documentation about the possible values for the " "first argument and the meaning of the second and third argument depending on " @@ -557,7 +604,7 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:511 +#: ../../library/sqlite3.rst:539 msgid "" "Register callable *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -565,26 +612,26 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:516 +#: ../../library/sqlite3.rst:544 msgid "" "If you want to clear any previously installed progress handler, call the " "method with :const:`None` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:519 +#: ../../library/sqlite3.rst:547 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise an :exc:`OperationalError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:526 +#: ../../library/sqlite3.rst:554 msgid "" "Register callable *trace_callback* to be invoked for each SQL statement that " "is actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:529 +#: ../../library/sqlite3.rst:557 msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " @@ -594,19 +641,19 @@ msgid "" "of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:537 +#: ../../library/sqlite3.rst:565 msgid "" "Passing :const:`None` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:540 +#: ../../library/sqlite3.rst:568 msgid "" "Exceptions raised in the trace callback are not propagated. As a development " "and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable " "printing tracebacks from exceptions raised in the trace callback." msgstr "" -#: ../../library/sqlite3.rst:550 +#: ../../library/sqlite3.rst:578 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is :const:`True`; else, disallow loading SQLite extensions. SQLite " @@ -615,38 +662,38 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:557 ../../library/sqlite3.rst:574 +#: ../../library/sqlite3.rst:585 ../../library/sqlite3.rst:602 msgid "Loadable extensions are disabled by default. See [#f1]_." msgstr "" -#: ../../library/sqlite3.rst:559 +#: ../../library/sqlite3.rst:587 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" -#: ../../library/sqlite3.rst:563 +#: ../../library/sqlite3.rst:591 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:570 +#: ../../library/sqlite3.rst:598 msgid "" "Load an SQLite extension from a shared library located at *path*. Enable " "extension loading with :meth:`enable_load_extension` before calling this " "method." msgstr "" -#: ../../library/sqlite3.rst:576 +#: ../../library/sqlite3.rst:604 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" -#: ../../library/sqlite3.rst:580 +#: ../../library/sqlite3.rst:608 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:585 +#: ../../library/sqlite3.rst:613 msgid "" "You can change this attribute to a callable that accepts the cursor and the " "original row as a tuple and will return the real result row. This way, you " @@ -654,7 +701,7 @@ msgid "" "object that can also access columns by name." msgstr "" -#: ../../library/sqlite3.rst:594 +#: ../../library/sqlite3.rst:622 msgid "" "If returning a tuple doesn't suffice and you want name-based access to " "columns, you should consider setting :attr:`row_factory` to the highly " @@ -664,7 +711,7 @@ msgid "" "approach or even a db_row based solution." msgstr "" -#: ../../library/sqlite3.rst:606 +#: ../../library/sqlite3.rst:634 msgid "" "Using this attribute you can control what objects are returned for the " "``TEXT`` data type. By default, this attribute is set to :class:`str` and " @@ -672,23 +719,23 @@ msgid "" "you want to return :class:`bytes` instead, you can set it to :class:`bytes`." msgstr "" -#: ../../library/sqlite3.rst:611 +#: ../../library/sqlite3.rst:639 msgid "" "You can also set it to any other callable that accepts a single bytestring " "parameter and returns the resulting object." msgstr "" -#: ../../library/sqlite3.rst:614 +#: ../../library/sqlite3.rst:642 msgid "See the following example code for illustration:" msgstr "" -#: ../../library/sqlite3.rst:621 +#: ../../library/sqlite3.rst:649 msgid "" "Returns the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:627 +#: ../../library/sqlite3.rst:655 msgid "" "Returns an iterator to dump the database in an SQL text format. Useful when " "saving an in-memory database for later restoration. This function provides " @@ -696,76 +743,78 @@ msgid "" "shell." msgstr "" -#: ../../library/sqlite3.rst:632 +#: ../../library/sqlite3.rst:660 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/sqlite3.rst:646 +#: ../../library/sqlite3.rst:674 +msgid "Create a backup of an SQLite database." +msgstr "" + +#: ../../library/sqlite3.rst:676 msgid "" -"This method makes a backup of an SQLite database even while it's being " -"accessed by other clients, or concurrently by the same connection. The copy " -"will be written into the mandatory argument *target*, that must be another :" -"class:`Connection` instance." +"Works even if the database is being accessed by other clients or " +"concurrently by the same connection." +msgstr "" + +#: ../../library/sqlite3.rst:679 +msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:651 +#: ../../library/sqlite3.rst:683 msgid "" -"By default, or when *pages* is either ``0`` or a negative integer, the " -"entire database is copied in a single step; otherwise the method performs a " -"loop copying up to *pages* pages at a time." +"The number of pages to copy at a time. If equal to or less than ``0``, the " +"entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:655 +#: ../../library/sqlite3.rst:690 msgid "" -"If *progress* is specified, it must either be ``None`` or a callable object " -"that will be executed at each iteration with three integer arguments, " -"respectively the *status* of the last iteration, the *remaining* number of " -"pages still to be copied and the *total* number of pages." +"If set to a callable, it is invoked with three integer arguments for every " +"backup iteration: the *status* of the last iteration, the *remaining* number " +"of pages still to be copied, and the *total* number of pages. Defaults to :" +"const:`None`." msgstr "" -#: ../../library/sqlite3.rst:660 +#: ../../library/sqlite3.rst:699 msgid "" -"The *name* argument specifies the database name that will be copied: it must " -"be a string containing either ``\"main\"``, the default, to indicate the " -"main database, ``\"temp\"`` to indicate the temporary database or the name " -"specified after the ``AS`` keyword in an ``ATTACH DATABASE`` statement for " -"an attached database." +"The name of the database to back up. Either ``\"main\"`` (the default) for " +"the main database, ``\"temp\"`` for the temporary database, or the name of a " +"custom database as attached using the ``ATTACH DATABASE`` SQL statment." msgstr "" -#: ../../library/sqlite3.rst:666 +#: ../../library/sqlite3.rst:707 msgid "" -"The *sleep* argument specifies the number of seconds to sleep by between " -"successive attempts to backup remaining pages, can be specified either as an " -"integer or a floating point value." +"The number of seconds to sleep between successive attempts to back up " +"remaining pages." msgstr "" -#: ../../library/sqlite3.rst:670 +#: ../../library/sqlite3.rst:712 msgid "Example 1, copy an existing database into another::" msgstr "" -#: ../../library/sqlite3.rst:684 +#: ../../library/sqlite3.rst:726 msgid "Example 2, copy an existing database into a transient copy::" msgstr "" -#: ../../library/sqlite3.rst:698 +#: ../../library/sqlite3.rst:740 msgid "Cursor Objects" msgstr "" -#: ../../library/sqlite3.rst:702 +#: ../../library/sqlite3.rst:744 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:709 +#: ../../library/sqlite3.rst:751 msgid "" "Execute SQL statement *sql*. Bind values to the statement using :ref:" "`placeholders ` that map to the :term:`sequence` or :" "class:`dict` *parameters*." msgstr "" -#: ../../library/sqlite3.rst:714 +#: ../../library/sqlite3.rst:756 msgid "" ":meth:`execute` will only execute a single SQL statement. If you try to " "execute more than one statement with it, it will raise a :exc:`Warning`. " @@ -773,7 +822,7 @@ msgid "" "with one call." msgstr "" -#: ../../library/sqlite3.rst:719 +#: ../../library/sqlite3.rst:761 msgid "" "If :attr:`~Connection.isolation_level` is not :const:`None`, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " @@ -781,7 +830,7 @@ msgid "" "*sql*." msgstr "" -#: ../../library/sqlite3.rst:727 +#: ../../library/sqlite3.rst:769 msgid "" "Execute :ref:`parameterized ` SQL statement *sql* " "against all parameter sequences or mappings found in the sequence " @@ -790,11 +839,11 @@ msgid "" "transaction handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:735 +#: ../../library/sqlite3.rst:777 msgid "Here's a shorter example using a :term:`generator`:" msgstr "" -#: ../../library/sqlite3.rst:742 +#: ../../library/sqlite3.rst:784 msgid "" "Execute the SQL statements in *sql_script*. If there is a pending " "transaciton, an implicit ``COMMIT`` statement is executed first. No other " @@ -802,23 +851,23 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:748 +#: ../../library/sqlite3.rst:790 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:757 +#: ../../library/sqlite3.rst:799 msgid "" "Fetches the next row of a query result set, returning a single sequence, or :" "const:`None` when no more data is available." msgstr "" -#: ../../library/sqlite3.rst:763 +#: ../../library/sqlite3.rst:805 msgid "" "Fetches the next set of rows of a query result, returning a list. An empty " "list is returned when no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:766 +#: ../../library/sqlite3.rst:808 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If it is not given, the cursor's arraysize determines the number of rows to " @@ -827,7 +876,7 @@ msgid "" "not being available, fewer rows may be returned." msgstr "" -#: ../../library/sqlite3.rst:772 +#: ../../library/sqlite3.rst:814 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -835,29 +884,29 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:779 +#: ../../library/sqlite3.rst:821 msgid "" "Fetches all (remaining) rows of a query result, returning a list. Note that " "the cursor's arraysize attribute can affect the performance of this " "operation. An empty list is returned when no rows are available." msgstr "" -#: ../../library/sqlite3.rst:785 +#: ../../library/sqlite3.rst:827 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:787 +#: ../../library/sqlite3.rst:829 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: ../../library/sqlite3.rst:792 ../../library/sqlite3.rst:796 +#: ../../library/sqlite3.rst:834 ../../library/sqlite3.rst:838 msgid "Required by the DB-API. Does nothing in :mod:`sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:800 +#: ../../library/sqlite3.rst:842 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -866,7 +915,7 @@ msgid "" "methods." msgstr "" -#: ../../library/sqlite3.rst:808 +#: ../../library/sqlite3.rst:850 msgid "" "This read-only attribute provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -876,33 +925,33 @@ msgid "" "const:`None`." msgstr "" -#: ../../library/sqlite3.rst:816 +#: ../../library/sqlite3.rst:858 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:818 +#: ../../library/sqlite3.rst:860 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:823 +#: ../../library/sqlite3.rst:865 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: ../../library/sqlite3.rst:828 +#: ../../library/sqlite3.rst:870 msgid "" "This read-only attribute provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are :const:`None`." msgstr "" -#: ../../library/sqlite3.rst:832 +#: ../../library/sqlite3.rst:874 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:836 +#: ../../library/sqlite3.rst:878 msgid "" "This read-only attribute provides the SQLite database :class:`Connection` " "used by the :class:`Cursor` object. A :class:`Cursor` object created by " @@ -910,67 +959,67 @@ msgid "" "`connection` attribute that refers to *con*::" msgstr "" -#: ../../library/sqlite3.rst:849 +#: ../../library/sqlite3.rst:891 msgid "Row Objects" msgstr "" -#: ../../library/sqlite3.rst:853 +#: ../../library/sqlite3.rst:895 msgid "" "A :class:`Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It tries to mimic a tuple in " "most of its features." msgstr "" -#: ../../library/sqlite3.rst:857 +#: ../../library/sqlite3.rst:899 msgid "" "It supports mapping access by column name and index, iteration, " "representation, equality testing and :func:`len`." msgstr "" -#: ../../library/sqlite3.rst:860 +#: ../../library/sqlite3.rst:902 msgid "" "If two :class:`Row` objects have exactly the same columns and their members " "are equal, they compare equal." msgstr "" -#: ../../library/sqlite3.rst:865 +#: ../../library/sqlite3.rst:907 msgid "" "This method returns a list of column names. Immediately after a query, it is " "the first member of each tuple in :attr:`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:868 +#: ../../library/sqlite3.rst:910 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:871 +#: ../../library/sqlite3.rst:913 msgid "Let's assume we initialize a table as in the example given above::" msgstr "" -#: ../../library/sqlite3.rst:883 +#: ../../library/sqlite3.rst:925 msgid "Now we plug :class:`Row` in::" msgstr "" -#: ../../library/sqlite3.rst:913 +#: ../../library/sqlite3.rst:955 msgid "PrepareProtocol Objects" msgstr "" -#: ../../library/sqlite3.rst:917 +#: ../../library/sqlite3.rst:959 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:925 +#: ../../library/sqlite3.rst:967 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:927 +#: ../../library/sqlite3.rst:969 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:931 +#: ../../library/sqlite3.rst:973 msgid "" "This exception is raised by ``sqlite3`` if an SQL query is not a :class:" "`string `, or if multiple statements are passed to :meth:`~Cursor." @@ -978,21 +1027,21 @@ msgid "" "`Exception`." msgstr "" -#: ../../library/sqlite3.rst:938 +#: ../../library/sqlite3.rst:980 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:944 +#: ../../library/sqlite3.rst:986 msgid "" "This exception is raised by ``sqlite3`` for fetch across rollback, or if " "``sqlite3`` is unable to bind parameters. ``InterfaceError`` is a subclass " "of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:950 +#: ../../library/sqlite3.rst:992 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1000,14 +1049,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:957 +#: ../../library/sqlite3.rst:999 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:963 +#: ../../library/sqlite3.rst:1005 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1015,20 +1064,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:971 +#: ../../library/sqlite3.rst:1013 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:976 +#: ../../library/sqlite3.rst:1018 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:983 +#: ../../library/sqlite3.rst:1025 msgid "" "Exception raised for ``sqlite3`` API programming errors, for example trying " "to operate on a closed :class:`Connection`, or trying to execute non-DML " @@ -1036,7 +1085,7 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:990 +#: ../../library/sqlite3.rst:1032 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to :const:" @@ -1045,82 +1094,82 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1000 +#: ../../library/sqlite3.rst:1042 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1004 +#: ../../library/sqlite3.rst:1046 msgid "Introduction" msgstr "簡介" -#: ../../library/sqlite3.rst:1006 +#: ../../library/sqlite3.rst:1048 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1009 +#: ../../library/sqlite3.rst:1051 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1012 ../../library/sqlite3.rst:1029 +#: ../../library/sqlite3.rst:1054 ../../library/sqlite3.rst:1071 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1012 ../../library/sqlite3.rst:1029 +#: ../../library/sqlite3.rst:1054 ../../library/sqlite3.rst:1071 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1014 ../../library/sqlite3.rst:1031 +#: ../../library/sqlite3.rst:1056 ../../library/sqlite3.rst:1073 msgid ":const:`None`" msgstr ":const:`None`" -#: ../../library/sqlite3.rst:1014 ../../library/sqlite3.rst:1031 +#: ../../library/sqlite3.rst:1056 ../../library/sqlite3.rst:1073 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1016 ../../library/sqlite3.rst:1033 +#: ../../library/sqlite3.rst:1058 ../../library/sqlite3.rst:1075 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1016 ../../library/sqlite3.rst:1033 +#: ../../library/sqlite3.rst:1058 ../../library/sqlite3.rst:1075 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1018 ../../library/sqlite3.rst:1035 +#: ../../library/sqlite3.rst:1060 ../../library/sqlite3.rst:1077 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1018 ../../library/sqlite3.rst:1035 +#: ../../library/sqlite3.rst:1060 ../../library/sqlite3.rst:1077 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1020 +#: ../../library/sqlite3.rst:1062 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1020 ../../library/sqlite3.rst:1037 +#: ../../library/sqlite3.rst:1062 ../../library/sqlite3.rst:1079 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1022 ../../library/sqlite3.rst:1040 +#: ../../library/sqlite3.rst:1064 ../../library/sqlite3.rst:1082 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1022 ../../library/sqlite3.rst:1040 +#: ../../library/sqlite3.rst:1064 ../../library/sqlite3.rst:1082 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1026 +#: ../../library/sqlite3.rst:1068 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1037 +#: ../../library/sqlite3.rst:1079 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1043 +#: ../../library/sqlite3.rst:1085 msgid "" "The type system of the :mod:`sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via object " @@ -1128,18 +1177,18 @@ msgid "" "to different Python types via converters." msgstr "" -#: ../../library/sqlite3.rst:1050 +#: ../../library/sqlite3.rst:1092 msgid "Using adapters to store custom Python types in SQLite databases" msgstr "" -#: ../../library/sqlite3.rst:1052 +#: ../../library/sqlite3.rst:1094 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands`." msgstr "" -#: ../../library/sqlite3.rst:1056 +#: ../../library/sqlite3.rst:1098 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1149,11 +1198,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1068 +#: ../../library/sqlite3.rst:1110 msgid "Letting your object adapt itself" msgstr "" -#: ../../library/sqlite3.rst:1070 +#: ../../library/sqlite3.rst:1112 msgid "" "Suppose we have a ``Point`` class that represents a pair of coordinates, " "``x`` and ``y``, in a Cartesian coordinate system. The coordinate pair will " @@ -1163,107 +1212,107 @@ msgid "" "*protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1082 +#: ../../library/sqlite3.rst:1124 msgid "Registering an adapter callable" msgstr "" -#: ../../library/sqlite3.rst:1084 +#: ../../library/sqlite3.rst:1126 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1092 +#: ../../library/sqlite3.rst:1134 msgid "Converting SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1094 +#: ../../library/sqlite3.rst:1136 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1099 +#: ../../library/sqlite3.rst:1141 msgid "" "Let's go back to the :class:`Point` class. We stored the x and y coordinates " "separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1102 +#: ../../library/sqlite3.rst:1144 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1107 +#: ../../library/sqlite3.rst:1149 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1116 +#: ../../library/sqlite3.rst:1158 msgid "" "We now need to tell ``sqlite3`` when it should convert a given SQLite value. " "This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:1120 +#: ../../library/sqlite3.rst:1162 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1121 +#: ../../library/sqlite3.rst:1163 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1122 +#: ../../library/sqlite3.rst:1164 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1126 +#: ../../library/sqlite3.rst:1168 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:1132 +#: ../../library/sqlite3.rst:1174 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1134 +#: ../../library/sqlite3.rst:1176 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1137 +#: ../../library/sqlite3.rst:1179 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1141 +#: ../../library/sqlite3.rst:1183 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1145 +#: ../../library/sqlite3.rst:1187 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1149 +#: ../../library/sqlite3.rst:1191 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1155 +#: ../../library/sqlite3.rst:1197 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1271,25 +1320,25 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1164 +#: ../../library/sqlite3.rst:1206 msgid "Adapter and Converter Recipes" msgstr "" -#: ../../library/sqlite3.rst:1166 +#: ../../library/sqlite3.rst:1208 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:1209 +#: ../../library/sqlite3.rst:1251 msgid "Controlling Transactions" msgstr "" -#: ../../library/sqlite3.rst:1211 +#: ../../library/sqlite3.rst:1253 msgid "" "The ``sqlite3`` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:1214 +#: ../../library/sqlite3.rst:1256 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not :" "const:`None`, new transactions are implicitly opened before :meth:`~Cursor." @@ -1302,7 +1351,7 @@ msgid "" "isolation_level` attribute." msgstr "" -#: ../../library/sqlite3.rst:1226 +#: ../../library/sqlite3.rst:1268 msgid "" "If :attr:`~Connection.isolation_level` is set to :const:`None`, no " "transactions are implicitly opened at all. This leaves the underlying SQLite " @@ -1312,56 +1361,56 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:1234 +#: ../../library/sqlite3.rst:1276 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:1238 +#: ../../library/sqlite3.rst:1280 msgid "" ":mod:`sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:1252 +#: ../../library/sqlite3.rst:1294 msgid "SQLite URI tricks" msgstr "" -#: ../../library/sqlite3.rst:1254 +#: ../../library/sqlite3.rst:1296 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:1256 +#: ../../library/sqlite3.rst:1298 msgid "Open a database in read-only mode::" msgstr "" -#: ../../library/sqlite3.rst:1260 +#: ../../library/sqlite3.rst:1302 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file::" msgstr "" -#: ../../library/sqlite3.rst:1265 +#: ../../library/sqlite3.rst:1307 msgid "Create a shared named in-memory database::" msgstr "" -#: ../../library/sqlite3.rst:1274 +#: ../../library/sqlite3.rst:1316 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:1280 +#: ../../library/sqlite3.rst:1322 msgid "Using :mod:`sqlite3` efficiently" msgstr "" -#: ../../library/sqlite3.rst:1284 +#: ../../library/sqlite3.rst:1326 msgid "Using shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:1286 +#: ../../library/sqlite3.rst:1328 msgid "" "Using the nonstandard :meth:`execute`, :meth:`executemany` and :meth:" "`executescript` methods of the :class:`Connection` object, your code can be " @@ -1373,27 +1422,27 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:1298 +#: ../../library/sqlite3.rst:1340 msgid "Accessing columns by name instead of by index" msgstr "" -#: ../../library/sqlite3.rst:1300 +#: ../../library/sqlite3.rst:1342 msgid "" "One useful feature of the :mod:`sqlite3` module is the built-in :class:" "`sqlite3.Row` class designed to be used as a row factory." msgstr "" -#: ../../library/sqlite3.rst:1303 +#: ../../library/sqlite3.rst:1345 msgid "" "Rows wrapped with this class can be accessed both by index (like tuples) and " "case-insensitively by name:" msgstr "" -#: ../../library/sqlite3.rst:1312 +#: ../../library/sqlite3.rst:1354 msgid "Using the connection as a context manager" msgstr "" -#: ../../library/sqlite3.rst:1314 +#: ../../library/sqlite3.rst:1356 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1403,23 +1452,23 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:1323 +#: ../../library/sqlite3.rst:1365 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:1328 +#: ../../library/sqlite3.rst:1370 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:1335 +#: ../../library/sqlite3.rst:1377 msgid "Footnotes" msgstr "註解" -#: ../../library/sqlite3.rst:1336 +#: ../../library/sqlite3.rst:1378 msgid "" "The sqlite3 module is not built with loadable extension support by default, " "because some platforms (notably macOS) have SQLite libraries which are " From de0da2d0ddabe40cefb929a650752fa8cc40f849 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 28 Jul 2022 00:19:18 +0000 Subject: [PATCH 3/6] sync with cpython fb422147 --- library/sqlite3.po | 598 ++++++++++++++++++++++----------------------- 1 file changed, 296 insertions(+), 302 deletions(-) diff --git a/library/sqlite3.po b/library/sqlite3.po index 573d5eb336..5cae7601a9 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-27 00:19+0000\n" +"POT-Creation-Date: 2022-07-28 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,7 +26,11 @@ msgstr "" msgid "**Source code:** :source:`Lib/sqlite3/`" msgstr "**原始碼:**\\ :source:`Lib/sqlite3/`" -#: ../../library/sqlite3.rst:13 +#: ../../library/sqlite3.rst:15 ../../library/sqlite3.rst:1057 +msgid "Introduction" +msgstr "簡介" + +#: ../../library/sqlite3.rst:17 msgid "" "SQLite is a C library that provides a lightweight disk-based database that " "doesn't require a separate server process and allows accessing the database " @@ -36,39 +40,43 @@ msgid "" "PostgreSQL or Oracle." msgstr "" -#: ../../library/sqlite3.rst:20 +#: ../../library/sqlite3.rst:24 msgid "" "The sqlite3 module was written by Gerhard Häring. It provides an SQL " "interface compliant with the DB-API 2.0 specification described by :pep:" "`249`, and requires SQLite 3.7.15 or newer." msgstr "" -#: ../../library/sqlite3.rst:24 +#: ../../library/sqlite3.rst:32 +msgid "Tutorial" +msgstr "" + +#: ../../library/sqlite3.rst:34 msgid "" "To use the module, start by creating a :class:`Connection` object that " "represents the database. Here the data will be stored in the :file:`example." "db` file::" msgstr "" -#: ../../library/sqlite3.rst:31 +#: ../../library/sqlite3.rst:41 msgid "" "The special path name ``:memory:`` can be provided to create a temporary " "database in RAM." msgstr "" -#: ../../library/sqlite3.rst:34 +#: ../../library/sqlite3.rst:44 msgid "" "Once a :class:`Connection` has been established, create a :class:`Cursor` " "object and call its :meth:`~Cursor.execute` method to perform SQL commands::" msgstr "" -#: ../../library/sqlite3.rst:53 +#: ../../library/sqlite3.rst:63 msgid "" "The saved data is persistent: it can be reloaded in a subsequent session " "even after restarting the Python interpreter::" msgstr "" -#: ../../library/sqlite3.rst:60 +#: ../../library/sqlite3.rst:70 msgid "" "To retrieve data after executing a SELECT statement, either treat the cursor " "as an :term:`iterator`, call the cursor's :meth:`~Cursor.fetchone` method to " @@ -76,11 +84,11 @@ msgid "" "list of the matching rows." msgstr "" -#: ../../library/sqlite3.rst:65 +#: ../../library/sqlite3.rst:75 msgid "This example uses the iterator form::" msgstr "" -#: ../../library/sqlite3.rst:78 +#: ../../library/sqlite3.rst:88 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -88,7 +96,7 @@ msgid "" "com/327/>`_ for a humorous example of what can go wrong)::" msgstr "" -#: ../../library/sqlite3.rst:87 +#: ../../library/sqlite3.rst:97 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -104,50 +112,50 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:107 +#: ../../library/sqlite3.rst:117 msgid "https://www.sqlite.org" msgstr "https://www.sqlite.org" -#: ../../library/sqlite3.rst:106 +#: ../../library/sqlite3.rst:116 msgid "" "The SQLite web page; the documentation describes the syntax and the " "available data types for the supported SQL dialect." msgstr "" -#: ../../library/sqlite3.rst:110 +#: ../../library/sqlite3.rst:120 msgid "https://www.w3schools.com/sql/" msgstr "https://www.w3schools.com/sql/" -#: ../../library/sqlite3.rst:110 +#: ../../library/sqlite3.rst:120 msgid "Tutorial, reference and examples for learning SQL syntax." msgstr "" -#: ../../library/sqlite3.rst:112 +#: ../../library/sqlite3.rst:122 msgid ":pep:`249` - Database API Specification 2.0" msgstr "" -#: ../../library/sqlite3.rst:113 +#: ../../library/sqlite3.rst:123 msgid "PEP written by Marc-André Lemburg." msgstr "PEP 由 Marc-André Lemburg 撰寫。" -#: ../../library/sqlite3.rst:119 +#: ../../library/sqlite3.rst:129 msgid "Module functions and constants" msgstr "" -#: ../../library/sqlite3.rst:124 +#: ../../library/sqlite3.rst:134 msgid "" "String constant stating the supported DB-API level. Required by the DB-API. " "Hard-coded to ``\"2.0\"``." msgstr "" -#: ../../library/sqlite3.rst:129 +#: ../../library/sqlite3.rst:139 msgid "" "String constant stating the type of parameter marker formatting expected by " "the :mod:`sqlite3` module. Required by the DB-API. Hard-coded to ``\"qmark" "\"``." msgstr "" -#: ../../library/sqlite3.rst:135 +#: ../../library/sqlite3.rst:145 msgid "" "The :mod:`sqlite3` module supports both ``qmark`` and ``numeric`` DB-API " "parameter styles, because that is what the underlying SQLite library " @@ -155,28 +163,30 @@ msgid "" "``paramstyle`` attribute." msgstr "" -#: ../../library/sqlite3.rst:142 +#: ../../library/sqlite3.rst:152 msgid "" -"The version number of this module, as a string. This is not the version of " -"the SQLite library." +"Version number of this module as a :class:`string `. This is not the " +"version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:148 +#: ../../library/sqlite3.rst:158 msgid "" -"The version number of this module, as a tuple of integers. This is not the " -"version of the SQLite library." +"Version number of this module as a :class:`tuple` of :class:`integers " +"`. This is not the version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:154 -msgid "The version number of the run-time SQLite library, as a string." +#: ../../library/sqlite3.rst:164 +msgid "" +"Version number of the runtime SQLite library as a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:159 +#: ../../library/sqlite3.rst:169 msgid "" -"The version number of the run-time SQLite library, as a tuple of integers." +"Version number of the runtime SQLite library as a :class:`tuple` of :class:" +"`integers `." msgstr "" -#: ../../library/sqlite3.rst:164 +#: ../../library/sqlite3.rst:175 msgid "" "Integer constant required by the DB-API, stating the level of thread safety " "the :mod:`sqlite3` module supports. Currently hard-coded to ``1``, meaning *" @@ -185,13 +195,13 @@ msgid "" "time threaded mode using the following query::" msgstr "" -#: ../../library/sqlite3.rst:177 +#: ../../library/sqlite3.rst:188 msgid "" "Note that the `SQLITE_THREADSAFE levels `_ do not match the DB-API 2.0 ``threadsafety`` levels." msgstr "" -#: ../../library/sqlite3.rst:184 +#: ../../library/sqlite3.rst:195 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function using the declared types for each column. The " @@ -200,13 +210,13 @@ msgid "" "converter dictionary key. For example:" msgstr "" -#: ../../library/sqlite3.rst:201 +#: ../../library/sqlite3.rst:212 msgid "" "This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:207 +#: ../../library/sqlite3.rst:218 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function by using the type name, parsed from the query " @@ -214,13 +224,13 @@ msgid "" "in square brackets (``[]``)." msgstr "" -#: ../../library/sqlite3.rst:217 +#: ../../library/sqlite3.rst:228 msgid "" "This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:224 +#: ../../library/sqlite3.rst:235 msgid "Open a connection to an SQLite database." msgstr "" @@ -228,13 +238,13 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/sqlite3.rst:226 +#: ../../library/sqlite3.rst:237 msgid "" "The path to the database file to be opened. Pass ``\":memory:\"`` to open a " "connection to a database that is in RAM instead of on disk." msgstr "" -#: ../../library/sqlite3.rst:232 +#: ../../library/sqlite3.rst:243 msgid "" "How many seconds the connection should wait before raising an exception, if " "the database is locked by another connection. If another connection opens a " @@ -242,7 +252,7 @@ msgid "" "is committed. Default five seconds." msgstr "" -#: ../../library/sqlite3.rst:240 +#: ../../library/sqlite3.rst:251 msgid "" "Control whether and how data types not :ref:`natively supported by SQLite " "` are looked up to be converted to Python types, using the " @@ -255,7 +265,7 @@ msgid "" "disabled." msgstr "" -#: ../../library/sqlite3.rst:255 +#: ../../library/sqlite3.rst:266 msgid "" "The :attr:`~Connection.isolation_level` of the connection, controlling " "whether and how transactions are implicitly opened. Can be ``\"DEFERRED\"`` " @@ -264,7 +274,7 @@ msgid "" "transactions` for more." msgstr "" -#: ../../library/sqlite3.rst:263 +#: ../../library/sqlite3.rst:274 msgid "" "If :const:`True` (default), only the creating thread may use the connection. " "If :const:`False`, the connection may be shared across multiple threads; if " @@ -272,19 +282,19 @@ msgid "" "corruption." msgstr "" -#: ../../library/sqlite3.rst:270 +#: ../../library/sqlite3.rst:281 msgid "" "A custom subclass of :class:`Connection` to create the connection with, if " "not the default :class:`Connection` class." msgstr "" -#: ../../library/sqlite3.rst:275 +#: ../../library/sqlite3.rst:286 msgid "" "The number of statements that ``sqlite3`` should internally cache for this " "connection, to avoid parsing overhead. By default, 100 statements." msgstr "" -#: ../../library/sqlite3.rst:281 +#: ../../library/sqlite3.rst:292 msgid "" "If set to :const:`True`, *database* is interpreted as a :abbr:`URI (Uniform " "Resource Identifier)` with a file path and an optional query string. The " @@ -297,32 +307,32 @@ msgstr "" msgid "Return type" msgstr "" -#: ../../library/sqlite3.rst:293 +#: ../../library/sqlite3.rst:304 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" -#: ../../library/sqlite3.rst:294 +#: ../../library/sqlite3.rst:305 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." msgstr "" -#: ../../library/sqlite3.rst:296 +#: ../../library/sqlite3.rst:307 msgid "The *uri* parameter." msgstr "*uri* 參數。" -#: ../../library/sqlite3.rst:299 +#: ../../library/sqlite3.rst:310 msgid "" "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" -#: ../../library/sqlite3.rst:302 +#: ../../library/sqlite3.rst:313 msgid "The ``sqlite3.connect/handle`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:308 +#: ../../library/sqlite3.rst:319 msgid "" "Register the *converter* callable to convert SQLite objects of type " "*typename* into a Python object of a specific type. The converter is invoked " @@ -332,13 +342,13 @@ msgid "" "type detection works." msgstr "" -#: ../../library/sqlite3.rst:316 +#: ../../library/sqlite3.rst:327 msgid "" "Note: *typename* and the name of the type in your query are matched case-" "insensitively." msgstr "" -#: ../../library/sqlite3.rst:322 +#: ../../library/sqlite3.rst:333 msgid "" "Register an *adapter* callable to adapt the Python type *type* into an " "SQLite type. The adapter is called with a Python object of type *type* as " @@ -346,7 +356,7 @@ msgid "" "natively understands`." msgstr "" -#: ../../library/sqlite3.rst:331 +#: ../../library/sqlite3.rst:342 msgid "" "Returns :const:`True` if the string *statement* contains one or more " "complete SQL statements terminated by semicolons. It does not verify that " @@ -354,29 +364,29 @@ msgid "" "literals and the statement is terminated by a semicolon." msgstr "" -#: ../../library/sqlite3.rst:336 +#: ../../library/sqlite3.rst:347 msgid "" "This can be used to build a shell for SQLite, as in the following example:" msgstr "" -#: ../../library/sqlite3.rst:344 +#: ../../library/sqlite3.rst:355 msgid "" -"By default you will not get any tracebacks in user-defined functions, " -"aggregates, converters, authorizer callbacks etc. If you want to debug them, " -"you can call this function with *flag* set to ``True``. Afterwards, you will " -"get tracebacks from callbacks on ``sys.stderr``. Use :const:`False` to " -"disable the feature again." +"Enable or disable callback tracebacks. By default you will not get any " +"tracebacks in user-defined functions, aggregates, converters, authorizer " +"callbacks etc. If you want to debug them, you can call this function with " +"*flag* set to ``True``. Afterwards, you will get tracebacks from callbacks " +"on ``sys.stderr``. Use :const:`False` to disable the feature again." msgstr "" -#: ../../library/sqlite3.rst:354 +#: ../../library/sqlite3.rst:366 msgid "Connection Objects" msgstr "" -#: ../../library/sqlite3.rst:358 +#: ../../library/sqlite3.rst:370 msgid "An SQLite database connection has the following attributes and methods:" msgstr "" -#: ../../library/sqlite3.rst:362 +#: ../../library/sqlite3.rst:374 msgid "" "This attribute controls the :ref:`transaction handling ` performed by ``sqlite3``. If set to :const:`None`, " @@ -386,90 +396,90 @@ msgid "" "` is performed." msgstr "" -#: ../../library/sqlite3.rst:370 +#: ../../library/sqlite3.rst:382 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: ../../library/sqlite3.rst:375 +#: ../../library/sqlite3.rst:387 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:378 +#: ../../library/sqlite3.rst:390 msgid "" ":const:`True` if a transaction is active (there are uncommitted changes), :" "const:`False` otherwise." msgstr "" -#: ../../library/sqlite3.rst:385 +#: ../../library/sqlite3.rst:397 msgid "" -"The cursor method accepts a single optional parameter *factory*. If " -"supplied, this must be a callable returning an instance of :class:`Cursor` " -"or its subclasses." +"Create and return a :class:`Cursor` object. The cursor method accepts a " +"single optional parameter *factory*. If supplied, this must be a callable " +"returning an instance of :class:`Cursor` or its subclasses." msgstr "" -#: ../../library/sqlite3.rst:391 +#: ../../library/sqlite3.rst:404 msgid "" "Commit any pending transaction to the database. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:396 +#: ../../library/sqlite3.rst:409 msgid "" "Roll back to the start of any pending transaction. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:401 +#: ../../library/sqlite3.rst:414 msgid "" "Close the database connection. Any pending transaction is not committed " "implicitly; make sure to :meth:`commit` before closing to avoid losing " "pending changes." msgstr "" -#: ../../library/sqlite3.rst:408 +#: ../../library/sqlite3.rst:421 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it " "with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:414 +#: ../../library/sqlite3.rst:427 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on " "it with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:420 +#: ../../library/sqlite3.rst:433 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executescript` " "on it with the given *sql_script*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:426 +#: ../../library/sqlite3.rst:439 msgid "Create or remove a user-defined SQL function." msgstr "" -#: ../../library/sqlite3.rst:428 +#: ../../library/sqlite3.rst:441 msgid "The name of the SQL function." msgstr "" -#: ../../library/sqlite3.rst:432 +#: ../../library/sqlite3.rst:445 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:437 +#: ../../library/sqlite3.rst:450 msgid "" "A callable that is called when the SQL function is invoked. The callable " "must return :ref:`a type natively supported by SQLite `. Set " "to :const:`None` to remove an existing SQL function." msgstr "" -#: ../../library/sqlite3.rst:444 +#: ../../library/sqlite3.rst:457 msgid "" "If :const:`True`, the created SQL function is marked as `deterministic " "`_, which allows SQLite to perform " @@ -480,35 +490,36 @@ msgstr "" msgid "Raises" msgstr "" -#: ../../library/sqlite3.rst:450 +#: ../../library/sqlite3.rst:463 msgid "If *deterministic* is used with SQLite versions older than 3.8.3." msgstr "" -#: ../../library/sqlite3.rst:453 +#: ../../library/sqlite3.rst:466 #, fuzzy msgid "The *deterministic* parameter." msgstr "新增 *deterministic* 參數。" -#: ../../library/sqlite3.rst:456 ../../library/sqlite3.rst:487 -#: ../../library/sqlite3.rst:618 ../../library/sqlite3.rst:792 +#: ../../library/sqlite3.rst:469 ../../library/sqlite3.rst:500 +#: ../../library/sqlite3.rst:630 ../../library/sqlite3.rst:652 +#: ../../library/sqlite3.rst:801 msgid "Example:" msgstr "範例:" -#: ../../library/sqlite3.rst:463 +#: ../../library/sqlite3.rst:476 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:465 +#: ../../library/sqlite3.rst:478 msgid "The name of the SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:469 +#: ../../library/sqlite3.rst:482 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:474 +#: ../../library/sqlite3.rst:487 msgid "" "A class must implement the following methods: * ``step()``: Add a row to " "the aggregate. * ``finalize()``: Return the final result of the aggregate " @@ -517,65 +528,64 @@ msgid "" "*n_arg*. Set to :const:`None` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:475 +#: ../../library/sqlite3.rst:488 msgid "A class must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:477 +#: ../../library/sqlite3.rst:490 msgid "``step()``: Add a row to the aggregate." msgstr "" -#: ../../library/sqlite3.rst:478 +#: ../../library/sqlite3.rst:491 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" -#: ../../library/sqlite3.rst:481 +#: ../../library/sqlite3.rst:494 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" -#: ../../library/sqlite3.rst:484 +#: ../../library/sqlite3.rst:497 msgid "Set to :const:`None` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:494 +#: ../../library/sqlite3.rst:507 msgid "" "Create a collation named *name* using the collating function *callable*. " "*callable* is passed two :class:`string ` arguments, and it should " "return an :class:`integer `:" msgstr "" -#: ../../library/sqlite3.rst:498 +#: ../../library/sqlite3.rst:511 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: ../../library/sqlite3.rst:499 +#: ../../library/sqlite3.rst:512 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: ../../library/sqlite3.rst:500 +#: ../../library/sqlite3.rst:513 msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:502 +#: ../../library/sqlite3.rst:515 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:506 +#: ../../library/sqlite3.rst:519 msgid "Remove a collation function by setting *callable* to :const:`None`." msgstr "" -#: ../../library/sqlite3.rst:511 +#: ../../library/sqlite3.rst:524 msgid "" -"You can call this method from a different thread to abort any queries that " -"might be executing on the connection. The query will then abort and the " -"caller will get an exception." +"Call this method from a different thread to abort any queries that might be " +"executing on the connection. Aborted queries will raise an exception." msgstr "" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:531 msgid "" "Register callable *authorizer_callback* to be invoked for each attempt to " "access a column of a table in the database. The callback should return :" @@ -585,7 +595,7 @@ msgid "" "in the :mod:`sqlite3` module." msgstr "" -#: ../../library/sqlite3.rst:525 +#: ../../library/sqlite3.rst:538 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or :const:`None` " @@ -596,7 +606,7 @@ msgid "" "code." msgstr "" -#: ../../library/sqlite3.rst:532 +#: ../../library/sqlite3.rst:545 msgid "" "Please consult the SQLite documentation about the possible values for the " "first argument and the meaning of the second and third argument depending on " @@ -604,7 +614,7 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:539 +#: ../../library/sqlite3.rst:552 msgid "" "Register callable *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -612,26 +622,26 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:544 +#: ../../library/sqlite3.rst:557 msgid "" "If you want to clear any previously installed progress handler, call the " "method with :const:`None` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:547 +#: ../../library/sqlite3.rst:560 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise an :exc:`OperationalError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:554 +#: ../../library/sqlite3.rst:567 msgid "" "Register callable *trace_callback* to be invoked for each SQL statement that " "is actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:557 +#: ../../library/sqlite3.rst:570 msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " @@ -641,19 +651,19 @@ msgid "" "of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:565 +#: ../../library/sqlite3.rst:578 msgid "" "Passing :const:`None` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:568 +#: ../../library/sqlite3.rst:581 msgid "" "Exceptions raised in the trace callback are not propagated. As a development " "and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable " "printing tracebacks from exceptions raised in the trace callback." msgstr "" -#: ../../library/sqlite3.rst:578 +#: ../../library/sqlite3.rst:591 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is :const:`True`; else, disallow loading SQLite extensions. SQLite " @@ -662,46 +672,45 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:585 ../../library/sqlite3.rst:602 +#: ../../library/sqlite3.rst:598 ../../library/sqlite3.rst:615 msgid "Loadable extensions are disabled by default. See [#f1]_." msgstr "" -#: ../../library/sqlite3.rst:587 +#: ../../library/sqlite3.rst:600 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" -#: ../../library/sqlite3.rst:591 +#: ../../library/sqlite3.rst:604 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:598 +#: ../../library/sqlite3.rst:611 msgid "" "Load an SQLite extension from a shared library located at *path*. Enable " "extension loading with :meth:`enable_load_extension` before calling this " "method." msgstr "" -#: ../../library/sqlite3.rst:604 +#: ../../library/sqlite3.rst:617 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" -#: ../../library/sqlite3.rst:608 +#: ../../library/sqlite3.rst:621 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:613 +#: ../../library/sqlite3.rst:626 msgid "" -"You can change this attribute to a callable that accepts the cursor and the " -"original row as a tuple and will return the real result row. This way, you " -"can implement more advanced ways of returning results, such as returning an " -"object that can also access columns by name." +"A callable that accepts two arguments, a :class:`Cursor` object and the raw " +"row results as a :class:`tuple`, and returns a custom object representing an " +"SQLite row." msgstr "" -#: ../../library/sqlite3.rst:622 +#: ../../library/sqlite3.rst:634 msgid "" "If returning a tuple doesn't suffice and you want name-based access to " "columns, you should consider setting :attr:`row_factory` to the highly " @@ -711,66 +720,55 @@ msgid "" "approach or even a db_row based solution." msgstr "" -#: ../../library/sqlite3.rst:634 -msgid "" -"Using this attribute you can control what objects are returned for the " -"``TEXT`` data type. By default, this attribute is set to :class:`str` and " -"the :mod:`sqlite3` module will return :class:`str` objects for ``TEXT``. If " -"you want to return :class:`bytes` instead, you can set it to :class:`bytes`." -msgstr "" - -#: ../../library/sqlite3.rst:639 +#: ../../library/sqlite3.rst:646 msgid "" -"You can also set it to any other callable that accepts a single bytestring " -"parameter and returns the resulting object." +"A callable that accepts a :class:`bytes` parameter and returns a text " +"representation of it. The callable is invoked for SQLite values with the " +"``TEXT`` data type. By default, this attribute is set to :class:`str`. If " +"you want to return ``bytes`` instead, set *text_factory* to ``bytes``." msgstr "" -#: ../../library/sqlite3.rst:642 -msgid "See the following example code for illustration:" -msgstr "" - -#: ../../library/sqlite3.rst:649 +#: ../../library/sqlite3.rst:659 msgid "" -"Returns the total number of database rows that have been modified, inserted, " +"Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:655 +#: ../../library/sqlite3.rst:665 msgid "" -"Returns an iterator to dump the database in an SQL text format. Useful when " -"saving an in-memory database for later restoration. This function provides " -"the same capabilities as the :kbd:`.dump` command in the :program:`sqlite3` " -"shell." +"Return an :term:`iterator` to dump the database as SQL source code. Useful " +"when saving an in-memory database for later restoration. Similar to the ``." +"dump`` command in the :program:`sqlite3` shell." msgstr "" -#: ../../library/sqlite3.rst:660 +#: ../../library/sqlite3.rst:669 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/sqlite3.rst:674 +#: ../../library/sqlite3.rst:683 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:676 +#: ../../library/sqlite3.rst:685 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:679 +#: ../../library/sqlite3.rst:688 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:683 +#: ../../library/sqlite3.rst:692 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:690 +#: ../../library/sqlite3.rst:699 msgid "" "If set to a callable, it is invoked with three integer arguments for every " "backup iteration: the *status* of the last iteration, the *remaining* number " @@ -778,43 +776,43 @@ msgid "" "const:`None`." msgstr "" -#: ../../library/sqlite3.rst:699 +#: ../../library/sqlite3.rst:708 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statment." msgstr "" -#: ../../library/sqlite3.rst:707 +#: ../../library/sqlite3.rst:716 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:712 +#: ../../library/sqlite3.rst:721 msgid "Example 1, copy an existing database into another::" msgstr "" -#: ../../library/sqlite3.rst:726 +#: ../../library/sqlite3.rst:735 msgid "Example 2, copy an existing database into a transient copy::" msgstr "" -#: ../../library/sqlite3.rst:740 +#: ../../library/sqlite3.rst:749 msgid "Cursor Objects" msgstr "" -#: ../../library/sqlite3.rst:744 +#: ../../library/sqlite3.rst:753 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:751 +#: ../../library/sqlite3.rst:760 msgid "" "Execute SQL statement *sql*. Bind values to the statement using :ref:" "`placeholders ` that map to the :term:`sequence` or :" "class:`dict` *parameters*." msgstr "" -#: ../../library/sqlite3.rst:756 +#: ../../library/sqlite3.rst:765 msgid "" ":meth:`execute` will only execute a single SQL statement. If you try to " "execute more than one statement with it, it will raise a :exc:`Warning`. " @@ -822,7 +820,7 @@ msgid "" "with one call." msgstr "" -#: ../../library/sqlite3.rst:761 +#: ../../library/sqlite3.rst:770 msgid "" "If :attr:`~Connection.isolation_level` is not :const:`None`, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " @@ -830,20 +828,20 @@ msgid "" "*sql*." msgstr "" -#: ../../library/sqlite3.rst:769 +#: ../../library/sqlite3.rst:778 msgid "" "Execute :ref:`parameterized ` SQL statement *sql* " "against all parameter sequences or mappings found in the sequence " -"*seq_of_parameters*. It is also possible to use an :term:`iterator` " -"yielding parameters instead of a sequence. Uses the same implicit " -"transaction handling as :meth:`~Cursor.execute`." +"*parameters*. It is also possible to use an :term:`iterator` yielding " +"parameters instead of a sequence. Uses the same implicit transaction " +"handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:777 +#: ../../library/sqlite3.rst:786 msgid "Here's a shorter example using a :term:`generator`:" msgstr "" -#: ../../library/sqlite3.rst:784 +#: ../../library/sqlite3.rst:793 msgid "" "Execute the SQL statements in *sql_script*. If there is a pending " "transaciton, an implicit ``COMMIT`` statement is executed first. No other " @@ -851,32 +849,31 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:790 +#: ../../library/sqlite3.rst:799 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:799 +#: ../../library/sqlite3.rst:808 msgid "" -"Fetches the next row of a query result set, returning a single sequence, or :" -"const:`None` when no more data is available." +"Fetch the next row of a query result set as a :class:`tuple`. Return :const:" +"`None` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:805 +#: ../../library/sqlite3.rst:814 msgid "" -"Fetches the next set of rows of a query result, returning a list. An empty " -"list is returned when no more rows are available." +"Fetch the next set of rows of a query result as a :class:`list`. Return an " +"empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:808 +#: ../../library/sqlite3.rst:817 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " -"If it is not given, the cursor's arraysize determines the number of rows to " -"be fetched. The method should try to fetch as many rows as indicated by the " -"size parameter. If this is not possible due to the specified number of rows " -"not being available, fewer rows may be returned." +"If *size* is not given, :attr:`arraysize` determines the number of rows to " +"be fetched. If fewer than *size* rows are available, as many rows as are " +"available are returned." msgstr "" -#: ../../library/sqlite3.rst:814 +#: ../../library/sqlite3.rst:823 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -884,29 +881,29 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:821 +#: ../../library/sqlite3.rst:830 msgid "" -"Fetches all (remaining) rows of a query result, returning a list. Note that " -"the cursor's arraysize attribute can affect the performance of this " -"operation. An empty list is returned when no rows are available." +"Fetch all (remaining) rows of a query result as a :class:`list`. Return an " +"empty list if no rows are available. Note that the :attr:`arraysize` " +"attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:827 +#: ../../library/sqlite3.rst:837 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:829 +#: ../../library/sqlite3.rst:839 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: ../../library/sqlite3.rst:834 ../../library/sqlite3.rst:838 +#: ../../library/sqlite3.rst:844 ../../library/sqlite3.rst:848 msgid "Required by the DB-API. Does nothing in :mod:`sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:842 +#: ../../library/sqlite3.rst:852 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -915,9 +912,9 @@ msgid "" "methods." msgstr "" -#: ../../library/sqlite3.rst:850 +#: ../../library/sqlite3.rst:860 msgid "" -"This read-only attribute provides the row id of the last inserted row. It is " +"Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " "the :meth:`execute` method. For other statements, after :meth:`executemany` " "or :meth:`executescript`, or if the insertion failed, the value of " @@ -925,101 +922,102 @@ msgid "" "const:`None`." msgstr "" -#: ../../library/sqlite3.rst:858 +#: ../../library/sqlite3.rst:868 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:860 +#: ../../library/sqlite3.rst:870 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:865 +#: ../../library/sqlite3.rst:875 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: ../../library/sqlite3.rst:870 +#: ../../library/sqlite3.rst:880 msgid "" -"This read-only attribute provides the column names of the last query. To " +"Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are :const:`None`." msgstr "" -#: ../../library/sqlite3.rst:874 +#: ../../library/sqlite3.rst:884 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:878 +#: ../../library/sqlite3.rst:888 msgid "" -"This read-only attribute provides the SQLite database :class:`Connection` " -"used by the :class:`Cursor` object. A :class:`Cursor` object created by " -"calling :meth:`con.cursor() ` will have a :attr:" -"`connection` attribute that refers to *con*::" +"Read-only attribute that provides the SQLite database :class:`Connection` " +"belonging to the cursor. A :class:`Cursor` object created by calling :meth:" +"`con.cursor() ` will have a :attr:`connection` attribute " +"that refers to *con*::" msgstr "" -#: ../../library/sqlite3.rst:891 +#: ../../library/sqlite3.rst:901 msgid "Row Objects" msgstr "" -#: ../../library/sqlite3.rst:895 +#: ../../library/sqlite3.rst:905 msgid "" "A :class:`Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It tries to mimic a tuple in " "most of its features." msgstr "" -#: ../../library/sqlite3.rst:899 +#: ../../library/sqlite3.rst:909 msgid "" "It supports mapping access by column name and index, iteration, " "representation, equality testing and :func:`len`." msgstr "" -#: ../../library/sqlite3.rst:902 +#: ../../library/sqlite3.rst:912 msgid "" "If two :class:`Row` objects have exactly the same columns and their members " "are equal, they compare equal." msgstr "" -#: ../../library/sqlite3.rst:907 +#: ../../library/sqlite3.rst:917 msgid "" -"This method returns a list of column names. Immediately after a query, it is " -"the first member of each tuple in :attr:`Cursor.description`." +"Return a :class:`list` of column names as :class:`strings `. " +"Immediately after a query, it is the first member of each tuple in :attr:" +"`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:910 +#: ../../library/sqlite3.rst:921 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:913 +#: ../../library/sqlite3.rst:924 msgid "Let's assume we initialize a table as in the example given above::" msgstr "" -#: ../../library/sqlite3.rst:925 +#: ../../library/sqlite3.rst:936 msgid "Now we plug :class:`Row` in::" msgstr "" -#: ../../library/sqlite3.rst:955 +#: ../../library/sqlite3.rst:966 msgid "PrepareProtocol Objects" msgstr "" -#: ../../library/sqlite3.rst:959 +#: ../../library/sqlite3.rst:970 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:967 +#: ../../library/sqlite3.rst:978 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:969 +#: ../../library/sqlite3.rst:980 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:973 +#: ../../library/sqlite3.rst:984 msgid "" "This exception is raised by ``sqlite3`` if an SQL query is not a :class:" "`string `, or if multiple statements are passed to :meth:`~Cursor." @@ -1027,21 +1025,21 @@ msgid "" "`Exception`." msgstr "" -#: ../../library/sqlite3.rst:980 +#: ../../library/sqlite3.rst:991 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:986 +#: ../../library/sqlite3.rst:997 msgid "" "This exception is raised by ``sqlite3`` for fetch across rollback, or if " "``sqlite3`` is unable to bind parameters. ``InterfaceError`` is a subclass " "of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:992 +#: ../../library/sqlite3.rst:1003 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1049,14 +1047,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:999 +#: ../../library/sqlite3.rst:1010 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1005 +#: ../../library/sqlite3.rst:1016 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1064,20 +1062,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1013 +#: ../../library/sqlite3.rst:1024 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1018 +#: ../../library/sqlite3.rst:1029 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1025 +#: ../../library/sqlite3.rst:1036 msgid "" "Exception raised for ``sqlite3`` API programming errors, for example trying " "to operate on a closed :class:`Connection`, or trying to execute non-DML " @@ -1085,7 +1083,7 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1032 +#: ../../library/sqlite3.rst:1043 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to :const:" @@ -1094,82 +1092,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1042 +#: ../../library/sqlite3.rst:1053 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1046 -msgid "Introduction" -msgstr "簡介" - -#: ../../library/sqlite3.rst:1048 +#: ../../library/sqlite3.rst:1059 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1051 +#: ../../library/sqlite3.rst:1062 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1054 ../../library/sqlite3.rst:1071 +#: ../../library/sqlite3.rst:1065 ../../library/sqlite3.rst:1082 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1054 ../../library/sqlite3.rst:1071 +#: ../../library/sqlite3.rst:1065 ../../library/sqlite3.rst:1082 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1056 ../../library/sqlite3.rst:1073 +#: ../../library/sqlite3.rst:1067 ../../library/sqlite3.rst:1084 msgid ":const:`None`" msgstr ":const:`None`" -#: ../../library/sqlite3.rst:1056 ../../library/sqlite3.rst:1073 +#: ../../library/sqlite3.rst:1067 ../../library/sqlite3.rst:1084 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1058 ../../library/sqlite3.rst:1075 +#: ../../library/sqlite3.rst:1069 ../../library/sqlite3.rst:1086 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1058 ../../library/sqlite3.rst:1075 +#: ../../library/sqlite3.rst:1069 ../../library/sqlite3.rst:1086 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1060 ../../library/sqlite3.rst:1077 +#: ../../library/sqlite3.rst:1071 ../../library/sqlite3.rst:1088 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1060 ../../library/sqlite3.rst:1077 +#: ../../library/sqlite3.rst:1071 ../../library/sqlite3.rst:1088 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1062 +#: ../../library/sqlite3.rst:1073 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1062 ../../library/sqlite3.rst:1079 +#: ../../library/sqlite3.rst:1073 ../../library/sqlite3.rst:1090 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1064 ../../library/sqlite3.rst:1082 +#: ../../library/sqlite3.rst:1075 ../../library/sqlite3.rst:1093 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1064 ../../library/sqlite3.rst:1082 +#: ../../library/sqlite3.rst:1075 ../../library/sqlite3.rst:1093 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1068 +#: ../../library/sqlite3.rst:1079 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1079 +#: ../../library/sqlite3.rst:1090 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1085 +#: ../../library/sqlite3.rst:1096 msgid "" "The type system of the :mod:`sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via object " @@ -1177,18 +1171,18 @@ msgid "" "to different Python types via converters." msgstr "" -#: ../../library/sqlite3.rst:1092 +#: ../../library/sqlite3.rst:1103 msgid "Using adapters to store custom Python types in SQLite databases" msgstr "" -#: ../../library/sqlite3.rst:1094 +#: ../../library/sqlite3.rst:1105 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands`." msgstr "" -#: ../../library/sqlite3.rst:1098 +#: ../../library/sqlite3.rst:1109 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1198,11 +1192,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1110 +#: ../../library/sqlite3.rst:1121 msgid "Letting your object adapt itself" msgstr "" -#: ../../library/sqlite3.rst:1112 +#: ../../library/sqlite3.rst:1123 msgid "" "Suppose we have a ``Point`` class that represents a pair of coordinates, " "``x`` and ``y``, in a Cartesian coordinate system. The coordinate pair will " @@ -1212,107 +1206,107 @@ msgid "" "*protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1124 +#: ../../library/sqlite3.rst:1135 msgid "Registering an adapter callable" msgstr "" -#: ../../library/sqlite3.rst:1126 +#: ../../library/sqlite3.rst:1137 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1134 +#: ../../library/sqlite3.rst:1145 msgid "Converting SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1136 +#: ../../library/sqlite3.rst:1147 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1141 +#: ../../library/sqlite3.rst:1152 msgid "" "Let's go back to the :class:`Point` class. We stored the x and y coordinates " "separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1144 +#: ../../library/sqlite3.rst:1155 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1149 +#: ../../library/sqlite3.rst:1160 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1158 +#: ../../library/sqlite3.rst:1169 msgid "" "We now need to tell ``sqlite3`` when it should convert a given SQLite value. " "This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:1162 +#: ../../library/sqlite3.rst:1173 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1163 +#: ../../library/sqlite3.rst:1174 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1164 +#: ../../library/sqlite3.rst:1175 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1168 +#: ../../library/sqlite3.rst:1179 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:1174 +#: ../../library/sqlite3.rst:1185 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1176 +#: ../../library/sqlite3.rst:1187 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1179 +#: ../../library/sqlite3.rst:1190 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1183 +#: ../../library/sqlite3.rst:1194 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1187 +#: ../../library/sqlite3.rst:1198 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1191 +#: ../../library/sqlite3.rst:1202 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1197 +#: ../../library/sqlite3.rst:1208 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1320,25 +1314,25 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1206 +#: ../../library/sqlite3.rst:1217 msgid "Adapter and Converter Recipes" msgstr "" -#: ../../library/sqlite3.rst:1208 +#: ../../library/sqlite3.rst:1219 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:1251 +#: ../../library/sqlite3.rst:1262 msgid "Controlling Transactions" msgstr "" -#: ../../library/sqlite3.rst:1253 +#: ../../library/sqlite3.rst:1264 msgid "" "The ``sqlite3`` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:1256 +#: ../../library/sqlite3.rst:1267 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not :" "const:`None`, new transactions are implicitly opened before :meth:`~Cursor." @@ -1351,7 +1345,7 @@ msgid "" "isolation_level` attribute." msgstr "" -#: ../../library/sqlite3.rst:1268 +#: ../../library/sqlite3.rst:1279 msgid "" "If :attr:`~Connection.isolation_level` is set to :const:`None`, no " "transactions are implicitly opened at all. This leaves the underlying SQLite " @@ -1361,56 +1355,56 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:1276 +#: ../../library/sqlite3.rst:1287 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:1280 +#: ../../library/sqlite3.rst:1291 msgid "" ":mod:`sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:1294 +#: ../../library/sqlite3.rst:1305 msgid "SQLite URI tricks" msgstr "" -#: ../../library/sqlite3.rst:1296 +#: ../../library/sqlite3.rst:1307 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:1298 +#: ../../library/sqlite3.rst:1309 msgid "Open a database in read-only mode::" msgstr "" -#: ../../library/sqlite3.rst:1302 +#: ../../library/sqlite3.rst:1313 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file::" msgstr "" -#: ../../library/sqlite3.rst:1307 +#: ../../library/sqlite3.rst:1318 msgid "Create a shared named in-memory database::" msgstr "" -#: ../../library/sqlite3.rst:1316 +#: ../../library/sqlite3.rst:1327 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:1322 +#: ../../library/sqlite3.rst:1333 msgid "Using :mod:`sqlite3` efficiently" msgstr "" -#: ../../library/sqlite3.rst:1326 +#: ../../library/sqlite3.rst:1337 msgid "Using shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:1328 +#: ../../library/sqlite3.rst:1339 msgid "" "Using the nonstandard :meth:`execute`, :meth:`executemany` and :meth:" "`executescript` methods of the :class:`Connection` object, your code can be " @@ -1422,27 +1416,27 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:1340 +#: ../../library/sqlite3.rst:1351 msgid "Accessing columns by name instead of by index" msgstr "" -#: ../../library/sqlite3.rst:1342 +#: ../../library/sqlite3.rst:1353 msgid "" "One useful feature of the :mod:`sqlite3` module is the built-in :class:" "`sqlite3.Row` class designed to be used as a row factory." msgstr "" -#: ../../library/sqlite3.rst:1345 +#: ../../library/sqlite3.rst:1356 msgid "" "Rows wrapped with this class can be accessed both by index (like tuples) and " "case-insensitively by name:" msgstr "" -#: ../../library/sqlite3.rst:1354 +#: ../../library/sqlite3.rst:1365 msgid "Using the connection as a context manager" msgstr "" -#: ../../library/sqlite3.rst:1356 +#: ../../library/sqlite3.rst:1367 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1452,23 +1446,23 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:1365 +#: ../../library/sqlite3.rst:1376 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:1370 +#: ../../library/sqlite3.rst:1381 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:1377 +#: ../../library/sqlite3.rst:1388 msgid "Footnotes" msgstr "註解" -#: ../../library/sqlite3.rst:1378 +#: ../../library/sqlite3.rst:1389 msgid "" "The sqlite3 module is not built with loadable extension support by default, " "because some platforms (notably macOS) have SQLite libraries which are " From 5bc3aee9f28bb192170c9d15e9c09c2f4c83a335 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Thu, 28 Jul 2022 09:42:00 +0800 Subject: [PATCH 4/6] fix: resolve fuzzy entry --- library/sqlite3.po | 1 - 1 file changed, 1 deletion(-) diff --git a/library/sqlite3.po b/library/sqlite3.po index 5cae7601a9..d53172b394 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -495,7 +495,6 @@ msgid "If *deterministic* is used with SQLite versions older than 3.8.3." msgstr "" #: ../../library/sqlite3.rst:466 -#, fuzzy msgid "The *deterministic* parameter." msgstr "新增 *deterministic* 參數。" From 629f8d972f622dd5545c390a08b451c865a6b506 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 29 Jul 2022 00:17:41 +0000 Subject: [PATCH 5/6] sync with cpython b9b70dd4 --- library/concurrent.futures.po | 142 ++++++++++++++++++---------------- library/sqlite3.po | 28 +++---- 2 files changed, 90 insertions(+), 80 deletions(-) diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index f57d5dc7c9..41abd7740c 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-05 00:10+0000\n" +"POT-Creation-Date: 2022-07-29 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -179,6 +179,16 @@ msgstr "" #: ../../library/concurrent.futures.rst:152 msgid "" +"All threads enqueued to ``ThreadPoolExecutor`` will be joined before the " +"interpreter can exit. Note that the exit handler which does this is executed " +"*before* any exit handlers added using `atexit`. This means exceptions in " +"the main thread must be caught and handled in order to signal threads to " +"exit gracefully. For this reason, it is recommended that " +"``ThreadPoolExecutor`` not be used for long-running tasks." +msgstr "" + +#: ../../library/concurrent.futures.rst:159 +msgid "" "*initializer* is an optional callable that is called at the start of each " "worker thread; *initargs* is a tuple of arguments passed to the " "initializer. Should *initializer* raise an exception, all currently pending " @@ -186,7 +196,7 @@ msgid "" "well as any attempt to submit more jobs to the pool." msgstr "" -#: ../../library/concurrent.futures.rst:158 +#: ../../library/concurrent.futures.rst:165 msgid "" "If *max_workers* is ``None`` or not given, it will default to the number of " "processors on the machine, multiplied by ``5``, assuming that :class:" @@ -195,19 +205,19 @@ msgid "" "`ProcessPoolExecutor`." msgstr "" -#: ../../library/concurrent.futures.rst:166 +#: ../../library/concurrent.futures.rst:173 msgid "" "The *thread_name_prefix* argument was added to allow users to control the :" "class:`threading.Thread` names for worker threads created by the pool for " "easier debugging." msgstr "" -#: ../../library/concurrent.futures.rst:171 -#: ../../library/concurrent.futures.rst:265 +#: ../../library/concurrent.futures.rst:178 +#: ../../library/concurrent.futures.rst:272 msgid "Added the *initializer* and *initargs* arguments." msgstr "新增 *initializer* 與 *initargs* 引數。" -#: ../../library/concurrent.futures.rst:174 +#: ../../library/concurrent.futures.rst:181 msgid "" "Default value of *max_workers* is changed to ``min(32, os.cpu_count() + " "4)``. This default value preserves at least 5 workers for I/O bound tasks. " @@ -215,21 +225,21 @@ msgid "" "And it avoids using very large resources implicitly on many-core machines." msgstr "" -#: ../../library/concurrent.futures.rst:180 +#: ../../library/concurrent.futures.rst:187 msgid "" "ThreadPoolExecutor now reuses idle worker threads before starting " "*max_workers* worker threads too." msgstr "" -#: ../../library/concurrent.futures.rst:187 +#: ../../library/concurrent.futures.rst:194 msgid "ThreadPoolExecutor Example" msgstr "ThreadPoolExecutor 範例" -#: ../../library/concurrent.futures.rst:219 +#: ../../library/concurrent.futures.rst:226 msgid "ProcessPoolExecutor" msgstr "ProcessPoolExecutor" -#: ../../library/concurrent.futures.rst:221 +#: ../../library/concurrent.futures.rst:228 msgid "" "The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that " "uses a pool of processes to execute calls asynchronously. :class:" @@ -239,20 +249,20 @@ msgid "" "returned." msgstr "" -#: ../../library/concurrent.futures.rst:228 +#: ../../library/concurrent.futures.rst:235 msgid "" "The ``__main__`` module must be importable by worker subprocesses. This " "means that :class:`ProcessPoolExecutor` will not work in the interactive " "interpreter." msgstr "" -#: ../../library/concurrent.futures.rst:231 +#: ../../library/concurrent.futures.rst:238 msgid "" "Calling :class:`Executor` or :class:`Future` methods from a callable " "submitted to a :class:`ProcessPoolExecutor` will result in deadlock." msgstr "" -#: ../../library/concurrent.futures.rst:236 +#: ../../library/concurrent.futures.rst:243 msgid "" "An :class:`Executor` subclass that executes calls asynchronously using a " "pool of at most *max_workers* processes. If *max_workers* is ``None`` or " @@ -266,7 +276,7 @@ msgid "" "not given, the default multiprocessing context is used." msgstr "" -#: ../../library/concurrent.futures.rst:249 +#: ../../library/concurrent.futures.rst:256 msgid "" "*initializer* is an optional callable that is called at the start of each " "worker process; *initargs* is a tuple of arguments passed to the " @@ -275,7 +285,7 @@ msgid "" "well as any attempt to submit more jobs to the pool." msgstr "" -#: ../../library/concurrent.futures.rst:255 +#: ../../library/concurrent.futures.rst:262 msgid "" "When one of the worker processes terminates abruptly, a :exc:" "`BrokenProcessPool` error is now raised. Previously, behaviour was " @@ -283,34 +293,34 @@ msgid "" "or deadlock." msgstr "" -#: ../../library/concurrent.futures.rst:261 +#: ../../library/concurrent.futures.rst:268 msgid "" "The *mp_context* argument was added to allow users to control the " "start_method for worker processes created by the pool." msgstr "" -#: ../../library/concurrent.futures.rst:271 +#: ../../library/concurrent.futures.rst:278 msgid "ProcessPoolExecutor Example" msgstr "ProcessPoolExecutor 範例" -#: ../../library/concurrent.futures.rst:309 +#: ../../library/concurrent.futures.rst:316 msgid "Future Objects" msgstr "" -#: ../../library/concurrent.futures.rst:311 +#: ../../library/concurrent.futures.rst:318 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." msgstr "" -#: ../../library/concurrent.futures.rst:316 +#: ../../library/concurrent.futures.rst:323 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " "directly except for testing." msgstr "" -#: ../../library/concurrent.futures.rst:322 +#: ../../library/concurrent.futures.rst:329 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " @@ -318,22 +328,22 @@ msgid "" "``True``." msgstr "" -#: ../../library/concurrent.futures.rst:329 +#: ../../library/concurrent.futures.rst:336 msgid "Return ``True`` if the call was successfully cancelled." msgstr "" -#: ../../library/concurrent.futures.rst:333 +#: ../../library/concurrent.futures.rst:340 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "" -#: ../../library/concurrent.futures.rst:338 +#: ../../library/concurrent.futures.rst:345 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "" -#: ../../library/concurrent.futures.rst:343 +#: ../../library/concurrent.futures.rst:350 msgid "" "Return the value returned by the call. If the call hasn't yet completed then " "this method will wait up to *timeout* seconds. If the call hasn't completed " @@ -342,19 +352,19 @@ msgid "" "``None``, there is no limit to the wait time." msgstr "" -#: ../../library/concurrent.futures.rst:350 -#: ../../library/concurrent.futures.rst:364 +#: ../../library/concurrent.futures.rst:357 +#: ../../library/concurrent.futures.rst:371 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." msgstr "" -#: ../../library/concurrent.futures.rst:353 +#: ../../library/concurrent.futures.rst:360 msgid "" "If the call raised an exception, this method will raise the same exception." msgstr "" -#: ../../library/concurrent.futures.rst:357 +#: ../../library/concurrent.futures.rst:364 msgid "" "Return the exception raised by the call. If the call hasn't yet completed " "then this method will wait up to *timeout* seconds. If the call hasn't " @@ -363,18 +373,18 @@ msgid "" "*timeout* is not specified or ``None``, there is no limit to the wait time." msgstr "" -#: ../../library/concurrent.futures.rst:367 +#: ../../library/concurrent.futures.rst:374 msgid "If the call completed without raising, ``None`` is returned." msgstr "" -#: ../../library/concurrent.futures.rst:371 +#: ../../library/concurrent.futures.rst:378 msgid "" "Attaches the callable *fn* to the future. *fn* will be called, with the " "future as its only argument, when the future is cancelled or finishes " "running." msgstr "" -#: ../../library/concurrent.futures.rst:375 +#: ../../library/concurrent.futures.rst:382 msgid "" "Added callables are called in the order that they were added and are always " "called in a thread belonging to the process that added them. If the " @@ -383,26 +393,26 @@ msgid "" "behavior is undefined." msgstr "" -#: ../../library/concurrent.futures.rst:381 +#: ../../library/concurrent.futures.rst:388 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." msgstr "" -#: ../../library/concurrent.futures.rst:384 +#: ../../library/concurrent.futures.rst:391 msgid "" "The following :class:`Future` methods are meant for use in unit tests and :" "class:`Executor` implementations." msgstr "" -#: ../../library/concurrent.futures.rst:389 +#: ../../library/concurrent.futures.rst:396 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " "tests." msgstr "" -#: ../../library/concurrent.futures.rst:393 +#: ../../library/concurrent.futures.rst:400 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." "e. :meth:`Future.cancel` was called and returned `True`. Any threads " @@ -410,49 +420,49 @@ msgid "" "or :func:`wait`) will be woken up." msgstr "" -#: ../../library/concurrent.futures.rst:398 +#: ../../library/concurrent.futures.rst:405 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " "will return `True`." msgstr "" -#: ../../library/concurrent.futures.rst:402 +#: ../../library/concurrent.futures.rst:409 msgid "" "This method can only be called once and cannot be called after :meth:`Future." "set_result` or :meth:`Future.set_exception` have been called." msgstr "" -#: ../../library/concurrent.futures.rst:408 +#: ../../library/concurrent.futures.rst:415 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr "" -#: ../../library/concurrent.futures.rst:411 -#: ../../library/concurrent.futures.rst:424 +#: ../../library/concurrent.futures.rst:418 +#: ../../library/concurrent.futures.rst:431 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." msgstr "" -#: ../../library/concurrent.futures.rst:414 -#: ../../library/concurrent.futures.rst:427 +#: ../../library/concurrent.futures.rst:421 +#: ../../library/concurrent.futures.rst:434 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." msgstr "" -#: ../../library/concurrent.futures.rst:421 +#: ../../library/concurrent.futures.rst:428 msgid "" "Sets the result of the work associated with the :class:`Future` to the :" "class:`Exception` *exception*." msgstr "" -#: ../../library/concurrent.futures.rst:433 +#: ../../library/concurrent.futures.rst:440 msgid "Module Functions" msgstr "模組函式" -#: ../../library/concurrent.futures.rst:437 +#: ../../library/concurrent.futures.rst:444 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Duplicate futures given to " @@ -463,55 +473,55 @@ msgid "" "running futures)." msgstr "" -#: ../../library/concurrent.futures.rst:445 +#: ../../library/concurrent.futures.rst:452 msgid "" "*timeout* can be used to control the maximum number of seconds to wait " "before returning. *timeout* can be an int or float. If *timeout* is not " "specified or ``None``, there is no limit to the wait time." msgstr "" -#: ../../library/concurrent.futures.rst:449 +#: ../../library/concurrent.futures.rst:456 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/concurrent.futures.rst:455 +#: ../../library/concurrent.futures.rst:462 msgid "Constant" msgstr "常數" -#: ../../library/concurrent.futures.rst:455 +#: ../../library/concurrent.futures.rst:462 msgid "Description" msgstr "描述" -#: ../../library/concurrent.futures.rst:457 +#: ../../library/concurrent.futures.rst:464 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/concurrent.futures.rst:457 +#: ../../library/concurrent.futures.rst:464 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/concurrent.futures.rst:460 +#: ../../library/concurrent.futures.rst:467 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/concurrent.futures.rst:460 +#: ../../library/concurrent.futures.rst:467 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" -#: ../../library/concurrent.futures.rst:466 +#: ../../library/concurrent.futures.rst:473 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/concurrent.futures.rst:466 +#: ../../library/concurrent.futures.rst:473 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/concurrent.futures.rst:472 +#: ../../library/concurrent.futures.rst:479 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " @@ -525,49 +535,49 @@ msgid "" "wait time." msgstr "" -#: ../../library/concurrent.futures.rst:486 +#: ../../library/concurrent.futures.rst:493 msgid ":pep:`3148` -- futures - execute computations asynchronously" msgstr "" -#: ../../library/concurrent.futures.rst:486 +#: ../../library/concurrent.futures.rst:493 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/concurrent.futures.rst:491 +#: ../../library/concurrent.futures.rst:498 msgid "Exception classes" msgstr "" -#: ../../library/concurrent.futures.rst:497 +#: ../../library/concurrent.futures.rst:504 msgid "Raised when a future is cancelled." msgstr "" -#: ../../library/concurrent.futures.rst:501 +#: ../../library/concurrent.futures.rst:508 msgid "Raised when a future operation exceeds the given timeout." msgstr "" -#: ../../library/concurrent.futures.rst:505 +#: ../../library/concurrent.futures.rst:512 msgid "" "Derived from :exc:`RuntimeError`, this exception class is raised when an " "executor is broken for some reason, and cannot be used to submit or execute " "new tasks." msgstr "" -#: ../../library/concurrent.futures.rst:513 +#: ../../library/concurrent.futures.rst:520 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "" -#: ../../library/concurrent.futures.rst:522 +#: ../../library/concurrent.futures.rst:529 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " "is raised when one of the workers of a :class:`ThreadPoolExecutor` has " "failed initializing." msgstr "" -#: ../../library/concurrent.futures.rst:532 +#: ../../library/concurrent.futures.rst:539 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " diff --git a/library/sqlite3.po b/library/sqlite3.po index d53172b394..da8ed761ff 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-28 00:17+0000\n" +"POT-Creation-Date: 2022-07-29 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1405,37 +1405,37 @@ msgstr "" #: ../../library/sqlite3.rst:1339 msgid "" -"Using the nonstandard :meth:`execute`, :meth:`executemany` and :meth:" -"`executescript` methods of the :class:`Connection` object, your code can be " -"written more concisely because you don't have to create the (often " -"superfluous) :class:`Cursor` objects explicitly. Instead, the :class:" +"Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" +"meth:`~Connection.executescript` methods of the :class:`Connection` class, " +"your code can be written more concisely because you don't have to create the " +"(often superfluous) :class:`Cursor` objects explicitly. Instead, the :class:" "`Cursor` objects are created implicitly and these shortcut methods return " "the cursor objects. This way, you can execute a ``SELECT`` statement and " "iterate over it directly using only a single call on the :class:`Connection` " "object." msgstr "" -#: ../../library/sqlite3.rst:1351 +#: ../../library/sqlite3.rst:1352 msgid "Accessing columns by name instead of by index" msgstr "" -#: ../../library/sqlite3.rst:1353 +#: ../../library/sqlite3.rst:1354 msgid "" "One useful feature of the :mod:`sqlite3` module is the built-in :class:" "`sqlite3.Row` class designed to be used as a row factory." msgstr "" -#: ../../library/sqlite3.rst:1356 +#: ../../library/sqlite3.rst:1357 msgid "" "Rows wrapped with this class can be accessed both by index (like tuples) and " "case-insensitively by name:" msgstr "" -#: ../../library/sqlite3.rst:1365 +#: ../../library/sqlite3.rst:1366 msgid "Using the connection as a context manager" msgstr "" -#: ../../library/sqlite3.rst:1367 +#: ../../library/sqlite3.rst:1368 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1445,23 +1445,23 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:1376 +#: ../../library/sqlite3.rst:1377 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:1381 +#: ../../library/sqlite3.rst:1382 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:1388 +#: ../../library/sqlite3.rst:1389 msgid "Footnotes" msgstr "註解" -#: ../../library/sqlite3.rst:1389 +#: ../../library/sqlite3.rst:1390 msgid "" "The sqlite3 module is not built with loadable extension support by default, " "because some platforms (notably macOS) have SQLite libraries which are " From eddf084fc9af50b4f7fb94cb12d7ce41f92a9a16 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 30 Jul 2022 00:16:56 +0000 Subject: [PATCH 6/6] sync with cpython f14ced60 --- library/datetime.po | 4 +- library/sqlite3.po | 540 +++++++++++++++++++++++--------------------- 2 files changed, 282 insertions(+), 262 deletions(-) diff --git a/library/datetime.po b/library/datetime.po index ab4ce95b0c..7e04d28566 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-22 00:18+0000\n" +"POT-Creation-Date: 2022-07-30 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -813,7 +813,7 @@ msgid "``date2 = date1 + timedelta``" msgstr "``date2 = date1 + timedelta``" #: ../../library/datetime.rst:584 -msgid "*date2* is ``timedelta.days`` days removed from *date1*. (1)" +msgid "*date2* will be ``timedelta.days`` days after *date1*. (1)" msgstr "" #: ../../library/datetime.rst:587 diff --git a/library/sqlite3.po b/library/sqlite3.po index da8ed761ff..53d9a9817d 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-29 00:16+0000\n" +"POT-Creation-Date: 2022-07-30 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,7 +26,7 @@ msgstr "" msgid "**Source code:** :source:`Lib/sqlite3/`" msgstr "**原始碼:**\\ :source:`Lib/sqlite3/`" -#: ../../library/sqlite3.rst:15 ../../library/sqlite3.rst:1057 +#: ../../library/sqlite3.rst:15 ../../library/sqlite3.rst:1108 msgid "Introduction" msgstr "簡介" @@ -77,26 +77,30 @@ msgid "" msgstr "" #: ../../library/sqlite3.rst:70 -msgid "" -"To retrieve data after executing a SELECT statement, either treat the cursor " -"as an :term:`iterator`, call the cursor's :meth:`~Cursor.fetchone` method to " -"retrieve a single matching row, or call :meth:`~Cursor.fetchall` to get a " -"list of the matching rows." +msgid "At this point, our database only contains one row::" msgstr "" -#: ../../library/sqlite3.rst:75 -msgid "This example uses the iterator form::" +#: ../../library/sqlite3.rst:76 +msgid "" +"The result is a one-item :class:`tuple`: one row, with one column. Now, let " +"us insert three more rows of data, using :meth:`~Cursor.executemany`::" msgstr "" #: ../../library/sqlite3.rst:88 msgid "" +"Then, retrieve the data by iterating over the result of a ``SELECT`` " +"statement::" +msgstr "" + +#: ../../library/sqlite3.rst:101 +msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " "vulnerable to SQL injection attacks (see the `xkcd webcomic `_ for a humorous example of what can go wrong)::" msgstr "" -#: ../../library/sqlite3.rst:97 +#: ../../library/sqlite3.rst:110 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -112,50 +116,50 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:117 +#: ../../library/sqlite3.rst:130 msgid "https://www.sqlite.org" msgstr "https://www.sqlite.org" -#: ../../library/sqlite3.rst:116 +#: ../../library/sqlite3.rst:129 msgid "" "The SQLite web page; the documentation describes the syntax and the " "available data types for the supported SQL dialect." msgstr "" -#: ../../library/sqlite3.rst:120 +#: ../../library/sqlite3.rst:133 msgid "https://www.w3schools.com/sql/" msgstr "https://www.w3schools.com/sql/" -#: ../../library/sqlite3.rst:120 +#: ../../library/sqlite3.rst:133 msgid "Tutorial, reference and examples for learning SQL syntax." msgstr "" -#: ../../library/sqlite3.rst:122 +#: ../../library/sqlite3.rst:135 msgid ":pep:`249` - Database API Specification 2.0" msgstr "" -#: ../../library/sqlite3.rst:123 +#: ../../library/sqlite3.rst:136 msgid "PEP written by Marc-André Lemburg." msgstr "PEP 由 Marc-André Lemburg 撰寫。" -#: ../../library/sqlite3.rst:129 +#: ../../library/sqlite3.rst:142 msgid "Module functions and constants" msgstr "" -#: ../../library/sqlite3.rst:134 +#: ../../library/sqlite3.rst:147 msgid "" "String constant stating the supported DB-API level. Required by the DB-API. " "Hard-coded to ``\"2.0\"``." msgstr "" -#: ../../library/sqlite3.rst:139 +#: ../../library/sqlite3.rst:152 msgid "" "String constant stating the type of parameter marker formatting expected by " "the :mod:`sqlite3` module. Required by the DB-API. Hard-coded to ``\"qmark" "\"``." msgstr "" -#: ../../library/sqlite3.rst:145 +#: ../../library/sqlite3.rst:158 msgid "" "The :mod:`sqlite3` module supports both ``qmark`` and ``numeric`` DB-API " "parameter styles, because that is what the underlying SQLite library " @@ -163,30 +167,30 @@ msgid "" "``paramstyle`` attribute." msgstr "" -#: ../../library/sqlite3.rst:152 +#: ../../library/sqlite3.rst:165 msgid "" "Version number of this module as a :class:`string `. This is not the " "version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:158 +#: ../../library/sqlite3.rst:171 msgid "" "Version number of this module as a :class:`tuple` of :class:`integers " "`. This is not the version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:164 +#: ../../library/sqlite3.rst:177 msgid "" "Version number of the runtime SQLite library as a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:169 +#: ../../library/sqlite3.rst:182 msgid "" "Version number of the runtime SQLite library as a :class:`tuple` of :class:" "`integers `." msgstr "" -#: ../../library/sqlite3.rst:175 +#: ../../library/sqlite3.rst:188 msgid "" "Integer constant required by the DB-API, stating the level of thread safety " "the :mod:`sqlite3` module supports. Currently hard-coded to ``1``, meaning *" @@ -195,13 +199,13 @@ msgid "" "time threaded mode using the following query::" msgstr "" -#: ../../library/sqlite3.rst:188 +#: ../../library/sqlite3.rst:201 msgid "" "Note that the `SQLITE_THREADSAFE levels `_ do not match the DB-API 2.0 ``threadsafety`` levels." msgstr "" -#: ../../library/sqlite3.rst:195 +#: ../../library/sqlite3.rst:208 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function using the declared types for each column. The " @@ -210,13 +214,13 @@ msgid "" "converter dictionary key. For example:" msgstr "" -#: ../../library/sqlite3.rst:212 +#: ../../library/sqlite3.rst:225 msgid "" "This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:218 +#: ../../library/sqlite3.rst:231 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function by using the type name, parsed from the query " @@ -224,13 +228,13 @@ msgid "" "in square brackets (``[]``)." msgstr "" -#: ../../library/sqlite3.rst:228 +#: ../../library/sqlite3.rst:241 msgid "" "This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:235 +#: ../../library/sqlite3.rst:248 msgid "Open a connection to an SQLite database." msgstr "" @@ -238,13 +242,13 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/sqlite3.rst:237 +#: ../../library/sqlite3.rst:250 msgid "" "The path to the database file to be opened. Pass ``\":memory:\"`` to open a " "connection to a database that is in RAM instead of on disk." msgstr "" -#: ../../library/sqlite3.rst:243 +#: ../../library/sqlite3.rst:256 msgid "" "How many seconds the connection should wait before raising an exception, if " "the database is locked by another connection. If another connection opens a " @@ -252,7 +256,7 @@ msgid "" "is committed. Default five seconds." msgstr "" -#: ../../library/sqlite3.rst:251 +#: ../../library/sqlite3.rst:264 msgid "" "Control whether and how data types not :ref:`natively supported by SQLite " "` are looked up to be converted to Python types, using the " @@ -265,7 +269,7 @@ msgid "" "disabled." msgstr "" -#: ../../library/sqlite3.rst:266 +#: ../../library/sqlite3.rst:279 msgid "" "The :attr:`~Connection.isolation_level` of the connection, controlling " "whether and how transactions are implicitly opened. Can be ``\"DEFERRED\"`` " @@ -274,7 +278,7 @@ msgid "" "transactions` for more." msgstr "" -#: ../../library/sqlite3.rst:274 +#: ../../library/sqlite3.rst:287 msgid "" "If :const:`True` (default), only the creating thread may use the connection. " "If :const:`False`, the connection may be shared across multiple threads; if " @@ -282,19 +286,19 @@ msgid "" "corruption." msgstr "" -#: ../../library/sqlite3.rst:281 +#: ../../library/sqlite3.rst:294 msgid "" "A custom subclass of :class:`Connection` to create the connection with, if " "not the default :class:`Connection` class." msgstr "" -#: ../../library/sqlite3.rst:286 +#: ../../library/sqlite3.rst:299 msgid "" "The number of statements that ``sqlite3`` should internally cache for this " "connection, to avoid parsing overhead. By default, 100 statements." msgstr "" -#: ../../library/sqlite3.rst:292 +#: ../../library/sqlite3.rst:305 msgid "" "If set to :const:`True`, *database* is interpreted as a :abbr:`URI (Uniform " "Resource Identifier)` with a file path and an optional query string. The " @@ -307,32 +311,32 @@ msgstr "" msgid "Return type" msgstr "" -#: ../../library/sqlite3.rst:304 +#: ../../library/sqlite3.rst:317 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" -#: ../../library/sqlite3.rst:305 +#: ../../library/sqlite3.rst:318 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." msgstr "" -#: ../../library/sqlite3.rst:307 +#: ../../library/sqlite3.rst:320 msgid "The *uri* parameter." msgstr "*uri* 參數。" -#: ../../library/sqlite3.rst:310 +#: ../../library/sqlite3.rst:323 msgid "" "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" -#: ../../library/sqlite3.rst:313 +#: ../../library/sqlite3.rst:326 msgid "The ``sqlite3.connect/handle`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:319 +#: ../../library/sqlite3.rst:332 msgid "" "Register the *converter* callable to convert SQLite objects of type " "*typename* into a Python object of a specific type. The converter is invoked " @@ -342,13 +346,13 @@ msgid "" "type detection works." msgstr "" -#: ../../library/sqlite3.rst:327 +#: ../../library/sqlite3.rst:340 msgid "" "Note: *typename* and the name of the type in your query are matched case-" "insensitively." msgstr "" -#: ../../library/sqlite3.rst:333 +#: ../../library/sqlite3.rst:346 msgid "" "Register an *adapter* callable to adapt the Python type *type* into an " "SQLite type. The adapter is called with a Python object of type *type* as " @@ -356,7 +360,7 @@ msgid "" "natively understands`." msgstr "" -#: ../../library/sqlite3.rst:342 +#: ../../library/sqlite3.rst:355 msgid "" "Returns :const:`True` if the string *statement* contains one or more " "complete SQL statements terminated by semicolons. It does not verify that " @@ -364,12 +368,12 @@ msgid "" "literals and the statement is terminated by a semicolon." msgstr "" -#: ../../library/sqlite3.rst:347 +#: ../../library/sqlite3.rst:360 msgid "" "This can be used to build a shell for SQLite, as in the following example:" msgstr "" -#: ../../library/sqlite3.rst:355 +#: ../../library/sqlite3.rst:368 msgid "" "Enable or disable callback tracebacks. By default you will not get any " "tracebacks in user-defined functions, aggregates, converters, authorizer " @@ -378,15 +382,30 @@ msgid "" "on ``sys.stderr``. Use :const:`False` to disable the feature again." msgstr "" -#: ../../library/sqlite3.rst:366 +#: ../../library/sqlite3.rst:379 msgid "Connection Objects" msgstr "" -#: ../../library/sqlite3.rst:370 +#: ../../library/sqlite3.rst:383 +msgid "" +"Each open SQLite database is represented by a ``Connection`` object, which " +"is created using :func:`sqlite3.connect`. Their main purpose is creating :" +"class:`Cursor` objects, and :ref:`sqlite3-controlling-transactions`." +msgstr "" + +#: ../../library/sqlite3.rst:390 +msgid ":ref:`sqlite3-connection-shortcuts`" +msgstr "" + +#: ../../library/sqlite3.rst:391 +msgid ":ref:`sqlite3-connection-context-manager`" +msgstr "" + +#: ../../library/sqlite3.rst:393 msgid "An SQLite database connection has the following attributes and methods:" msgstr "" -#: ../../library/sqlite3.rst:374 +#: ../../library/sqlite3.rst:397 msgid "" "This attribute controls the :ref:`transaction handling ` performed by ``sqlite3``. If set to :const:`None`, " @@ -396,90 +415,90 @@ msgid "" "` is performed." msgstr "" -#: ../../library/sqlite3.rst:382 +#: ../../library/sqlite3.rst:405 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: ../../library/sqlite3.rst:387 +#: ../../library/sqlite3.rst:410 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:390 +#: ../../library/sqlite3.rst:413 msgid "" ":const:`True` if a transaction is active (there are uncommitted changes), :" "const:`False` otherwise." msgstr "" -#: ../../library/sqlite3.rst:397 +#: ../../library/sqlite3.rst:420 msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " "single optional parameter *factory*. If supplied, this must be a callable " "returning an instance of :class:`Cursor` or its subclasses." msgstr "" -#: ../../library/sqlite3.rst:404 +#: ../../library/sqlite3.rst:427 msgid "" "Commit any pending transaction to the database. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:409 +#: ../../library/sqlite3.rst:432 msgid "" "Roll back to the start of any pending transaction. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:414 +#: ../../library/sqlite3.rst:437 msgid "" "Close the database connection. Any pending transaction is not committed " "implicitly; make sure to :meth:`commit` before closing to avoid losing " "pending changes." msgstr "" -#: ../../library/sqlite3.rst:421 +#: ../../library/sqlite3.rst:444 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it " "with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:427 +#: ../../library/sqlite3.rst:450 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on " "it with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:433 +#: ../../library/sqlite3.rst:456 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executescript` " "on it with the given *sql_script*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:439 +#: ../../library/sqlite3.rst:462 msgid "Create or remove a user-defined SQL function." msgstr "" -#: ../../library/sqlite3.rst:441 +#: ../../library/sqlite3.rst:464 msgid "The name of the SQL function." msgstr "" -#: ../../library/sqlite3.rst:445 +#: ../../library/sqlite3.rst:468 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:450 +#: ../../library/sqlite3.rst:473 msgid "" "A callable that is called when the SQL function is invoked. The callable " "must return :ref:`a type natively supported by SQLite `. Set " "to :const:`None` to remove an existing SQL function." msgstr "" -#: ../../library/sqlite3.rst:457 +#: ../../library/sqlite3.rst:480 msgid "" "If :const:`True`, the created SQL function is marked as `deterministic " "`_, which allows SQLite to perform " @@ -490,35 +509,34 @@ msgstr "" msgid "Raises" msgstr "" -#: ../../library/sqlite3.rst:463 +#: ../../library/sqlite3.rst:486 msgid "If *deterministic* is used with SQLite versions older than 3.8.3." msgstr "" -#: ../../library/sqlite3.rst:466 +#: ../../library/sqlite3.rst:489 msgid "The *deterministic* parameter." msgstr "新增 *deterministic* 參數。" -#: ../../library/sqlite3.rst:469 ../../library/sqlite3.rst:500 -#: ../../library/sqlite3.rst:630 ../../library/sqlite3.rst:652 -#: ../../library/sqlite3.rst:801 +#: ../../library/sqlite3.rst:492 ../../library/sqlite3.rst:523 +#: ../../library/sqlite3.rst:658 ../../library/sqlite3.rst:680 msgid "Example:" msgstr "範例:" -#: ../../library/sqlite3.rst:476 +#: ../../library/sqlite3.rst:499 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:478 +#: ../../library/sqlite3.rst:501 msgid "The name of the SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:482 +#: ../../library/sqlite3.rst:505 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:487 +#: ../../library/sqlite3.rst:510 msgid "" "A class must implement the following methods: * ``step()``: Add a row to " "the aggregate. * ``finalize()``: Return the final result of the aggregate " @@ -527,64 +545,64 @@ msgid "" "*n_arg*. Set to :const:`None` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:488 +#: ../../library/sqlite3.rst:511 msgid "A class must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:490 +#: ../../library/sqlite3.rst:513 msgid "``step()``: Add a row to the aggregate." msgstr "" -#: ../../library/sqlite3.rst:491 +#: ../../library/sqlite3.rst:514 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" -#: ../../library/sqlite3.rst:494 +#: ../../library/sqlite3.rst:517 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" -#: ../../library/sqlite3.rst:497 +#: ../../library/sqlite3.rst:520 msgid "Set to :const:`None` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:507 +#: ../../library/sqlite3.rst:530 msgid "" "Create a collation named *name* using the collating function *callable*. " "*callable* is passed two :class:`string ` arguments, and it should " "return an :class:`integer `:" msgstr "" -#: ../../library/sqlite3.rst:511 +#: ../../library/sqlite3.rst:534 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:535 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: ../../library/sqlite3.rst:513 +#: ../../library/sqlite3.rst:536 msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:538 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:519 +#: ../../library/sqlite3.rst:542 msgid "Remove a collation function by setting *callable* to :const:`None`." msgstr "" -#: ../../library/sqlite3.rst:524 +#: ../../library/sqlite3.rst:547 msgid "" "Call this method from a different thread to abort any queries that might be " "executing on the connection. Aborted queries will raise an exception." msgstr "" -#: ../../library/sqlite3.rst:531 +#: ../../library/sqlite3.rst:554 msgid "" "Register callable *authorizer_callback* to be invoked for each attempt to " "access a column of a table in the database. The callback should return :" @@ -594,7 +612,7 @@ msgid "" "in the :mod:`sqlite3` module." msgstr "" -#: ../../library/sqlite3.rst:538 +#: ../../library/sqlite3.rst:561 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or :const:`None` " @@ -605,7 +623,7 @@ msgid "" "code." msgstr "" -#: ../../library/sqlite3.rst:545 +#: ../../library/sqlite3.rst:568 msgid "" "Please consult the SQLite documentation about the possible values for the " "first argument and the meaning of the second and third argument depending on " @@ -613,7 +631,7 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:552 +#: ../../library/sqlite3.rst:575 msgid "" "Register callable *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -621,26 +639,26 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:557 +#: ../../library/sqlite3.rst:580 msgid "" "If you want to clear any previously installed progress handler, call the " "method with :const:`None` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:560 +#: ../../library/sqlite3.rst:583 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise an :exc:`OperationalError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:567 +#: ../../library/sqlite3.rst:590 msgid "" "Register callable *trace_callback* to be invoked for each SQL statement that " "is actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:570 +#: ../../library/sqlite3.rst:593 msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " @@ -650,19 +668,19 @@ msgid "" "of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:578 +#: ../../library/sqlite3.rst:601 msgid "" "Passing :const:`None` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:581 +#: ../../library/sqlite3.rst:604 msgid "" "Exceptions raised in the trace callback are not propagated. As a development " "and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable " "printing tracebacks from exceptions raised in the trace callback." msgstr "" -#: ../../library/sqlite3.rst:591 +#: ../../library/sqlite3.rst:614 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is :const:`True`; else, disallow loading SQLite extensions. SQLite " @@ -671,45 +689,50 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:598 ../../library/sqlite3.rst:615 -msgid "Loadable extensions are disabled by default. See [#f1]_." +#: ../../library/sqlite3.rst:623 +msgid "" +"The ``sqlite3`` module is not built with loadable extension support by " +"default, because some platforms (notably macOS) have SQLite libraries which " +"are compiled without this feature. To get loadable extension support, you " +"must pass the :option:`--enable-loadable-sqlite-extensions` option to :" +"program:`configure`." msgstr "" -#: ../../library/sqlite3.rst:600 +#: ../../library/sqlite3.rst:630 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" -#: ../../library/sqlite3.rst:604 +#: ../../library/sqlite3.rst:634 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:611 +#: ../../library/sqlite3.rst:641 msgid "" "Load an SQLite extension from a shared library located at *path*. Enable " "extension loading with :meth:`enable_load_extension` before calling this " "method." msgstr "" -#: ../../library/sqlite3.rst:617 +#: ../../library/sqlite3.rst:645 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" -#: ../../library/sqlite3.rst:621 +#: ../../library/sqlite3.rst:649 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:626 +#: ../../library/sqlite3.rst:654 msgid "" "A callable that accepts two arguments, a :class:`Cursor` object and the raw " "row results as a :class:`tuple`, and returns a custom object representing an " "SQLite row." msgstr "" -#: ../../library/sqlite3.rst:634 +#: ../../library/sqlite3.rst:662 msgid "" "If returning a tuple doesn't suffice and you want name-based access to " "columns, you should consider setting :attr:`row_factory` to the highly " @@ -719,7 +742,7 @@ msgid "" "approach or even a db_row based solution." msgstr "" -#: ../../library/sqlite3.rst:646 +#: ../../library/sqlite3.rst:674 msgid "" "A callable that accepts a :class:`bytes` parameter and returns a text " "representation of it. The callable is invoked for SQLite values with the " @@ -727,47 +750,48 @@ msgid "" "you want to return ``bytes`` instead, set *text_factory* to ``bytes``." msgstr "" -#: ../../library/sqlite3.rst:659 +#: ../../library/sqlite3.rst:687 msgid "" "Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:665 +#: ../../library/sqlite3.rst:693 msgid "" "Return an :term:`iterator` to dump the database as SQL source code. Useful " "when saving an in-memory database for later restoration. Similar to the ``." "dump`` command in the :program:`sqlite3` shell." msgstr "" -#: ../../library/sqlite3.rst:669 +#: ../../library/sqlite3.rst:697 ../../library/sqlite3.rst:828 +#: ../../library/sqlite3.rst:847 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/sqlite3.rst:683 +#: ../../library/sqlite3.rst:711 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:685 +#: ../../library/sqlite3.rst:713 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:688 +#: ../../library/sqlite3.rst:716 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:692 +#: ../../library/sqlite3.rst:720 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:699 +#: ../../library/sqlite3.rst:727 msgid "" "If set to a callable, it is invoked with three integer arguments for every " "backup iteration: the *status* of the last iteration, the *remaining* number " @@ -775,43 +799,58 @@ msgid "" "const:`None`." msgstr "" -#: ../../library/sqlite3.rst:708 +#: ../../library/sqlite3.rst:736 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statment." msgstr "" -#: ../../library/sqlite3.rst:716 +#: ../../library/sqlite3.rst:744 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:721 +#: ../../library/sqlite3.rst:749 msgid "Example 1, copy an existing database into another::" msgstr "" -#: ../../library/sqlite3.rst:735 +#: ../../library/sqlite3.rst:763 msgid "Example 2, copy an existing database into a transient copy::" msgstr "" -#: ../../library/sqlite3.rst:749 +#: ../../library/sqlite3.rst:777 msgid "Cursor Objects" msgstr "" -#: ../../library/sqlite3.rst:753 +#: ../../library/sqlite3.rst:779 +msgid "" +"A ``Cursor`` object represents a `database cursor`_ which is used to execute " +"SQL statements, and manage the context of a fetch operation. Cursors are " +"created using :meth:`Connection.cursor`, or by using any of the :ref:" +"`connection shortcut methods `." +msgstr "" + +#: ../../library/sqlite3.rst:786 +msgid "" +"Cursor objects are :term:`iterators `, meaning that if you :meth:" +"`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " +"to fetch the resulting rows::" +msgstr "" + +#: ../../library/sqlite3.rst:797 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:760 +#: ../../library/sqlite3.rst:804 msgid "" "Execute SQL statement *sql*. Bind values to the statement using :ref:" "`placeholders ` that map to the :term:`sequence` or :" "class:`dict` *parameters*." msgstr "" -#: ../../library/sqlite3.rst:765 +#: ../../library/sqlite3.rst:809 msgid "" ":meth:`execute` will only execute a single SQL statement. If you try to " "execute more than one statement with it, it will raise a :exc:`Warning`. " @@ -819,7 +858,7 @@ msgid "" "with one call." msgstr "" -#: ../../library/sqlite3.rst:770 +#: ../../library/sqlite3.rst:814 msgid "" "If :attr:`~Connection.isolation_level` is not :const:`None`, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " @@ -827,7 +866,7 @@ msgid "" "*sql*." msgstr "" -#: ../../library/sqlite3.rst:778 +#: ../../library/sqlite3.rst:822 msgid "" "Execute :ref:`parameterized ` SQL statement *sql* " "against all parameter sequences or mappings found in the sequence " @@ -836,11 +875,7 @@ msgid "" "handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:786 -msgid "Here's a shorter example using a :term:`generator`:" -msgstr "" - -#: ../../library/sqlite3.rst:793 +#: ../../library/sqlite3.rst:839 msgid "" "Execute the SQL statements in *sql_script*. If there is a pending " "transaciton, an implicit ``COMMIT`` statement is executed first. No other " @@ -848,23 +883,23 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:799 +#: ../../library/sqlite3.rst:845 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:808 +#: ../../library/sqlite3.rst:861 msgid "" "Fetch the next row of a query result set as a :class:`tuple`. Return :const:" "`None` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:814 +#: ../../library/sqlite3.rst:867 msgid "" "Fetch the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:817 +#: ../../library/sqlite3.rst:870 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -872,7 +907,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:823 +#: ../../library/sqlite3.rst:876 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -880,29 +915,29 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:830 +#: ../../library/sqlite3.rst:883 msgid "" "Fetch all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:837 +#: ../../library/sqlite3.rst:890 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:839 +#: ../../library/sqlite3.rst:892 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: ../../library/sqlite3.rst:844 ../../library/sqlite3.rst:848 +#: ../../library/sqlite3.rst:897 ../../library/sqlite3.rst:901 msgid "Required by the DB-API. Does nothing in :mod:`sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:852 +#: ../../library/sqlite3.rst:905 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -911,7 +946,7 @@ msgid "" "methods." msgstr "" -#: ../../library/sqlite3.rst:860 +#: ../../library/sqlite3.rst:913 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -921,33 +956,33 @@ msgid "" "const:`None`." msgstr "" -#: ../../library/sqlite3.rst:868 +#: ../../library/sqlite3.rst:921 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:870 +#: ../../library/sqlite3.rst:923 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:875 +#: ../../library/sqlite3.rst:928 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: ../../library/sqlite3.rst:880 +#: ../../library/sqlite3.rst:933 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are :const:`None`." msgstr "" -#: ../../library/sqlite3.rst:884 +#: ../../library/sqlite3.rst:937 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:888 +#: ../../library/sqlite3.rst:941 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -955,68 +990,62 @@ msgid "" "that refers to *con*::" msgstr "" -#: ../../library/sqlite3.rst:901 +#: ../../library/sqlite3.rst:954 msgid "Row Objects" msgstr "" -#: ../../library/sqlite3.rst:905 +#: ../../library/sqlite3.rst:958 msgid "" "A :class:`Row` instance serves as a highly optimized :attr:`~Connection." -"row_factory` for :class:`Connection` objects. It tries to mimic a tuple in " -"most of its features." +"row_factory` for :class:`Connection` objects. It tries to mimic a :class:" +"`tuple` in most of its features, and supports iteration, :func:`repr`, " +"equality testing, :func:`len`, and :term:`mapping` access by column name and " +"index." msgstr "" -#: ../../library/sqlite3.rst:909 -msgid "" -"It supports mapping access by column name and index, iteration, " -"representation, equality testing and :func:`len`." +#: ../../library/sqlite3.rst:964 +msgid "Two row objects compare equal if have equal columns and equal members." msgstr "" -#: ../../library/sqlite3.rst:912 -msgid "" -"If two :class:`Row` objects have exactly the same columns and their members " -"are equal, they compare equal." -msgstr "" - -#: ../../library/sqlite3.rst:917 +#: ../../library/sqlite3.rst:968 msgid "" "Return a :class:`list` of column names as :class:`strings `. " "Immediately after a query, it is the first member of each tuple in :attr:" "`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:921 +#: ../../library/sqlite3.rst:972 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:924 +#: ../../library/sqlite3.rst:975 msgid "Let's assume we initialize a table as in the example given above::" msgstr "" -#: ../../library/sqlite3.rst:936 +#: ../../library/sqlite3.rst:987 msgid "Now we plug :class:`Row` in::" msgstr "" -#: ../../library/sqlite3.rst:966 +#: ../../library/sqlite3.rst:1017 msgid "PrepareProtocol Objects" msgstr "" -#: ../../library/sqlite3.rst:970 +#: ../../library/sqlite3.rst:1021 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:978 +#: ../../library/sqlite3.rst:1029 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:980 +#: ../../library/sqlite3.rst:1031 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:984 +#: ../../library/sqlite3.rst:1035 msgid "" "This exception is raised by ``sqlite3`` if an SQL query is not a :class:" "`string `, or if multiple statements are passed to :meth:`~Cursor." @@ -1024,21 +1053,21 @@ msgid "" "`Exception`." msgstr "" -#: ../../library/sqlite3.rst:991 +#: ../../library/sqlite3.rst:1042 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:997 +#: ../../library/sqlite3.rst:1048 msgid "" "This exception is raised by ``sqlite3`` for fetch across rollback, or if " "``sqlite3`` is unable to bind parameters. ``InterfaceError`` is a subclass " "of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1003 +#: ../../library/sqlite3.rst:1054 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1046,14 +1075,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1010 +#: ../../library/sqlite3.rst:1061 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1016 +#: ../../library/sqlite3.rst:1067 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1061,20 +1090,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1024 +#: ../../library/sqlite3.rst:1075 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1029 +#: ../../library/sqlite3.rst:1080 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1036 +#: ../../library/sqlite3.rst:1087 msgid "" "Exception raised for ``sqlite3`` API programming errors, for example trying " "to operate on a closed :class:`Connection`, or trying to execute non-DML " @@ -1082,7 +1111,7 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1043 +#: ../../library/sqlite3.rst:1094 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to :const:" @@ -1091,78 +1120,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1053 +#: ../../library/sqlite3.rst:1104 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1059 +#: ../../library/sqlite3.rst:1110 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1062 +#: ../../library/sqlite3.rst:1113 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1065 ../../library/sqlite3.rst:1082 +#: ../../library/sqlite3.rst:1116 ../../library/sqlite3.rst:1133 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1065 ../../library/sqlite3.rst:1082 +#: ../../library/sqlite3.rst:1116 ../../library/sqlite3.rst:1133 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1067 ../../library/sqlite3.rst:1084 +#: ../../library/sqlite3.rst:1118 ../../library/sqlite3.rst:1135 msgid ":const:`None`" msgstr ":const:`None`" -#: ../../library/sqlite3.rst:1067 ../../library/sqlite3.rst:1084 +#: ../../library/sqlite3.rst:1118 ../../library/sqlite3.rst:1135 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1069 ../../library/sqlite3.rst:1086 +#: ../../library/sqlite3.rst:1120 ../../library/sqlite3.rst:1137 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1069 ../../library/sqlite3.rst:1086 +#: ../../library/sqlite3.rst:1120 ../../library/sqlite3.rst:1137 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1071 ../../library/sqlite3.rst:1088 +#: ../../library/sqlite3.rst:1122 ../../library/sqlite3.rst:1139 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1071 ../../library/sqlite3.rst:1088 +#: ../../library/sqlite3.rst:1122 ../../library/sqlite3.rst:1139 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1073 +#: ../../library/sqlite3.rst:1124 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1073 ../../library/sqlite3.rst:1090 +#: ../../library/sqlite3.rst:1124 ../../library/sqlite3.rst:1141 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1075 ../../library/sqlite3.rst:1093 +#: ../../library/sqlite3.rst:1126 ../../library/sqlite3.rst:1144 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1075 ../../library/sqlite3.rst:1093 +#: ../../library/sqlite3.rst:1126 ../../library/sqlite3.rst:1144 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1079 +#: ../../library/sqlite3.rst:1130 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1090 +#: ../../library/sqlite3.rst:1141 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1096 +#: ../../library/sqlite3.rst:1147 msgid "" "The type system of the :mod:`sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via object " @@ -1170,18 +1199,18 @@ msgid "" "to different Python types via converters." msgstr "" -#: ../../library/sqlite3.rst:1103 +#: ../../library/sqlite3.rst:1154 msgid "Using adapters to store custom Python types in SQLite databases" msgstr "" -#: ../../library/sqlite3.rst:1105 +#: ../../library/sqlite3.rst:1156 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands`." msgstr "" -#: ../../library/sqlite3.rst:1109 +#: ../../library/sqlite3.rst:1160 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1191,11 +1220,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1121 +#: ../../library/sqlite3.rst:1172 msgid "Letting your object adapt itself" msgstr "" -#: ../../library/sqlite3.rst:1123 +#: ../../library/sqlite3.rst:1174 msgid "" "Suppose we have a ``Point`` class that represents a pair of coordinates, " "``x`` and ``y``, in a Cartesian coordinate system. The coordinate pair will " @@ -1205,107 +1234,107 @@ msgid "" "*protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1135 +#: ../../library/sqlite3.rst:1186 msgid "Registering an adapter callable" msgstr "" -#: ../../library/sqlite3.rst:1137 +#: ../../library/sqlite3.rst:1188 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1145 +#: ../../library/sqlite3.rst:1196 msgid "Converting SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1147 +#: ../../library/sqlite3.rst:1198 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1152 +#: ../../library/sqlite3.rst:1203 msgid "" "Let's go back to the :class:`Point` class. We stored the x and y coordinates " "separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1155 +#: ../../library/sqlite3.rst:1206 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1160 +#: ../../library/sqlite3.rst:1211 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1169 +#: ../../library/sqlite3.rst:1220 msgid "" "We now need to tell ``sqlite3`` when it should convert a given SQLite value. " "This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:1173 +#: ../../library/sqlite3.rst:1224 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1174 +#: ../../library/sqlite3.rst:1225 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1175 +#: ../../library/sqlite3.rst:1226 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1179 +#: ../../library/sqlite3.rst:1230 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:1185 +#: ../../library/sqlite3.rst:1236 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1187 +#: ../../library/sqlite3.rst:1238 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1190 +#: ../../library/sqlite3.rst:1241 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1194 +#: ../../library/sqlite3.rst:1245 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1198 +#: ../../library/sqlite3.rst:1249 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1202 +#: ../../library/sqlite3.rst:1253 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1208 +#: ../../library/sqlite3.rst:1259 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1313,25 +1342,25 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1217 +#: ../../library/sqlite3.rst:1268 msgid "Adapter and Converter Recipes" msgstr "" -#: ../../library/sqlite3.rst:1219 +#: ../../library/sqlite3.rst:1270 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:1262 +#: ../../library/sqlite3.rst:1313 msgid "Controlling Transactions" msgstr "" -#: ../../library/sqlite3.rst:1264 +#: ../../library/sqlite3.rst:1315 msgid "" "The ``sqlite3`` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:1267 +#: ../../library/sqlite3.rst:1318 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not :" "const:`None`, new transactions are implicitly opened before :meth:`~Cursor." @@ -1344,7 +1373,7 @@ msgid "" "isolation_level` attribute." msgstr "" -#: ../../library/sqlite3.rst:1279 +#: ../../library/sqlite3.rst:1330 msgid "" "If :attr:`~Connection.isolation_level` is set to :const:`None`, no " "transactions are implicitly opened at all. This leaves the underlying SQLite " @@ -1354,56 +1383,56 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:1287 +#: ../../library/sqlite3.rst:1338 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:1291 +#: ../../library/sqlite3.rst:1342 msgid "" ":mod:`sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:1305 +#: ../../library/sqlite3.rst:1356 msgid "SQLite URI tricks" msgstr "" -#: ../../library/sqlite3.rst:1307 +#: ../../library/sqlite3.rst:1358 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:1309 +#: ../../library/sqlite3.rst:1360 msgid "Open a database in read-only mode::" msgstr "" -#: ../../library/sqlite3.rst:1313 +#: ../../library/sqlite3.rst:1364 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file::" msgstr "" -#: ../../library/sqlite3.rst:1318 +#: ../../library/sqlite3.rst:1369 msgid "Create a shared named in-memory database::" msgstr "" -#: ../../library/sqlite3.rst:1327 +#: ../../library/sqlite3.rst:1378 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:1333 +#: ../../library/sqlite3.rst:1384 msgid "Using :mod:`sqlite3` efficiently" msgstr "" -#: ../../library/sqlite3.rst:1337 -msgid "Using shortcut methods" +#: ../../library/sqlite3.rst:1390 +msgid "Using connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:1339 +#: ../../library/sqlite3.rst:1392 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1415,27 +1444,27 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:1352 +#: ../../library/sqlite3.rst:1405 msgid "Accessing columns by name instead of by index" msgstr "" -#: ../../library/sqlite3.rst:1354 +#: ../../library/sqlite3.rst:1407 msgid "" "One useful feature of the :mod:`sqlite3` module is the built-in :class:" "`sqlite3.Row` class designed to be used as a row factory." msgstr "" -#: ../../library/sqlite3.rst:1357 +#: ../../library/sqlite3.rst:1410 msgid "" "Rows wrapped with this class can be accessed both by index (like tuples) and " "case-insensitively by name:" msgstr "" -#: ../../library/sqlite3.rst:1366 +#: ../../library/sqlite3.rst:1419 msgid "Using the connection as a context manager" msgstr "" -#: ../../library/sqlite3.rst:1368 +#: ../../library/sqlite3.rst:1421 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1445,26 +1474,17 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:1377 +#: ../../library/sqlite3.rst:1430 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:1382 +#: ../../library/sqlite3.rst:1435 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:1389 -msgid "Footnotes" -msgstr "註解" - -#: ../../library/sqlite3.rst:1390 -msgid "" -"The sqlite3 module is not built with loadable extension support by default, " -"because some platforms (notably macOS) have SQLite libraries which are " -"compiled without this feature. To get loadable extension support, you must " -"pass the :option:`--enable-loadable-sqlite-extensions` option to configure." -msgstr "" +#~ msgid "Footnotes" +#~ msgstr "註解" pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy