@@ -1987,13 +1987,13 @@ msgid ""
1987
1987
"iterate over it directly using only a single call on the :class:`Connection` "
1988
1988
"object."
1989
1989
msgstr ""
1990
- ":class:`Connection` クラスのメソッド :meth:`~Connection.execute`, :meth:"
1991
- "`~Connection.executemany`, :meth:`~Connection.executescript` を使うことで、 "
1992
- "(しばしば余計な) :class:`Cursor` オブジェクトをわざわざ作り出さずに済むので、 "
1993
- "コードをより簡潔に書くことができます。 :class:`Cursor` オブジェクトは暗黙裡に "
1994
- "生成されショートカットメソッドの戻り値として受け取ることができます。この方法 "
1995
- "を使えば 、 ``SELECT`` 文を実行してその結果について反復することが、 :class: "
1996
- "`Connection` オブジェクトに対する呼び出し一つで行なえます。"
1990
+ ":class:`Connection` クラスのメソッド :meth:`~Connection.execute` と :meth:"
1991
+ "`~Connection.executemany` と :meth:`~Connection.executescript` を使うこと "
1992
+ "で、 (しばしば余計な) :class:`Cursor` オブジェクトをわざわざ作り出さずに済む "
1993
+ "ので、 コードをより簡潔に書くことができます。 :class:`Cursor` オブジェクトは暗 "
1994
+ "黙裡に生成され、ショートカット・メソッドの戻り値として受け取ることができま "
1995
+ "す。この方法を使えば 、 ``SELECT`` 文を実行してその結果について反復すること "
1996
+ "が、 :class: `Connection` オブジェクトに対する呼び出し一つで行なえます。"
1997
1997
1998
1998
#: ../../library/sqlite3.rst:1758
1999
1999
msgid "How to use the connection context manager"
@@ -2008,12 +2008,6 @@ msgid ""
2008
2008
"fails, or if the body of the ``with`` statement raises an uncaught "
2009
2009
"exception, the transaction is rolled back."
2010
2010
msgstr ""
2011
- "Connection object can be used as a context manager that automatically "
2012
- "commits or rolls back open transactions when leaving the body of the context "
2013
- "manager. If the body of the with statement finishes without exceptions, the "
2014
- "transaction is committed. If this commit fails, or if the body of the "
2015
- "``with`` statement raises an uncaught exception, the transaction is rolled "
2016
- "back.\n"
2017
2011
":class:`Connection` ブジェクトは、コンテキストマネージャのブロックから離れる"
2018
2012
"ときに、開いているトランザクションを自動的にコミットまたはロールバックするコ"
2019
2013
"ンテキストマネージャとして使用できます。 :keyword:`with` 文のブロックが例外無"
@@ -2067,6 +2061,8 @@ msgid ""
2067
2061
"More information about this feature, including a list of parameters, can be "
2068
2062
"found in the `SQLite URI documentation`_."
2069
2063
msgstr ""
2064
+ "パラメータのリストを含む、この機能の詳細については、 `SQLite URI "
2065
+ "documentation`_ を参照してください。"
2070
2066
2071
2067
#: ../../library/sqlite3.rst:1853
2072
2068
msgid "How to create and use row factories"
@@ -2078,6 +2074,10 @@ msgid ""
2078
2074
"class:`!tuple` does not suit your needs, you can use the :class:`sqlite3."
2079
2075
"Row` class or a custom :attr:`~Cursor.row_factory`."
2080
2076
msgstr ""
2077
+ "デフォルトでは、 :mod:`!sqlite3` は各行(row)を :class:`タプル <tuple>` として"
2078
+ "表します。 :class:`タプル <!tuple>` があなたのニーズと合わない場合は、 :"
2079
+ "class:`sqlite3.Row` クラスまたはカスタム :attr:`~Cursor.row_factory` を使用で"
2080
+ "きます。"
2081
2081
2082
2082
#: ../../library/sqlite3.rst:1860
2083
2083
msgid ""
@@ -2086,6 +2086,10 @@ msgid ""
2086
2086
"`Connection.row_factory`, so all cursors created from the connection will "
2087
2087
"use the same row factory."
2088
2088
msgstr ""
2089
+ ":attr:`!row_factory` は :class:`Cursor` と :class:`Connection` の両方に属性と"
2090
+ "して存在しますが、 その接続(connection)から作成されたすべてのカーソルが同一の"
2091
+ "行工場(row factory)を使用するようにするために、 :class:`Connection."
2092
+ "row_factory` を設定することをお勧めします。"
2089
2093
2090
2094
#: ../../library/sqlite3.rst:1865
2091
2095
msgid ""
@@ -2098,32 +2102,41 @@ msgstr ""
2098
2102
#: ../../library/sqlite3.rst:1875
2099
2103
msgid "Queries now return :class:`!Row` objects:"
2100
2104
msgstr ""
2105
+ "このように設定すると、クエリは :class:`!Row`オブジェクトを返すようになります:"
2101
2106
2102
2107
#: ../../library/sqlite3.rst:1890
2103
2108
msgid ""
2104
2109
"You can create a custom :attr:`~Cursor.row_factory` that returns each row as "
2105
2110
"a :class:`dict`, with column names mapped to values:"
2106
2111
msgstr ""
2112
+ "各列名が各値にマップされた :class:`dict` として行を返す、カスタム :attr:"
2113
+ "`~Cursor.row_factory` を作成することもできます:"
2107
2114
2108
2115
#: ../../library/sqlite3.rst:1899
2109
2116
msgid ""
2110
2117
"Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:"
2111
2118
msgstr ""
2119
+ "これを使うと、クエリは :class:`タプル <!tuple>` の代わりに :class:`!dict` を"
2120
+ "返すようになります:"
2112
2121
2113
2122
#: ../../library/sqlite3.rst:1909
2114
2123
msgid "The following row factory returns a :term:`named tuple`:"
2115
2124
msgstr ""
2125
+ "以下の行工場(row factory)は :term:`名前付きタプル <named tuple>` を返します:"
2116
2126
2117
2127
#: ../../library/sqlite3.rst:1920
2118
2128
msgid ":func:`!namedtuple_factory` can be used as follows:"
2119
- msgstr ""
2129
+ msgstr ":func:`!namedtuple_factory` は以下のようにして使う事ができます: "
2120
2130
2121
2131
#: ../../library/sqlite3.rst:1935
2122
2132
msgid ""
2123
2133
"With some adjustments, the above recipe can be adapted to use a :class:"
2124
2134
"`~dataclasses.dataclass`, or any other custom class, instead of a :class:"
2125
2135
"`~collections.namedtuple`."
2126
2136
msgstr ""
2137
+ "上記レシピをチューニングすれば、 :class:`~collections.namedtuple` の代わり"
2138
+ "に :class:`~dataclasses.dataclass` または、その他のカスタム・クラスを使用する"
2139
+ "ように適合(adapt)させることができます。"
2127
2140
2128
2141
#: ../../library/sqlite3.rst:1943
2129
2142
msgid "Explanation"
0 commit comments