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