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.
- 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
- CREATE
- INSERT
- SELECT
- DELETE
- DROP
- ... in progress!
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
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
- 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
- Input
r = Read(table)
answer = r.find_filter()
for row in answer:
print(row)
- Output
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:
- Fork this repository.
- Create a branch:
git checkout -b <branch_name>
. - Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch:
git push origin <project_name>/<location>
- Create the pull request.
Alternatively see the GitHub documentation on creating a pull request.
If you want to contact me, you can reach me at romain.ledru2@gmail.com