# Copyright (C) 2001-2018, Python Software Foundation # For licence information, see README file. # msgid "" msgstr "" "Project-Id-Version: Python 3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-18 15:46+0200\n" "PO-Revision-Date: 2019-03-26 15:55+0100\n" "Last-Translator: Julien Palard \n" "Language-Team: FRENCH \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.0.6\n" #: library/sqlite3.rst:2 msgid ":mod:`sqlite3` --- DB-API 2.0 interface for SQLite databases" msgstr ":mod:`sqlite3` — Interface DB-API 2.0 pour bases de données SQLite" #: library/sqlite3.rst:9 msgid "**Source code:** :source:`Lib/sqlite3/`" msgstr "**Code source :** :source:`Lib/sqlite3/`" #: library/sqlite3.rst:23 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 " "using a nonstandard variant of the SQL query language. Some applications can " "use SQLite for internal data storage. It's also possible to prototype an " "application using SQLite and then port the code to a larger database such as " "PostgreSQL or Oracle." msgstr "" "SQLite est une bibliothèque C qui fournit une base de données légère sur " "disque ne nécessitant pas de processus serveur et qui utilise une variante " "(non standard) du langage de requête SQL pour accéder aux données. Certaines " "applications peuvent utiliser SQLite pour le stockage de données internes. " "Il est également possible de créer une application prototype utilisant " "SQLite, puis de modifier le code pour utiliser une base de données plus " "robuste telle que PostgreSQL ou Oracle." #: library/sqlite3.rst:30 #, fuzzy msgid "" "The :mod:`!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 "" "Le module *sqlite3* a été écrit par Gerhard Häring. Il fournit une " "interface SQL conforme à la spécification DB-API 2.0 décrite par :pep:`249`." #: library/sqlite3.rst:34 msgid "This document includes four main sections:" msgstr "Ce document inclus 4 sections principales :" #: library/sqlite3.rst:36 msgid ":ref:`sqlite3-tutorial` teaches how to use the :mod:`!sqlite3` module." msgstr "" ":ref:`tutoriel sqlite3 ` explique comment utiliser le " "module :mod:`!sqlite3`." #: library/sqlite3.rst:37 msgid "" ":ref:`sqlite3-reference` describes the classes and functions this module " "defines." msgstr "" ":ref:`référence sqlite3 ` décrit les classes et les " "fonctions que ce module définit." #: library/sqlite3.rst:39 msgid ":ref:`sqlite3-howtos` details how to handle specific tasks." msgstr "" ":ref:`guide sqlite3 ` détaille comment gérer des tâches " "spécifiques." #: library/sqlite3.rst:40 msgid "" ":ref:`sqlite3-explanation` provides in-depth background on transaction " "control." msgstr "" ":ref:`explications sqlite3 ` propose un contexte " "détaillé du contrôle de transaction." #: library/sqlite3.rst:47 msgid "https://www.sqlite.org" msgstr "https://www.sqlite.org" #: library/sqlite3.rst:46 msgid "" "The SQLite web page; the documentation describes the syntax and the " "available data types for the supported SQL dialect." msgstr "" "Dans la page Web de SQLite, la documentation décrit la syntaxe et les types " "de données disponibles qui sont pris en charge par cette variante SQL." #: library/sqlite3.rst:50 msgid "https://www.w3schools.com/sql/" msgstr "https://www.w3schools.com/sql/" #: library/sqlite3.rst:50 msgid "Tutorial, reference and examples for learning SQL syntax." msgstr "Tutoriel, référence et exemples pour apprendre la syntaxe SQL." #: library/sqlite3.rst:52 msgid ":pep:`249` - Database API Specification 2.0" msgstr ":pep:`249` — Spécifications de l'API 2.0 pour la base de données" #: library/sqlite3.rst:53 msgid "PEP written by Marc-André Lemburg." msgstr "PEP écrite par Marc-André Lemburg." #: library/sqlite3.rst:66 msgid "Tutorial" msgstr "Tutoriel" #: library/sqlite3.rst:68 msgid "" "In this tutorial, you will create a database of Monty Python movies using " "basic :mod:`!sqlite3` functionality. It assumes a fundamental understanding " "of database concepts, including `cursors`_ and `transactions`_." msgstr "" "Dans ce tutoriel, vous allez créer une base de données des films des Monty " "Python en utilisant les fonctionnalités de base de :mod:`!sqlite3`. Cela " "nécessite une compréhension élémentaire des concepts des bases de données, " "notamment les `curseurs`_ et les `transactions`_." #: library/sqlite3.rst:73 msgid "" "First, we need to create a new database and open a database connection to " "allow :mod:`!sqlite3` to work with it. Call :func:`sqlite3.connect` to to " "create a connection to the database :file:`tutorial.db` in the current " "working directory, implicitly creating it if it does not exist:" msgstr "" "Tout d’abord, nous devons créer une nouvelle base de données et ouvrir une " "connexion à la base de données pour permettre à :mod:`!sqlite3` de " "travailler avec elle. Appelez :func:`sqlite3.connect` pour créer une " "connexion à la base de données :file:`tutorial.db` dans le répertoire de " "travail actuel, en la créant implicitement si elle n’existe pas :" #: library/sqlite3.rst:84 msgid "" "The returned :class:`Connection` object ``con`` represents the connection to " "the on-disk database." msgstr "" "L’objet :class:`Connection` renvoyé — ``con`` — représente la connexion à la " "base de données sur disque." #: library/sqlite3.rst:87 msgid "" "In order to execute SQL statements and fetch results from SQL queries, we " "will need to use a database cursor. Call :meth:`con.cursor() ` to create the :class:`Cursor`:" msgstr "" "Afin d’exécuter les instructions SQL et de récupérer les résultats des " "requêtes SQL, nous devrons utiliser un curseur de base de données. Appelez :" "meth:`con.cursor() ` pour créer la :class:`Cursor` :" #: library/sqlite3.rst:95 msgid "" "Now that we've got a database connection and a cursor, we can create a " "database table ``movie`` with columns for title, release year, and review " "score. For simplicity, we can just use column names in the table declaration " "-- thanks to the `flexible typing`_ feature of SQLite, specifying the data " "types is optional. Execute the ``CREATE TABLE`` statement by calling :meth:" "`cur.execute(...) `:" msgstr "" "Maintenant que nous avons une connexion à la base de données et un curseur, " "nous pouvons créer une table ``movie`` avec des colonnes pour le titre, " "l’année de sortie et la note de la critique. Pour plus de simplicité, nous " "pouvons simplement utiliser les noms des colonnes dans la déclaration de la " "table — grâce à la fonctionnalité de `typage flexible `_ " "de SQLite, spécifier les types de données est facultatif. Exécutez " "l’instruction ``CREATE TABLE`` en appelant :meth:`cur.execute(…) ` :" #: library/sqlite3.rst:111 msgid "" "We can verify that the new table has been created by querying the " "``sqlite_master`` table built-in to SQLite, which should now contain an " "entry for the ``movie`` table definition (see `The Schema Table`_ for " "details). Execute that query by calling :meth:`cur.execute(...) `, assign the result to ``res``, and call :meth:`res.fetchone() " "` to fetch the resulting row:" msgstr "" "Nous pouvons vérifier que la nouvelle table a été créée en interrogeant la " "table ``sqlite_master`` intégrée à SQLite, qui devrait maintenant contenir " "une entrée pour la définition de la table ``movie`` (voir `le schéma Table " "`_ pour plus de détails). Exécutez cette requête en " "appelant :meth:`cur.execute(…) `, affectez le résultat à " "``res``, et appelez :meth:`res.fetchone() ` pour récupérer " "la ligne résultante :" #: library/sqlite3.rst:125 msgid "" "We can see that the table has been created, as the query returns a :class:" "`tuple` containing the table's name. If we query ``sqlite_master`` for a non-" "existent table ``spam``, :meth:`!res.fetchone()` will return ``None``:" msgstr "" "Nous pouvons voir que la table a été créée, puisque la requête retourne un :" "class:`tuple` contenant le nom de la table. Si nous interrogeons " "``sqlite_master`` pour une table ``spam`` inexistante, :meth:`!res." "fetchone()`` retournera ``None`` :" #: library/sqlite3.rst:136 msgid "" "Now, add two rows of data supplied as SQL literals by executing an " "``INSERT`` statement, once again by calling :meth:`cur.execute(...) `:" msgstr "" "Maintenant, ajoutez deux lignes de données en tant que littéraux SQL en " "exécutant une instruction ``INSERT``, une fois encore en appelant :meth:`cur." "execute(…) ` :" #: library/sqlite3.rst:148 msgid "" "The ``INSERT`` statement implicitly opens a transaction, which needs to be " "committed before changes are saved in the database (see :ref:`sqlite3-" "controlling-transactions` for details). Call :meth:`con.commit() ` on the connection object to commit the transaction:" msgstr "" "L’instruction ``INSERT`` ouvre implicitement une transaction, qui doit être " "validée avant que les modifications ne soient enregistrées dans la base de " "données (voir :ref:`contrôle des transactions SQL ` pour plus de détails). Appelez :meth:`con.commit() " "` sur l’objet de connexion pour valider la transaction :" #: library/sqlite3.rst:158 msgid "" "We can verify that the data was inserted correctly by executing a ``SELECT`` " "query. Use the now-familiar :meth:`cur.execute(...) ` to " "assign the result to ``res``, and call :meth:`res.fetchall() ` to return all resulting rows:" msgstr "" "Nous pouvons vérifier que les données ont été insérées correctement en " "exécutant une requête ``SELECT``. Utilisez la désormais familière :meth:`cur." "execute(…) ` pour affecter le résultat à ``res``, et " "appelez :meth:`res.fetchall() ` pour retourner toutes les " "lignes résultantes :" #: library/sqlite3.rst:170 msgid "" "The result is a :class:`list` of two :class:`!tuple`\\s, one per row, each " "containing that row's ``score`` value." msgstr "" "Le résultat est une :class:`liste ` de deux :class:`!tuple`\\s, une " "par ligne, chacun contenant la valeur ``score`` de cette ligne." #: library/sqlite3.rst:173 msgid "" "Now, insert three more rows by calling :meth:`cur.executemany(...) `:" msgstr "" "Maintenant, insérez trois lignes supplémentaires en appelant :meth:`cur." "executemany(…) ` :" #: library/sqlite3.rst:186 msgid "" "Notice that ``?`` placeholders are used to bind ``data`` to the query. " "Always use placeholders instead of :ref:`string formatting ` " "to bind Python values to SQL statements, to avoid `SQL injection attacks`_ " "(see :ref:`sqlite3-placeholders` for more details)." msgstr "" "Remarquez que les marqueurs ``?`` sont utilisés pour lier les ``data`` à la " "requête. Utilisez toujours les marqueurs au lieu d’:ref:`expressions " "formatées ` pour lier les valeurs Python aux instructions " "SQL, afin d’éviter les `injections SQL`_ (voir :ref:`placeholder SQL " "` pour plus de détails)." #: library/sqlite3.rst:192 msgid "" "We can verify that the new rows were inserted by executing a ``SELECT`` " "query, this time iterating over the results of the query:" msgstr "" "Nous pouvons vérifier que les nouvelles lignes ont été insérées en exécutant " "une requête ``SELECT``, cette fois-ci en itérant sur les résultats de la " "requête :" #: library/sqlite3.rst:206 msgid "" "Each row is a two-item :class:`tuple` of ``(year, title)``, matching the " "columns selected in the query." msgstr "" "Chaque ligne est un :class:`tuple` de deux éléments ``(année, titre)``, " "correspondant aux colonnes sélectionnées dans la requête." #: library/sqlite3.rst:209 msgid "" "Finally, verify that the database has been written to disk by calling :meth:" "`con.close() ` to close the existing connection, opening a " "new one, creating a new cursor, then querying the database:" msgstr "" "Enfin, vérifiez que la base de données a été écrite sur le disque en " "appelant :meth:`con.close() ` pour fermer la connexion " "existante, en ouvrir une nouvelle, créer un nouveau curseur, puis interroger " "la base de données :" #: library/sqlite3.rst:224 msgid "" "You've now created an SQLite database using the :mod:`!sqlite3` module, " "inserted data and retrieved values from it in multiple ways." msgstr "" "Vous avez maintenant créé une base de données SQLite à l’aide du module :mod:" "`!sqlite3`, inséré des données et récupéré des valeurs de plusieurs façons." #: library/sqlite3.rst:236 msgid ":ref:`sqlite3-howtos` for further reading:" msgstr ":ref:`guide sqlite3 ` pour une lecture plus poussée:" #: library/sqlite3.rst:238 msgid ":ref:`sqlite3-placeholders`" msgstr ":ref:`placeholders sqlite3 `" #: library/sqlite3.rst:239 msgid ":ref:`sqlite3-adapters`" msgstr ":ref:`adaptateurs sqlite3 `" #: library/sqlite3.rst:240 msgid ":ref:`sqlite3-converters`" msgstr ":ref:`convertisseurs sqlite3 `" #: library/sqlite3.rst:514 msgid ":ref:`sqlite3-connection-context-manager`" msgstr "" ":ref:`gestionnaire de contexte de connexion sqlite3 `" #: library/sqlite3.rst:243 msgid "" ":ref:`sqlite3-explanation` for in-depth background on transaction control." msgstr "" ":ref:`explications sqlite3 ` pour un contexte détaillé " "du contrôle de transaction." #: library/sqlite3.rst:248 msgid "Reference" msgstr "Référence" #: library/sqlite3.rst:256 #, fuzzy msgid "Module functions" msgstr "Fonctions et constantes du module" #: library/sqlite3.rst:263 msgid "Open a connection to an SQLite database." msgstr "Ouvrez une connexion à une base de données SQLite." #: library/sqlite3.rst:0 msgid "Parameters" msgstr "Paramètres" #: library/sqlite3.rst:265 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 "" "Le chemin d’accès au fichier de la base de données à ouvrir. Passez ``\":" "memory:\"`` pour ouvrir une connexion à une base de données qui est dans la " "RAM plutôt que sur le disque." #: library/sqlite3.rst:271 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 " "transaction to modify the database, it will be locked until that transaction " "is committed. Default five seconds." msgstr "" "Le temps (en secondes) que la connexion doit attendre avant de lever une " "exception, si la base de données est verrouillée par une autre connexion. Si " "une autre connexion ouvre une transaction pour modifier la base de données, " "celle-ci sera verrouillée jusqu’à ce que cette transaction soit validée. Par " "défaut, cinq secondes." #: library/sqlite3.rst:278 msgid "" "Control whether and how data types not :ref:`natively supported by SQLite " "` are looked up to be converted to Python types, using the " "converters registered with :func:`register_converter`. Set it to any " "combination (using ``|``, bitwise or) of :const:`PARSE_DECLTYPES` and :const:" "`PARSE_COLNAMES` to enable this. Column names takes precedence over declared " "types if both flags are set. Types cannot be detected for generated fields " "(for example ``max(data)``), even when the *detect_types* parameter is set; :" "class:`str` will be returned instead. By default (``0``), type detection is " "disabled." msgstr "" "Contrôle si et comment les types de données non :ref:`nativement pris en " "charge par SQLite ` sont recherchés pour être convertis en " "types Python, en utilisant les convertisseurs enregistrés avec :func:" "`register_converter`. Définissez-le à n’importe quelle combinaison (en " "utilisant ``|``, opérateurs bit-à-bit OR) de :const:`PARSE_DECLTYPES` et :" "const:`PARSE_COLNAMES` pour activer ceci. Les noms de colonnes ont la " "priorité sur les types déclarés si les deux drapeaux sont activés. Les types " "ne peuvent pas être détectés pour les champs générés (par exemple " "``max(data)``), même si le paramètre *detect_types* est activé ; :class:" "`str` sera retourné à la place. Par défaut (``0``), la détection des types " "est désactivée." #: library/sqlite3.rst:292 msgid "" "The :attr:`~Connection.isolation_level` of the connection, controlling " "whether and how transactions are implicitly opened. Can be ``\"DEFERRED\"`` " "(default), ``\"EXCLUSIVE\"`` or ``\"IMMEDIATE\"``; or ``None`` to disable " "opening transactions implicitly. See :ref:`sqlite3-controlling-transactions` " "for more." msgstr "" "L’attribut :attr:`~Connection.isolation_level` de la connexion, contrôlant " "si et comment les transactions sont ouvertes implicitement. Peut être " "``\"DEFERRED\"`` (par défaut), ``\"EXCLUSIVE\"`` ou ``\"IMMEDIATE\"`` ; ou " "``None`` pour désactiver l’ouverture implicite des transactions. Voir :ref:" "`contrôle des transactions sqlite3 ` pour " "en savoir plus." #: library/sqlite3.rst:300 msgid "" "If ``True`` (default), only the creating thread may use the connection. If " "``False``, the connection may be shared across multiple threads; if so, " "write operations should be serialized by the user to avoid data corruption." msgstr "" #: library/sqlite3.rst:306 msgid "" "A custom subclass of :class:`Connection` to create the connection with, if " "not the default :class:`Connection` class." msgstr "" "Une sous-classe personnalisée de :class:`Connection` pour créer la " "connexion, si ce n’est pas la classe par défaut :class:`Connection`." #: library/sqlite3.rst:310 msgid "" "The number of statements that :mod:`!sqlite3` should internally cache for " "this connection, to avoid parsing overhead. By default, 100 statements." msgstr "" #: library/sqlite3.rst:315 msgid "" "If set to ``True``, *database* is interpreted as a :abbr:`URI (Uniform " "Resource Identifier)` with a file path and an optional query string. The " "scheme part *must* be ``\"file:\"``, and the path can be relative or " "absolute. The query string allows passing parameters to SQLite, enabling " "various :ref:`sqlite3-uri-tricks`." msgstr "" "Si elle a pour valeur ``True``, la base de données est interprétée comme un :" "abbr:`URI (Uniform Resource Identifier)` avec un chemin d’accès au fichier " "et une chaîne de requête facultative. La partie schéma *doit* être ``\"file:" "\"``, et le chemin peut être relatif ou absolu. La chaîne d’interrogation " "permet de passer des paramètres à SQLite, ce qui permet d’activer diverses :" "ref:`astuces d’URI sqlite3 `." #: library/sqlite3.rst:0 #, fuzzy msgid "Return type" msgstr "Type Python" #: library/sqlite3.rst:326 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" #: library/sqlite3.rst:327 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." msgstr "" #: library/sqlite3.rst:329 msgid "The *uri* parameter." msgstr "" #: library/sqlite3.rst:332 msgid "" "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" "*database* peut maintenant aussi être un :term:`objet de type chemin `, et pas seulement une chaîne de caractères." #: library/sqlite3.rst:335 msgid "The ``sqlite3.connect/handle`` auditing event." msgstr "" #: library/sqlite3.rst:340 msgid "" "Return ``True`` if the string *statement* appears to contain one or more " "complete SQL statements. No syntactic verification or parsing of any kind is " "performed, other than checking that there are no unclosed string literals " "and the statement is terminated by a semicolon." msgstr "" "Renvoie ``True`` si la déclaration de la chaîne semble contenir une ou " "plusieurs déclarations SQL complètes. Aucune vérification syntaxique ou " "analyse syntaxique d’aucune sorte n’est effectuée, si ce n’est la " "vérification qu’il n’y a pas de chaîne littérale non fermée et que " "l’instruction se termine par un point-virgule." #: library/sqlite3.rst:346 #, fuzzy msgid "For example:" msgstr "Exemple :" #: library/sqlite3.rst:355 msgid "" "This function may be useful during command-line input to determine if the " "entered text seems to form a complete SQL statement, or if additional input " "is needed before calling :meth:`~Cursor.execute`." msgstr "" "Cette fonction peut être utile pendant la saisie en ligne de commande pour " "déterminer si le texte saisi semble former une instruction SQL complète, ou " "si une saisie supplémentaire est nécessaire avant d’appeler :meth:`~Cursor." "execute`." #: library/sqlite3.rst:361 msgid "" "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 ``False`` to disable the feature again." msgstr "" #: library/sqlite3.rst:370 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 " "its sole argument, and must return a value of a :ref:`type that SQLite " "natively understands `." msgstr "" "Enregistre un *adaptateur* appelable pour adapter le type Python *type* en " "un type SQLite. L’adaptateur est appelé avec un objet Python de type *type* " "comme unique argument, et doit retourner une valeur d’un :ref:`type que " "SQLite comprend nativement `." #: library/sqlite3.rst:378 msgid "" "Register the *converter* callable to convert SQLite objects of type " "*typename* into a Python object of a specific type. The converter is invoked " "for all SQLite values of type *typename*; it is passed a :class:`bytes` " "object and should return an object of the desired Python type. Consult the " "parameter *detect_types* of :func:`connect` for information regarding how " "type detection works." msgstr "" "Enregistre le *convertisseur* appelable pour convertir les objets SQLite de " "type *typename* en un objet Python d’un type spécifique. Le convertisseur " "est invoqué pour toutes les valeurs SQLite de type *typename* ; on lui passe " "un objet :class:`bytes` et il doit retourner un objet du type Python désiré. " "Consultez le paramètre *detect_types* de :func:`connect` pour des " "informations sur le fonctionnement de la détection des types." #: library/sqlite3.rst:386 msgid "" "Note: *typename* and the name of the type in your query are matched case-" "insensitively." msgstr "" "Remarque : *typename* et le nom du type dans votre requête sont comparés " "sans tenir compte de la casse." #: library/sqlite3.rst:393 #, fuzzy msgid "Module constants" msgstr "Fonctions et constantes du module" #: library/sqlite3.rst:397 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 " "column name, as the converter dictionary key. The type name must be wrapped " "in square brackets (``[]``)." msgstr "" #: library/sqlite3.rst:407 msgid "" "This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` " "(bitwise or) operator." msgstr "" #: library/sqlite3.rst:412 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 " "types are declared when the database table is created. :mod:`!sqlite3` will " "look up a converter function using the first word of the declared type as " "the converter dictionary key. For example:" msgstr "" #: library/sqlite3.rst:428 msgid "" "This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` " "(bitwise or) operator." msgstr "" #: library/sqlite3.rst:435 msgid "" "Flags that should be returned by the *authorizer_callback* callable passed " "to :meth:`Connection.set_authorizer`, to indicate whether:" msgstr "" #: library/sqlite3.rst:438 msgid "Access is allowed (:const:`!SQLITE_OK`)," msgstr "" #: library/sqlite3.rst:439 msgid "" "The SQL statement should be aborted with an error (:const:`!SQLITE_DENY`)" msgstr "" #: library/sqlite3.rst:440 msgid "" "The column should be treated as a ``NULL`` value (:const:`!SQLITE_IGNORE`)" msgstr "" #: library/sqlite3.rst:444 msgid "" "String constant stating the supported DB-API level. Required by the DB-API. " "Hard-coded to ``\"2.0\"``." msgstr "" #: library/sqlite3.rst:449 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:455 msgid "" "The :mod:`!sqlite3` module supports both ``qmark`` and ``numeric`` DB-API " "parameter styles, because that is what the underlying SQLite library " "supports. However, the DB-API does not allow multiple values for the " "``paramstyle`` attribute." msgstr "" #: library/sqlite3.rst:462 #, fuzzy msgid "" "Version number of the runtime SQLite library as a :class:`string `." msgstr "" "Le numéro de version de la bibliothèque d'exécution SQLite, sous forme de " "chaîne." #: library/sqlite3.rst:466 #, fuzzy msgid "" "Version number of the runtime SQLite library as a :class:`tuple` of :class:" "`integers `." msgstr "" "Le numéro de version de la bibliothèque d'exécution SQLite, sous forme " "d'entier." #: library/sqlite3.rst:471 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 " "*\"Threads may share the module, but not connections.\"* However, this may " "not always be true. You can check the underlying SQLite library's compile-" "time threaded mode using the following query::" msgstr "" #: library/sqlite3.rst:484 msgid "" "Note that the `SQLITE_THREADSAFE levels `_ do not match the DB-API 2.0 ``threadsafety`` levels." msgstr "" #: library/sqlite3.rst:490 #, fuzzy msgid "" "Version number of this module as a :class:`string `. This is not the " "version of the SQLite library." msgstr "" "Le numéro de version de ce module, sous forme de chaîne. Ce n'est pas la " "version de la bibliothèque SQLite." #: library/sqlite3.rst:495 #, fuzzy msgid "" "Version number of this module as a :class:`tuple` of :class:`integers " "`. This is not the version of the SQLite library." msgstr "" "Le numéro de version de ce module, sous forme d'un *n*-uplet d'entiers. Ce " "n'est pas la version de la bibliothèque SQLite." #: library/sqlite3.rst:502 #, fuzzy msgid "Connection objects" msgstr "Objets de connexions" #: library/sqlite3.rst:506 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:513 msgid ":ref:`sqlite3-connection-shortcuts`" msgstr "" #: library/sqlite3.rst:516 msgid "An SQLite database connection has the following attributes and methods:" msgstr "" #: library/sqlite3.rst:520 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:527 msgid "" "Commit any pending transaction to the database. If there is no open " "transaction, this method is a no-op." msgstr "" #: library/sqlite3.rst:532 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:537 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:544 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:550 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:556 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:562 msgid "Create or remove a user-defined SQL function." msgstr "" #: library/sqlite3.rst:564 msgid "The name of the SQL function." msgstr "" #: library/sqlite3.rst:567 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" #: library/sqlite3.rst:571 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 ``None`` to remove an existing SQL function." msgstr "" #: library/sqlite3.rst:578 msgid "" "If ``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:583 msgid "If *deterministic* is used with SQLite versions older than 3.8.3." msgstr "" #: library/sqlite3.rst:586 msgid "The *deterministic* parameter." msgstr "" #: library/sqlite3.rst:627 library/sqlite3.rst:952 library/sqlite3.rst:1087 #: library/sqlite3.rst:1247 msgid "Example:" msgstr "Exemple :" #: library/sqlite3.rst:605 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" #: library/sqlite3.rst:607 msgid "The name of the SQL aggregate function." msgstr "" #: library/sqlite3.rst:610 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" #: library/sqlite3.rst:614 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 ``None`` to remove an existing SQL aggregate function." msgstr "" #: library/sqlite3.rst:615 msgid "A class must implement the following methods:" msgstr "" #: library/sqlite3.rst:617 msgid "``step()``: Add a row to the aggregate." msgstr "" #: library/sqlite3.rst:618 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" #: library/sqlite3.rst:621 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" #: library/sqlite3.rst:624 msgid "Set to ``None`` to remove an existing SQL aggregate function." msgstr "" #: library/sqlite3.rst:659 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:663 msgid "``1`` if the first is ordered higher than the second" msgstr "" #: library/sqlite3.rst:664 msgid "``-1`` if the first is ordered lower than the second" msgstr "" #: library/sqlite3.rst:665 msgid "``0`` if they are ordered equal" msgstr "" #: library/sqlite3.rst:667 msgid "The following example shows a reverse sorting collation:" msgstr "" #: library/sqlite3.rst:695 msgid "Remove a collation function by setting *callable* to ``None``." msgstr "" #: library/sqlite3.rst:700 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:707 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 one " "of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE` to " "signal how access to the column should be handled by the underlying SQLite " "library." msgstr "" #: library/sqlite3.rst:713 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 ``None`` " "depending on the first argument. The 4th argument is the name of the " "database (\"main\", \"temp\", etc.) if applicable. The 5th argument is the " "name of the inner-most trigger or view that is responsible for the access " "attempt or ``None`` if this access attempt is directly from input SQL code." msgstr "" #: library/sqlite3.rst:720 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 " "the first one. All necessary constants are available in the :mod:`!sqlite3` " "module." msgstr "" #: library/sqlite3.rst:727 msgid "" "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." msgstr "" #: library/sqlite3.rst:732 msgid "" "If you want to clear any previously installed progress handler, call the " "method with ``None`` for *progress_handler*." msgstr "" #: library/sqlite3.rst:735 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:742 msgid "" "Register callable *trace_callback* to be invoked for each SQL statement that " "is actually executed by the SQLite backend." msgstr "" #: library/sqlite3.rst:745 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 " "that the backend does not only run statements passed to the :meth:`Cursor." "execute` methods. Other sources include the :ref:`transaction management " "` of the :mod:`!sqlite3` module and the " "execution of triggers defined in the current database." msgstr "" #: library/sqlite3.rst:753 msgid "Passing ``None`` as *trace_callback* will disable the trace callback." msgstr "" #: library/sqlite3.rst:756 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:766 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is ``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:775 msgid "" "The :mod:`!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:782 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" #: library/sqlite3.rst:786 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" #: library/sqlite3.rst:829 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:833 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" #: library/sqlite3.rst:837 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" #: library/sqlite3.rst:842 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:860 msgid "Create a backup of an SQLite database." msgstr "" #: library/sqlite3.rst:862 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" #: library/sqlite3.rst:865 msgid "The database connection to save the backup to." msgstr "" #: library/sqlite3.rst:868 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:874 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 " "of pages still to be copied, and the *total* number of pages. Defaults to " "``None``." msgstr "" #: library/sqlite3.rst:883 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 statement." msgstr "" #: library/sqlite3.rst:890 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" #: library/sqlite3.rst:894 msgid "Example 1, copy an existing database into another:" msgstr "" #: library/sqlite3.rst:913 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" #: library/sqlite3.rst:925 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" #: library/sqlite3.rst:928 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" #: library/sqlite3.rst:935 msgid "" "This attribute controls the :ref:`transaction handling ` performed by :mod:`!sqlite3`. If set to ``None``, " "transactions are never implicitly opened. If set to one of ``\"DEFERRED\"``, " "``\"IMMEDIATE\"``, or ``\"EXCLUSIVE\"``, corresponding to the underlying " "`SQLite transaction behaviour`_, implicit :ref:`transaction management " "` is performed." msgstr "" #: library/sqlite3.rst:943 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:948 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:965 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 " "optimized :class:`sqlite3.Row` type. :class:`Row` provides both index-based " "and case-insensitive name-based access to columns with almost no memory " "overhead. It will probably be better than your own custom dictionary-based " "approach or even a db_row based solution." msgstr "" #: library/sqlite3.rst:976 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 " "``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:1016 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:1022 msgid "Cursor objects" msgstr "" #: library/sqlite3.rst:1024 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:1031 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:1056 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" #: library/sqlite3.rst:1063 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:1068 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`. " "Use :meth:`executescript` if you want to execute multiple SQL statements " "with one call." msgstr "" #: library/sqlite3.rst:1073 msgid "" "If :attr:`~Connection.isolation_level` is not ``None``, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " "no open transaction, a transaction is implicitly opened before executing " "*sql*." msgstr "" #: library/sqlite3.rst:1081 msgid "" "Execute :ref:`parameterized ` SQL statement *sql* " "against all parameter sequences or mappings found in the sequence " "*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:1100 msgid "" "Execute the SQL statements in *sql_script*. If there is a pending " "transaction, 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:1106 msgid "*sql_script* must be a :class:`string `." msgstr "" #: library/sqlite3.rst:1124 msgid "" "If :attr:`~Connection.row_factory` is ``None``, return the next row query " "result set as a :class:`tuple`. Else, pass it to the row factory and return " "its result. Return ``None`` if no more data is available." msgstr "" #: library/sqlite3.rst:1132 msgid "" "Return 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:1135 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 " "be fetched. If fewer than *size* rows are available, as many rows as are " "available are returned." msgstr "" #: library/sqlite3.rst:1141 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " "attribute. If the *size* parameter is used, then it is best for it to retain " "the same value from one :meth:`fetchmany` call to the next." msgstr "" #: library/sqlite3.rst:1148 msgid "" "Return 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:1155 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" #: library/sqlite3.rst:1157 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:1166 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" #: library/sqlite3.rst:1170 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:1175 msgid "" "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:1189 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 ``None``." msgstr "" #: library/sqlite3.rst:1193 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" #: library/sqlite3.rst:1197 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 " "the :meth:`execute` method. For other statements, after :meth:`executemany` " "or :meth:`executescript`, or if the insertion failed, the value of " "``lastrowid`` is left unchanged. The initial value of ``lastrowid`` is " "``None``." msgstr "" #: library/sqlite3.rst:1205 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" #: library/sqlite3.rst:1207 msgid "Added support for the ``REPLACE`` statement." msgstr "" #: library/sqlite3.rst:1212 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " "for other statements, including :abbr:`CTE (Common Table Expression)` " "queries. It is only updated by the :meth:`execute` and :meth:`executemany` " "methods." msgstr "" #: library/sqlite3.rst:1227 msgid "Row objects" msgstr "" #: library/sqlite3.rst:1231 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " "equality testing, :func:`len`, and :term:`mapping` access by column name and " "index." msgstr "" #: library/sqlite3.rst:1236 msgid "Two row objects compare equal if have equal columns and equal members." msgstr "" #: library/sqlite3.rst:1240 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:1244 msgid "Added support of slicing." msgstr "" #: library/sqlite3.rst:1264 msgid "PrepareProtocol objects" msgstr "" #: library/sqlite3.rst:1268 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:1276 msgid "Exceptions" msgstr "Exceptions" #: library/sqlite3.rst:1278 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" #: library/sqlite3.rst:1282 msgid "" "This exception is raised by :mod:`!sqlite3` if an SQL query is not a :class:" "`string `, or if multiple statements are passed to :meth:`~Cursor." "execute` or :meth:`~Cursor.executemany`. ``Warning`` is a subclass of :exc:" "`Exception`." msgstr "" #: library/sqlite3.rst:1289 #, fuzzy 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 "" "La classe de base des autres exceptions de ce module. C'est une sous-classe " "de :exc:`Exception`." #: library/sqlite3.rst:1295 msgid "" "This exception is raised by :mod:`!sqlite3` for fetch across rollback, or " "if :mod:`!sqlite3` is unable to bind parameters. ``InterfaceError`` is a " "subclass of :exc:`Error`." msgstr "" #: library/sqlite3.rst:1301 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 " "implicitly through the specialised subclasses. ``DatabaseError`` is a " "subclass of :exc:`Error`." msgstr "" #: library/sqlite3.rst:1308 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:1314 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 " "database path is not found, or a transaction could not be processed. " "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" #: library/sqlite3.rst:1322 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:1327 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:1334 msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "trying to operate on a closed :class:`Connection`, or trying to execute non-" "DML statements with :meth:`~Cursor.executemany`. ``ProgrammingError`` is a " "subclass of :exc:`DatabaseError`." msgstr "" #: library/sqlite3.rst:1341 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " "in :meth:`~Connection.create_function`, if the underlying SQLite library " "does not support deterministic functions. ``NotSupportedError`` is a " "subclass of :exc:`DatabaseError`." msgstr "" #: library/sqlite3.rst:1351 msgid "SQLite and Python types" msgstr "" #: library/sqlite3.rst:1353 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" #: library/sqlite3.rst:1356 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" #: library/sqlite3.rst:1376 msgid "Python type" msgstr "Type Python" #: library/sqlite3.rst:1376 msgid "SQLite type" msgstr "SQLite type" #: library/sqlite3.rst:1378 msgid "``None``" msgstr "``None``" #: library/sqlite3.rst:1378 msgid "``NULL``" msgstr "``NULL``" #: library/sqlite3.rst:1380 msgid ":class:`int`" msgstr ":class:`int`" #: library/sqlite3.rst:1380 msgid "``INTEGER``" msgstr "``INTEGER``" #: library/sqlite3.rst:1382 msgid ":class:`float`" msgstr ":class:`float`" #: library/sqlite3.rst:1382 msgid "``REAL``" msgstr "``REAL``" #: library/sqlite3.rst:1367 msgid ":class:`str`" msgstr ":class:`str`" #: library/sqlite3.rst:1384 msgid "``TEXT``" msgstr "``TEXT``" #: library/sqlite3.rst:1387 msgid ":class:`bytes`" msgstr ":class:`bytes`" #: library/sqlite3.rst:1387 msgid "``BLOB``" msgstr "``BLOB``" #: library/sqlite3.rst:1373 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" #: library/sqlite3.rst:1384 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" #: library/sqlite3.rst:1390 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 :ref:`object " "adapters `, and you can let the :mod:`!sqlite3` module " "convert SQLite types to Python types via :ref:`converters `." msgstr "" #: library/sqlite3.rst:1400 msgid "Default adapters and converters" msgstr "" #: library/sqlite3.rst:1402 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:1405 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:1409 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:1413 msgid "The following example demonstrates this." msgstr "" #: library/sqlite3.rst:1417 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:1423 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " "offsets in timestamps, either leave converters disabled, or register an " "offset-aware converter with :func:`register_converter`." msgstr "" #: library/sqlite3.rst:1432 msgid "How-to guides" msgstr "" #: library/sqlite3.rst:1437 msgid "How to use placeholders to bind values in SQL queries" msgstr "" #: library/sqlite3.rst:1439 #, fuzzy 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 "" "Habituellement, vos opérations SQL utilisent les valeurs de variables " "Python. Vous ne devez pas assembler votre requête à l'aide des opérations " "sur les chaînes de caractères de Python, car cela n'est pas sûr. Cela rend " "votre programme vulnérable à une attaque par injection SQL (voir https://" "xkcd.com/327/ pour un exemple amusant de ce qui peut mal tourner)." #: library/sqlite3.rst:1448 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 " "values into the query by providing them as a :class:`tuple` of values to the " "second argument of the cursor's :meth:`~Cursor.execute` method. An SQL " "statement may use one of two kinds of placeholders: question marks (qmark " "style) or named placeholders (named style). For the qmark style, " "``parameters`` must be a :term:`sequence `. For the named style, " "it can be either a :term:`sequence ` or :class:`dict` instance. " "The length of the :term:`sequence ` must match the number of " "placeholders, or a :exc:`ProgrammingError` is raised. If a :class:`dict` is " "given, it must contain keys for all named parameters. Any extra items are " "ignored. Here's an example of both styles:" msgstr "" #: library/sqlite3.rst:1490 msgid "How to adapt custom Python types to SQLite values" msgstr "" #: library/sqlite3.rst:1492 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:1496 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 " "precedence above the former. For a library that exports a custom type, it " "may make sense to enable that type to adapt itself. As an application " "developer, it may make more sense to take direct control by registering " "custom adapter functions." msgstr "" #: library/sqlite3.rst:1508 msgid "How to write adaptable objects" msgstr "" #: library/sqlite3.rst:1510 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " "coordinate pair will be stored as a text string in the database, using a " "semicolon to separate the coordinates. This can be implemented by adding a " "``__conform__(self, protocol)`` method which returns the adapted value. The " "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" #: library/sqlite3.rst:1541 msgid "How to register adapter callables" msgstr "" #: library/sqlite3.rst:1543 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:1573 msgid "How to convert SQLite values to custom Python types" msgstr "" #: library/sqlite3.rst:1575 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:1580 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:1583 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:1588 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" #: library/sqlite3.rst:1597 msgid "" "We now need to tell :mod:`!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:1601 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" #: library/sqlite3.rst:1602 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" #: library/sqlite3.rst:1603 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" #: library/sqlite3.rst:1607 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" #: library/sqlite3.rst:1658 msgid "Adapter and converter recipes" msgstr "" #: library/sqlite3.rst:1660 msgid "This section shows recipes for common adapters and converters." msgstr "" #: library/sqlite3.rst:1703 msgid "How to use connection shortcut methods" msgstr "" #: library/sqlite3.rst:1705 msgid "" "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:1746 msgid "How to use the connection context manager" msgstr "" #: library/sqlite3.rst:1748 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " "of the context manager. If the body of the :keyword:`with` statement " "finishes without exceptions, the transaction is committed. If this commit " "fails, or if the body of the ``with`` statement raises an uncaught " "exception, the transaction is rolled back." msgstr "" #: library/sqlite3.rst:1757 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:1762 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" #: library/sqlite3.rst:1795 msgid "How to work with SQLite URIs" msgstr "" #: library/sqlite3.rst:1797 msgid "Some useful URI tricks include:" msgstr "" #: library/sqlite3.rst:1799 msgid "Open a database in read-only mode:" msgstr "" #: library/sqlite3.rst:1808 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:1818 msgid "Create a shared named in-memory database:" msgstr "" #: library/sqlite3.rst:1832 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" #: library/sqlite3.rst:1841 #, fuzzy msgid "Explanation" msgstr "Exceptions" #: library/sqlite3.rst:1846 msgid "Transaction control" msgstr "" #: library/sqlite3.rst:1848 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" #: library/sqlite3.rst:1851 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." "execute` and :meth:`~Cursor.executemany` executes ``INSERT``, ``UPDATE``, " "``DELETE``, or ``REPLACE`` statements; for other statements, no implicit " "transaction handling is performed. Use the :meth:`~Connection.commit` and :" "meth:`~Connection.rollback` methods to respectively commit and roll back " "pending transactions. You can choose the underlying `SQLite transaction " "behaviour`_ — that is, whether and what type of ``BEGIN`` statements :mod:`!" "sqlite3` implicitly executes – via the :attr:`~Connection.isolation_level` " "attribute." msgstr "" #: library/sqlite3.rst:1864 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " "`autocommit mode`_, but also allows the user to perform their own " "transaction handling using explicit SQL statements. The underlying SQLite " "library autocommit mode can be queried using the :attr:`~Connection." "in_transaction` attribute." msgstr "" #: library/sqlite3.rst:1872 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:1876 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" #, fuzzy #~ 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 "" #~ "Pour utiliser le module, vous devez d’abord créer une :class:`Connection` " #~ "qui représente la base de données. Dans cet exemple, les données sont " #~ "stockées dans le fichier :file:`example.db` ::" #, fuzzy #~ msgid "" #~ "The special path name ``:memory:`` can be provided to create a temporary " #~ "database in RAM." #~ msgstr "" #~ "Vous pouvez également fournir le nom spécial ``:memory:`` pour créer une " #~ "base de données dans la mémoire vive." #, fuzzy #~ 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 "" #~ "Une fois que vous avez une instance de :class:`Connection`, vous pouvez " #~ "créer un objet :class:`Cursor` et appeler sa méthode :meth:`~Cursor." #~ "execute` pour exécuter les commandes SQL ::" #, fuzzy #~ 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." #~ msgstr "" #~ "Pour récupérer des données après avoir exécuté une instruction *SELECT*, " #~ "vous pouvez considérer le curseur comme un :term:`itérateur `, " #~ "appeler la méthode du curseur :meth:`~Cursor.fetchone` pour récupérer une " #~ "seule ligne correspondante ou appeler :meth:`~Cursor.fetchall` pour " #~ "obtenir une liste des lignes correspondantes." #~ msgid "This example uses the iterator form::" #~ msgstr "Cet exemple utilise la forme itérateur ::" #~ msgid "" #~ "This constant is meant to be used with the *detect_types* parameter of " #~ "the :func:`connect` function." #~ msgstr "" #~ "Cette constante est destinée à être utilisée avec le paramètre " #~ "*detect_types* de la fonction :func:`connect`." #~ msgid "" #~ "Setting it makes the :mod:`sqlite3` module parse the declared type for " #~ "each column it returns. It will parse out the first word of the declared " #~ "type, i. e. for \"integer primary key\", it will parse out \"integer\", " #~ "or for \"number(10)\" it will parse out \"number\". Then for that column, " #~ "it will look into the converters dictionary and use the converter " #~ "function registered for that type there." #~ msgstr "" #~ "Si elle est définie, le module :mod:`sqlite3` analyse le type de donnée " #~ "déclarée pour chaque colonne. Il déduit le type du premier mot de la " #~ "déclaration, par exemple de *integer primary key* il gardera *integer*, " #~ "ou de *number(10)* il gardera *number*. Ensuite, pour cette colonne, il " #~ "utilisera une fonction de conversion du dictionnaire des convertisseurs." #, fuzzy #~ msgid "" #~ "Setting this makes the SQLite interface parse the column name for each " #~ "column it returns. It will look for a string formed [mytype] in there, " #~ "and then decide that 'mytype' is the type of the column. It will try to " #~ "find an entry of 'mytype' in the converters dictionary and then use the " #~ "converter function found there to return the value. The column name found " #~ "in :attr:`Cursor.description` does not include the type, i. e. if you use " #~ "something like ``'as \"Expiration date [datetime]\"'`` in your SQL, then " #~ "we will parse out everything until the first ``'['`` for the column name " #~ "and strip the preceding space: the column name would simply be " #~ "\"Expiration date\"." #~ msgstr "" #~ "Permet à l’interface SQLite d'analyser le nom pour chaque colonne. Il y " #~ "cherchera une chaîne comme ``[mytype]`` indiquant que la colonne est de " #~ "type ``mytype``. Il essaiera de trouver une entrée *mytype* dans le " #~ "dictionnaire, puis utilisera la fonction de conversion qui s'y trouve " #~ "pour renvoyer la valeur. Le nom de colonne donnée à :attr:`Cursor." #~ "description` n'est alors que le premier mot du nom de la colonne, par " #~ "exemple si vous utilisez ``'as \\\"x [datetime]\\\"'`` dans votre code " #~ "SQL, le nom de la colonne sera simplement *x*." #~ msgid "" #~ "Opens a connection to the SQLite database file *database*. By default " #~ "returns a :class:`Connection` object, unless a custom *factory* is given." #~ msgstr "" #~ "Ouvre une connexion à la base de données SQLite *database*. Par défaut, " #~ "cette commande renvoie un objet :class:`Connection`, sauf si *factory* " #~ "est donné." #~ msgid "Example::" #~ msgstr "Exemple ::" #~ msgid "Introduction" #~ msgstr "Introduction" #~ msgid ":const:`None`" #~ msgstr ":const:`None`" #~ msgid "Footnotes" #~ msgstr "Notes" #~ msgid "" #~ "The data you've saved is persistent and is available in subsequent " #~ "sessions::" #~ msgstr "" #~ "Les données que vous avez sauvegardées sont persistantes et disponibles " #~ "dans les sessions suivantes ::" #~ msgid "" #~ "Instead, use the DB-API's parameter substitution. Put ``?`` as a " #~ "placeholder wherever you want to use a value, and then provide a tuple of " #~ "values as the second argument to the cursor's :meth:`~Cursor.execute` " #~ "method. (Other database modules may use a different placeholder, such as " #~ "``%s`` or ``:1``.) For example::" #~ msgstr "" #~ "À la place, utilisez la capacité DB-API de substitution des paramètres. " #~ "Placez un ``?`` comme indicateur partout où vous voulez utiliser une " #~ "valeur, puis fournissez un *n*-uplet de valeurs comme second argument de " #~ "la méthode :meth:`~Cursor.execute`. D'autres modules de base de données " #~ "peuvent utiliser un espace réservé différent, tel que ``%s`` ou ``:1``. " #~ "Par exemple ::" #~ msgid "https://github.com/ghaering/pysqlite" #~ msgstr "https://github.com/ghaering/pysqlite" #~ msgid "" #~ "The pysqlite web page -- sqlite3 is developed externally under the name " #~ "\"pysqlite\"." #~ msgstr "" #~ "La page web de *pysqlite* — *sqlite3* est développée sur un site tiers " #~ "sous le nom *pysqlite*." #~ msgid "Multithreading" #~ msgstr "Fils d'exécution"