Metadata-Version: 2.1
Name: minipg
Version: 0.9.1
Summary: Yet another PostgreSQL database driver
Home-page: https://github.com/nakagami/minipg/
Author: Hajime Nakagami
Author-email: Hajime Nakagami <nakagami@gmail.com>
License: The MIT License (MIT)
        
        Copyright (c) 2014 Hajime Nakagami
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/nakagami/minipg/
Keywords: PostgreSQL
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database
Description-Content-Type: text/x-rst
License-File: LICENSE

=============
minipg
=============

Yet another Python PostgreSQL database driver.

Requirements
-----------------

- PostgreSQL 9.6+
- Python 3.9+

Installation
-----------------

use pip
::

    $ pip install minipg

or

copy a module file.
::

    $ cd $(SOMEWHERE_PYTHON_PATH)
    $ wget https://github.com/nakagami/minipg/raw/master/minipg.py

Example
-----------------

::

   import minipg
   conn = minipg.connect(host='localhost',
                       user='postgres',
                       password='secret',
                       database='database_name')
   cur = conn.cursor()
   cur.execute('select foo, bar from baz')
   for r in cur.fetchall():
      print(r[0], r[1])
   conn.close()

SSL Connection
++++++++++++++++++

You can make an SSL connection with an instance of SSLContext.
Below is an example of an ssl connection without certificate validation.

::

   import ssl
   import minipg
   ssl_context = ssl.create_default_context()
   ssl_context.check_hostname = False
   ssl_context.verify_mode = ssl.CERT_NONE
   conn = minipg.connect(host='localhost',
                       user='postgres',
                       password='secret',
                       database='database_name',
                       ssl_context=ssl_context)


Restrictions and Unsupported Features
--------------------------------------

- Supported Authentication METHOD are only 'trust', 'md5' and 'scram-sha-256'.
- Not full support for array data types.

For MicroPython
----------------

See https://github.com/nakagami/micropg .
It's a minipg subset driver.
