1010# ppcfish <[email protected] >, 20211111# Kade For, 2021
1212# dogn he <[email protected] >, 202113- # Freesand Leo <[email protected] >, 2021 13+ # Freesand Leo <[email protected] >, 2022 1414#
1515#, fuzzy
1616msgid ""
@@ -19,7 +19,7 @@ msgstr ""
1919"Report-Msgid-Bugs-To : \n "
2020"POT-Creation-Date : 2022-06-16 06:28+0000\n "
2121"PO-Revision-Date : 2021-06-28 01:13+0000\n "
22- "
Last-Translator :
Freesand Leo <[email protected] >, 2021 \n "
22+ "
Last-Translator :
Freesand Leo <[email protected] >, 2022 \n "
2323"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2424"MIME-Version : 1.0\n "
2525"Content-Type : text/plain; charset=UTF-8\n "
@@ -54,31 +54,37 @@ msgid ""
5454"interface compliant with the DB-API 2.0 specification described by "
5555":pep:`249`, and requires SQLite 3.7.15 or newer."
5656msgstr ""
57+ "sqlite3 模块由 Gerhard Häring 编写。 它提供了 :pep:`249` 所描述的符合 DB-API 2.0 规范的 SQL "
58+ "接口,并要求 SQLite 3.7.15 或更新的版本。"
5759
5860#: ../../library/sqlite3.rst:24
5961msgid ""
6062"To use the module, start by creating a :class:`Connection` object that "
6163"represents the database. Here the data will be stored in the "
6264":file:`example.db` file::"
6365msgstr ""
66+ "要使用这个模块,请先创建一个 :class:`Connection` 对象来代表数据库。 在这里数据将会存储在 :file:`example.db` "
67+ "文件中::"
6468
6569#: ../../library/sqlite3.rst:31
6670msgid ""
6771"The special path name ``:memory:`` can be provided to create a temporary "
6872"database in RAM."
69- msgstr ""
73+ msgstr "特殊路径名称 ``:memory:`` 可被提供用来在 RAM 中创建一个临时数据库。 "
7074
7175#: ../../library/sqlite3.rst:34
7276msgid ""
7377"Once a :class:`Connection` has been established, create a :class:`Cursor` "
7478"object and call its :meth:`~Cursor.execute` method to perform SQL commands::"
7579msgstr ""
80+ "一旦建立了 :class:`Connection`,即可创建一个 :class:`Cursor` 对象并调用其 "
81+ ":meth:`~Cursor.execute` 方法来执行 SQL 命令::"
7682
7783#: ../../library/sqlite3.rst:53
7884msgid ""
7985"The saved data is persistent: it can be reloaded in a subsequent session "
8086"even after restarting the Python interpreter::"
81- msgstr ""
87+ msgstr "保存的数据将是持久化的:它可在后续会话中被重载,即使是在重启 Python 解释器之后:: "
8288
8389#: ../../library/sqlite3.rst:60
8490msgid ""
@@ -87,6 +93,9 @@ msgid ""
8793"to retrieve a single matching row, or call :meth:`~Cursor.fetchall` to get a"
8894" list of the matching rows."
8995msgstr ""
96+ "要在执行 SELECT 语句之后获取数据,你可以把游标当作一个 :term:`iterator`,调用游标的 "
97+ ":meth:`~Cursor.fetchone` 方法来获取一个匹配的行,或者调用 :meth:`~Cursor.fetchall` "
98+ "来得到一个包含多个匹配行的列表。"
9099
91100#: ../../library/sqlite3.rst:65
92101msgid "This example uses the iterator form::"
@@ -99,6 +108,8 @@ msgid ""
99108"vulnerable to SQL injection attacks (see the `xkcd webcomic "
100109"<https://xkcd.com/327/>`_ for a humorous example of what can go wrong)::"
101110msgstr ""
111+ "SQL 操作通常会需要使用来自 Python 变量的值。 不过,请避免使用 Python 的字符串操作来拼装查询,因为这样易受 SQL 注入攻击(请在 "
112+ "`xkcd webcomic <https://xkcd.com/327/>`_ 查看有关这会造成什么后果的一个幽默例子)::"
102113
103114#: ../../library/sqlite3.rst:87
104115msgid ""
@@ -115,6 +126,12 @@ msgid ""
115126"given, it must contain keys for all named parameters. Any extra items are "
116127"ignored. Here's an example of both styles:"
117128msgstr ""
129+ "为此,应使用 DB-API 的形参替换。 要将一个变量插入到查询字符串中,请在字符串中放一个占位符,并通过提供包含多个值的 :class:`元组` "
130+ "作为游标的 :meth:`~Cursor.execute` 方法的第二个参数来将实际值替换到查询中。 SQL "
131+ "语句可以使用两种类别的占位符之一:问号占位符(问号风格)或名称占位符(名称风格)。 对于问号风格,``parameters`` 必须是一个 "
132+ ":term:`序列 <sequence>`。 对于名称风格,它可以是一个 :term:`序列 <sequence>` 或者 :class:`dict` "
133+ "实例。 :term:`序列 <sequence>` 的长度必须匹配占位符的数量,否则会引发 :exc:`ProgrammingError`。 "
134+ "如果给出的是一个 :class:`dict`,则它必须包含与全部名称形参相对应的键。 任何额外的条目都会被忽略。 下面是一个同时包含这两种风格的例子:"
118135
119136#: ../../library/sqlite3.rst:107
120137msgid "https://www.sqlite.org"
@@ -150,14 +167,14 @@ msgstr "模块函数和常量"
150167msgid ""
151168"String constant stating the supported DB-API level. Required by the DB-API. "
152169"Hard-coded to ``\" 2.0\" ``."
153- msgstr ""
170+ msgstr "指明所支持的 DB-API 级别的字符串常量。 根据 DB-API 的需要设置。 硬编码为 `` \" 2.0 \" ``。 "
154171
155172#: ../../library/sqlite3.rst:129
156173msgid ""
157174"String constant stating the type of parameter marker formatting expected by "
158175"the :mod:`sqlite3` module. Required by the DB-API. Hard-coded to "
159176"``\" qmark\" ``."
160- msgstr ""
177+ msgstr "指明 :mod:`sqlite3` 模块所预期的形参标记格式化类型。 根据 DB-API 的需要设置。 硬编码为 `` \" qmark \" ``。 "
161178
162179#: ../../library/sqlite3.rst:135
163180msgid ""
@@ -166,6 +183,8 @@ msgid ""
166183"supports. However, the DB-API does not allow multiple values for the "
167184"``paramstyle`` attribute."
168185msgstr ""
186+ ":mod:`sqlite3` 模块同时支持 ``qmark`` 和 ``numeric`` DB-API 形参风格,因为这是下层的 SQLite "
187+ "库所支持的。 不过,DB-API 不允许 ``paramstyle`` 属性有多个值。"
169188
170189#: ../../library/sqlite3.rst:142
171190msgid ""
0 commit comments