Skip to content

romainledru/Postgres-EasyTalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

POSTGRES EASY TALK

Introduction

Postgres easy talk is an user-friendly query tool that provides an easier communication system in automated dabatabase interaction.

I propose a new query system for postgres which allow to use it easily on automated processes.

What's in the box!

  • Multiple database query
    • work simultaneously with multiple database and make them interact together!
  • Static 'read-only-onces' code
    • Your next collegue can look at your 7 months ago database creation code and understand quickly how it is built.
  • User-entry checkpoint control
    • Find out bugs from the source and relax. Entries are ckeched and futures bugs are prevented. The tool will not allow an entry as easy as a direct basic database query.
  • Increase security
    • Queries are controled to be prevented from SQL Input Injection

Postgresql query tools

  • CREATE
  • INSERT
  • SELECT
  • DELETE
  • DROP
  • ... in progress!

INSTALL AND IMPORT

The version will be soon available on Pypi

python3 -m pip install easytalk

Then, to use the package on your project:

import easytalk                 -> easytalk.Table('table')
or
from easytalk import *          -> Table('table')

INPUT / OUTPUT EXAMPLE

CREATE example

  • Input
table = Table('articles_table')

table.add_serialField()             # automatic 'id' increment (primary key)
table.add_datetimeField()           # automatic 'created_at'
table.add_varcharField('name')      
table.add_intField('price')         # each add_ have optional attr, such as NOT NULL (by default on True)
table.add_booleanField('to_buy')

table.write_TABLE()
  • Output

table_CREATE

INSERT example

  • Input
i = Insert(table)

entry = {
    'name': 'item3',
    'price': 345,
    'to_buy': False,
    #'datetime': datetime.datetime.now(),       -> Automatically added but can be overwritten
    #'id': nextVar(),                           -> Automatically added but can be overwritten
}
i.write_ENTRY(entry)
  • Output

table_INSERT

READ example

  • Input
r = Read(table)

answer = r.find_filter()
for row in answer:
    print(row)
  • Output

table_SELECT

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

To contribute to GermanOK, follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch_name>.
  3. Make your changes and commit them: git commit -m '<commit_message>'
  4. Push to the original branch: git push origin <project_name>/<location>
  5. Create the pull request.

Alternatively see the GitHub documentation on creating a pull request.

Contact

If you want to contact me, you can reach me at romain.ledru2@gmail.com

About

Python user-friendly queries for Postgres Database

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages