7
7
msgstr ""
8
8
"Project-Id-Version : Python 3.11\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
- "POT-Creation-Date : 2023-01-15 00:18 +0000\n "
10
+ "POT-Creation-Date : 2023-01-19 00:17 +0000\n "
11
11
"PO-Revision-Date : 2018-05-23 16:10+0000\n "
12
12
"
Last-Translator :
Adrian Liaw <[email protected] >\n "
13
13
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -1773,24 +1773,24 @@ msgid ""
1773
1773
"are ignored. Here's an example of both styles:"
1774
1774
msgstr ""
1775
1775
1776
- #: ../../library/sqlite3.rst:1866
1776
+ #: ../../library/sqlite3.rst:1865
1777
1777
msgid ""
1778
1778
":pep:`249` numeric placeholders are *not* supported. If used, they will be "
1779
1779
"interpreted as named placeholders."
1780
1780
msgstr ""
1781
1781
1782
- #: ../../library/sqlite3.rst:1873
1782
+ #: ../../library/sqlite3.rst:1872
1783
1783
msgid "How to adapt custom Python types to SQLite values"
1784
1784
msgstr ""
1785
1785
1786
- #: ../../library/sqlite3.rst:1875
1786
+ #: ../../library/sqlite3.rst:1874
1787
1787
msgid ""
1788
1788
"SQLite supports only a limited set of data types natively. To store custom "
1789
1789
"Python types in SQLite databases, *adapt* them to one of the :ref:`Python "
1790
1790
"types SQLite natively understands <sqlite3-types>`."
1791
1791
msgstr ""
1792
1792
1793
- #: ../../library/sqlite3.rst:1879
1793
+ #: ../../library/sqlite3.rst:1878
1794
1794
msgid ""
1795
1795
"There are two ways to adapt Python objects to SQLite types: letting your "
1796
1796
"object adapt itself, or using an *adapter callable*. The latter will take "
@@ -1800,11 +1800,11 @@ msgid ""
1800
1800
"custom adapter functions."
1801
1801
msgstr ""
1802
1802
1803
- #: ../../library/sqlite3.rst:1891
1803
+ #: ../../library/sqlite3.rst:1890
1804
1804
msgid "How to write adaptable objects"
1805
1805
msgstr ""
1806
1806
1807
- #: ../../library/sqlite3.rst:1893
1807
+ #: ../../library/sqlite3.rst:1892
1808
1808
msgid ""
1809
1809
"Suppose we have a :class:`!Point` class that represents a pair of "
1810
1810
"coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The "
@@ -1814,84 +1814,84 @@ msgid ""
1814
1814
"object passed to *protocol* will be of type :class:`PrepareProtocol`."
1815
1815
msgstr ""
1816
1816
1817
- #: ../../library/sqlite3.rst:1924
1817
+ #: ../../library/sqlite3.rst:1923
1818
1818
msgid "How to register adapter callables"
1819
1819
msgstr ""
1820
1820
1821
- #: ../../library/sqlite3.rst:1926
1821
+ #: ../../library/sqlite3.rst:1925
1822
1822
msgid ""
1823
1823
"The other possibility is to create a function that converts the Python "
1824
1824
"object to an SQLite-compatible type. This function can then be registered "
1825
1825
"using :func:`register_adapter`."
1826
1826
msgstr ""
1827
1827
1828
- #: ../../library/sqlite3.rst:1956
1828
+ #: ../../library/sqlite3.rst:1955
1829
1829
msgid "How to convert SQLite values to custom Python types"
1830
1830
msgstr ""
1831
1831
1832
- #: ../../library/sqlite3.rst:1958
1832
+ #: ../../library/sqlite3.rst:1957
1833
1833
msgid ""
1834
1834
"Writing an adapter lets you convert *from* custom Python types *to* SQLite "
1835
1835
"values. To be able to convert *from* SQLite values *to* custom Python types, "
1836
1836
"we use *converters*."
1837
1837
msgstr ""
1838
1838
1839
- #: ../../library/sqlite3.rst:1963
1839
+ #: ../../library/sqlite3.rst:1962
1840
1840
msgid ""
1841
1841
"Let's go back to the :class:`!Point` class. We stored the x and y "
1842
1842
"coordinates separated via semicolons as strings in SQLite."
1843
1843
msgstr ""
1844
1844
1845
- #: ../../library/sqlite3.rst:1966
1845
+ #: ../../library/sqlite3.rst:1965
1846
1846
msgid ""
1847
1847
"First, we'll define a converter function that accepts the string as a "
1848
1848
"parameter and constructs a :class:`!Point` object from it."
1849
1849
msgstr ""
1850
1850
1851
- #: ../../library/sqlite3.rst:1971
1851
+ #: ../../library/sqlite3.rst:1970
1852
1852
msgid ""
1853
1853
"Converter functions are **always** passed a :class:`bytes` object, no matter "
1854
1854
"the underlying SQLite data type."
1855
1855
msgstr ""
1856
1856
1857
- #: ../../library/sqlite3.rst:1980
1857
+ #: ../../library/sqlite3.rst:1979
1858
1858
msgid ""
1859
1859
"We now need to tell :mod:`!sqlite3` when it should convert a given SQLite "
1860
1860
"value. This is done when connecting to a database, using the *detect_types* "
1861
1861
"parameter of :func:`connect`. There are three options:"
1862
1862
msgstr ""
1863
1863
1864
- #: ../../library/sqlite3.rst:1984
1864
+ #: ../../library/sqlite3.rst:1983
1865
1865
msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`"
1866
1866
msgstr ""
1867
1867
1868
- #: ../../library/sqlite3.rst:1985
1868
+ #: ../../library/sqlite3.rst:1984
1869
1869
msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`"
1870
1870
msgstr ""
1871
1871
1872
- #: ../../library/sqlite3.rst:1986
1872
+ #: ../../library/sqlite3.rst:1985
1873
1873
msgid ""
1874
1874
"Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3."
1875
1875
"PARSE_COLNAMES``. Column names take precedence over declared types."
1876
1876
msgstr ""
1877
1877
1878
- #: ../../library/sqlite3.rst:1990
1878
+ #: ../../library/sqlite3.rst:1989
1879
1879
msgid "The following example illustrates the implicit and explicit approaches:"
1880
1880
msgstr ""
1881
1881
1882
- #: ../../library/sqlite3.rst:2041
1882
+ #: ../../library/sqlite3.rst:2040
1883
1883
msgid "Adapter and converter recipes"
1884
1884
msgstr ""
1885
1885
1886
- #: ../../library/sqlite3.rst:2043
1886
+ #: ../../library/sqlite3.rst:2042
1887
1887
msgid "This section shows recipes for common adapters and converters."
1888
1888
msgstr ""
1889
1889
1890
- #: ../../library/sqlite3.rst:2105
1890
+ #: ../../library/sqlite3.rst:2104
1891
1891
msgid "How to use connection shortcut methods"
1892
1892
msgstr ""
1893
1893
1894
- #: ../../library/sqlite3.rst:2107
1894
+ #: ../../library/sqlite3.rst:2106
1895
1895
msgid ""
1896
1896
"Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :"
1897
1897
"meth:`~Connection.executescript` methods of the :class:`Connection` class, "
@@ -1903,11 +1903,11 @@ msgid ""
1903
1903
"object."
1904
1904
msgstr ""
1905
1905
1906
- #: ../../library/sqlite3.rst:2148
1906
+ #: ../../library/sqlite3.rst:2147
1907
1907
msgid "How to use the connection context manager"
1908
1908
msgstr ""
1909
1909
1910
- #: ../../library/sqlite3.rst:2150
1910
+ #: ../../library/sqlite3.rst:2149
1911
1911
msgid ""
1912
1912
"A :class:`Connection` object can be used as a context manager that "
1913
1913
"automatically commits or rolls back open transactions when leaving the body "
@@ -1917,118 +1917,118 @@ msgid ""
1917
1917
"exception, the transaction is rolled back."
1918
1918
msgstr ""
1919
1919
1920
- #: ../../library/sqlite3.rst:2159
1920
+ #: ../../library/sqlite3.rst:2158
1921
1921
msgid ""
1922
1922
"If there is no open transaction upon leaving the body of the ``with`` "
1923
1923
"statement, the context manager is a no-op."
1924
1924
msgstr ""
1925
1925
1926
- #: ../../library/sqlite3.rst:2164
1926
+ #: ../../library/sqlite3.rst:2163
1927
1927
msgid ""
1928
1928
"The context manager neither implicitly opens a new transaction nor closes "
1929
1929
"the connection."
1930
1930
msgstr ""
1931
1931
1932
- #: ../../library/sqlite3.rst:2197
1932
+ #: ../../library/sqlite3.rst:2196
1933
1933
msgid "How to work with SQLite URIs"
1934
1934
msgstr ""
1935
1935
1936
- #: ../../library/sqlite3.rst:2199
1936
+ #: ../../library/sqlite3.rst:2198
1937
1937
msgid "Some useful URI tricks include:"
1938
1938
msgstr ""
1939
1939
1940
- #: ../../library/sqlite3.rst:2201
1940
+ #: ../../library/sqlite3.rst:2200
1941
1941
msgid "Open a database in read-only mode:"
1942
1942
msgstr ""
1943
1943
1944
- #: ../../library/sqlite3.rst:2210
1944
+ #: ../../library/sqlite3.rst:2209
1945
1945
msgid ""
1946
1946
"Do not implicitly create a new database file if it does not already exist; "
1947
1947
"will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:"
1948
1948
msgstr ""
1949
1949
1950
- #: ../../library/sqlite3.rst:2220
1950
+ #: ../../library/sqlite3.rst:2219
1951
1951
msgid "Create a shared named in-memory database:"
1952
1952
msgstr ""
1953
1953
1954
- #: ../../library/sqlite3.rst:2234
1954
+ #: ../../library/sqlite3.rst:2233
1955
1955
msgid ""
1956
1956
"More information about this feature, including a list of parameters, can be "
1957
1957
"found in the `SQLite URI documentation`_."
1958
1958
msgstr ""
1959
1959
1960
- #: ../../library/sqlite3.rst:2243
1960
+ #: ../../library/sqlite3.rst:2242
1961
1961
msgid "How to create and use row factories"
1962
1962
msgstr ""
1963
1963
1964
- #: ../../library/sqlite3.rst:2245
1964
+ #: ../../library/sqlite3.rst:2244
1965
1965
msgid ""
1966
1966
"By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :"
1967
1967
"class:`!tuple` does not suit your needs, you can use the :class:`sqlite3."
1968
1968
"Row` class or a custom :attr:`~Cursor.row_factory`."
1969
1969
msgstr ""
1970
1970
1971
- #: ../../library/sqlite3.rst:2250
1971
+ #: ../../library/sqlite3.rst:2249
1972
1972
msgid ""
1973
1973
"While :attr:`!row_factory` exists as an attribute both on the :class:"
1974
1974
"`Cursor` and the :class:`Connection`, it is recommended to set :class:"
1975
1975
"`Connection.row_factory`, so all cursors created from the connection will "
1976
1976
"use the same row factory."
1977
1977
msgstr ""
1978
1978
1979
- #: ../../library/sqlite3.rst:2255
1979
+ #: ../../library/sqlite3.rst:2254
1980
1980
msgid ""
1981
1981
":class:`!Row` provides indexed and case-insensitive named access to columns, "
1982
1982
"with minimal memory overhead and performance impact over a :class:`!tuple`. "
1983
1983
"To use :class:`!Row` as a row factory, assign it to the :attr:`!row_factory` "
1984
1984
"attribute:"
1985
1985
msgstr ""
1986
1986
1987
- #: ../../library/sqlite3.rst:2265
1987
+ #: ../../library/sqlite3.rst:2264
1988
1988
msgid "Queries now return :class:`!Row` objects:"
1989
1989
msgstr ""
1990
1990
1991
- #: ../../library/sqlite3.rst:2280
1991
+ #: ../../library/sqlite3.rst:2279
1992
1992
msgid ""
1993
1993
"You can create a custom :attr:`~Cursor.row_factory` that returns each row as "
1994
1994
"a :class:`dict`, with column names mapped to values:"
1995
1995
msgstr ""
1996
1996
1997
- #: ../../library/sqlite3.rst:2289
1997
+ #: ../../library/sqlite3.rst:2288
1998
1998
msgid ""
1999
1999
"Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:"
2000
2000
msgstr ""
2001
2001
2002
- #: ../../library/sqlite3.rst:2299
2002
+ #: ../../library/sqlite3.rst:2298
2003
2003
msgid "The following row factory returns a :term:`named tuple`:"
2004
2004
msgstr ""
2005
2005
2006
- #: ../../library/sqlite3.rst:2310
2006
+ #: ../../library/sqlite3.rst:2309
2007
2007
msgid ":func:`!namedtuple_factory` can be used as follows:"
2008
2008
msgstr ""
2009
2009
2010
- #: ../../library/sqlite3.rst:2325
2010
+ #: ../../library/sqlite3.rst:2324
2011
2011
msgid ""
2012
2012
"With some adjustments, the above recipe can be adapted to use a :class:"
2013
2013
"`~dataclasses.dataclass`, or any other custom class, instead of a :class:"
2014
2014
"`~collections.namedtuple`."
2015
2015
msgstr ""
2016
2016
2017
- #: ../../library/sqlite3.rst:2333
2017
+ #: ../../library/sqlite3.rst:2332
2018
2018
msgid "Explanation"
2019
2019
msgstr "解釋"
2020
2020
2021
- #: ../../library/sqlite3.rst:2338
2021
+ #: ../../library/sqlite3.rst:2337
2022
2022
msgid "Transaction control"
2023
2023
msgstr ""
2024
2024
2025
- #: ../../library/sqlite3.rst:2340
2025
+ #: ../../library/sqlite3.rst:2339
2026
2026
msgid ""
2027
2027
"The :mod:`!sqlite3` module does not adhere to the transaction handling "
2028
2028
"recommended by :pep:`249`."
2029
2029
msgstr ""
2030
2030
2031
- #: ../../library/sqlite3.rst:2343
2031
+ #: ../../library/sqlite3.rst:2342
2032
2032
msgid ""
2033
2033
"If the connection attribute :attr:`~Connection.isolation_level` is not "
2034
2034
"``None``, new transactions are implicitly opened before :meth:`~Cursor."
@@ -2042,7 +2042,7 @@ msgid ""
2042
2042
"attribute."
2043
2043
msgstr ""
2044
2044
2045
- #: ../../library/sqlite3.rst:2356
2045
+ #: ../../library/sqlite3.rst:2355
2046
2046
msgid ""
2047
2047
"If :attr:`~Connection.isolation_level` is set to ``None``, no transactions "
2048
2048
"are implicitly opened at all. This leaves the underlying SQLite library in "
@@ -2052,14 +2052,14 @@ msgid ""
2052
2052
"in_transaction` attribute."
2053
2053
msgstr ""
2054
2054
2055
- #: ../../library/sqlite3.rst:2364
2055
+ #: ../../library/sqlite3.rst:2363
2056
2056
msgid ""
2057
2057
"The :meth:`~Cursor.executescript` method implicitly commits any pending "
2058
2058
"transaction before execution of the given SQL script, regardless of the "
2059
2059
"value of :attr:`~Connection.isolation_level`."
2060
2060
msgstr ""
2061
2061
2062
- #: ../../library/sqlite3.rst:2368
2062
+ #: ../../library/sqlite3.rst:2367
2063
2063
msgid ""
2064
2064
":mod:`!sqlite3` used to implicitly commit an open transaction before DDL "
2065
2065
"statements. This is no longer the case."
0 commit comments