Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/sqlalchemy/dialects/postgresql/__pycache__/pg8000.cpython-39.pyc
Ðазад
a _�h�% � @ sn d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lm Z dd lm Z ddlmZ ddlm Z d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ zddlmZ W n ey� dZY n0 G dd� dej�ZG dd� de�ZG dd� de �ZG dd� de�ZG dd� de �ZG dd� de�ZG dd � d e �Z G d!d"� d"e�Z!e!Z"dS )#a� .. dialect:: postgresql+pg8000 :name: pg8000 :dbapi: pg8000 :connectstring: postgresql+pg8000://user:password@host:port/dbname[?key=value&key=value...] :url: https://pythonhosted.org/pg8000/ .. note:: The pg8000 dialect is **not tested as part of SQLAlchemy's continuous integration** and may have unresolved issues. The recommended PostgreSQL dialect is psycopg2. .. _pg8000_unicode: Unicode ------- pg8000 will encode / decode string values between it and the server using the PostgreSQL ``client_encoding`` parameter; by default this is the value in the ``postgresql.conf`` file, which often defaults to ``SQL_ASCII``. Typically, this can be changed to ``utf-8``, as a more useful default:: #client_encoding = sql_ascii # actually, defaults to database # encoding client_encoding = utf8 The ``client_encoding`` can be overridden for a session by executing the SQL: SET CLIENT_ENCODING TO 'utf8'; SQLAlchemy will execute this SQL on all new connections based on the value passed to :func:`_sa.create_engine` using the ``client_encoding`` parameter:: engine = create_engine( "postgresql+pg8000://user:pass@host/dbname", client_encoding='utf8') .. _pg8000_isolation_level: pg8000 Transaction Isolation Level ------------------------------------- The pg8000 dialect offers the same isolation level settings as that of the :ref:`psycopg2 <psycopg2_isolation_level>` dialect: * ``READ COMMITTED`` * ``READ UNCOMMITTED`` * ``REPEATABLE READ`` * ``SERIALIZABLE`` * ``AUTOCOMMIT`` .. versionadded:: 0.9.5 support for AUTOCOMMIT isolation level when using pg8000. .. seealso:: :ref:`postgresql_isolation_level` :ref:`psycopg2_isolation_level` � N� )�_DECIMAL_TYPES)�_FLOAT_TYPES)� _INT_TYPES)� PGCompiler)� PGDialect)�PGExecutionContext)�PGIdentifierPreparer)�UUID)�JSON� )�exc)� processors)�types)�util)�quoted_namec @ s e Zd Zdd� ZdS )� _PGNumericc C sv | j rB|tv rt�tj| j�S |tv s.|tv r2d S t � d| ��n0|tv rNd S |tv s^|tv rdtjS t � d| ��d S )NzUnknown PG numeric type: %d)Z asdecimalr r Zto_decimal_processor_factory�decimal�DecimalZ_effective_decimal_return_scaler r r ZInvalidRequestErrorZto_float��self�dialect�coltype� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/sqlalchemy/dialects/postgresql/pg8000.py�result_processor` s"