Git Product home page Git Product logo

patriciasql's Introduction

PatriciaSQL

PatriciaSQL is simple PostgreSQL client written in PyQt (Qt GUI and Python).

This tool has been developed under Kubuntu. PatriciaSQL has not been tested on other Linux distros, nor on other OSes (OSX, Windows, *BSD). PatriciaSQL should work without any problems as long as dependencies are met (see: requirements section for more info). Please mind that on some OSes additional dependencies may be required.

Screenshots:

Main Window: PatriciaSQL Main Window

Auto-complete for SQL queries: PatriciaSQL-auto-completer

Query explain: PatriciaSQL_Main_Window_Explain

Executing only selected text: Query_Selected

Explain selected query: Explain_Selected

Connection options: PatriciaSQL - connection settings

Note: for demoing purposes data from PostgreSQL Exercises is used

Note: in case of connectivity problems - try removing/editing configuration file that stores information of the last database connection used (_patricia_connection.json). If this does not work - please report a bug. Thanks!

Usage:

After setting up the connection, PatriciaSQL should be ready to use. To configure the connection use the "Connection Setup" dialog available from the main menu (File -> Settings).

Shortcuts:

I like using shortcuts and most actions are available via key combinations:

ctrl + Enter - execute query - this takes the whole text from the editor window and treats it as a query

ctrl + shift + Enter - executes only the selected text

ctrl + e - performs explain on the query - query is the whole text from the editor control

ctrl + shift + e - performs explain on the selected text

ctrl + k - show auto-complete pop-up with all SQL keywords

Requirements:

  • Python (either 2.7x or 3.x)
  • PostgreSQL (tested with PosgreSQL 9, 10 & 11)
  • libqt5sql5-psql (PostgreSQL driver for KDE apps. It is required by any app that interacts with PostgreSQL)

Additional dependencies:

Python 2.x Python 3.x
python-pyqt5 python3-pyqt5
python-pyqt5.qtsql python3-pyqt5.qtsql

Development:

Apart from what is listed above, some additional libraries & tools may be needed, in case you want to to work on this app.

  1. Qt Designer (for forms design) sudo apt install qt-creator
  2. PyQt5 dev tools: sudo apt install pyqt5-dev-tools

In case something does not work, try installing:

  • python-pyside2.qtsql

or

  • python3-pyside2.qtsql

Todo:

This section should rather be entitled "what would I like to have", as I am not sure I will have enough time to work on all of these:

  • syntax highlighting for PgSQL statements
  • load & save queries (from/to .sql files)
  • save results to .csv
  • snippets (table/database creation, modification, removal...)
  • query execution improvements:
    • execute only highlighted text (execute one of many queries)
    • 'execute and explain' + 'execute selected and explain'
    • display db errors on query execution
  • general UI improvements:
    • additional info on query execution (execution time)
    • solarized-light theme for the editor
  • auto-complete:
    • keywords autocomplete
    • words used autocomplete
    • database names, table names, column names... (*)
  • .deb package
  • store connection information in human readable format

(*) I am afraid that this is going to be pretty tricky one

Icons used:

App icon is taken from ICONFINDER. The icon used is slightly modified icon which is part of File Extensions Vol 1 iconset. Author of the app icon is: Ravindra Kalkani Please note, that this icon is being used temporarily - until I get an icon made especially for PatriciaSQL.

Status bar icons are free Font Awesome icons. Font awesome license: https://fontawesome.com/license

No changes were made to Font Awesome icons.

To my best knowledge both Font Awesome, and the icon I found on IconFinder are free to use for OpenSource projects. If I am mistaken - let me know, please.

Disclaimer:

This is more of an experiment. I have no plans at the moment to make it a "full blown" tool. It should stay simple (and hopefully - fast). There are a couple of things I would like to improve (listed in TODO section), but working on it is not very high on my priority list (read: I may stop working on it at any moment).

patriciasql's People

Contributors

maciektalaska avatar stefan-z-camilleri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

patriciasql's Issues

Cancel on File->Open causes crash

After File->Open, hit Cancel.

Traceback (most recent call last):
  File "psql.py", line 161, in open
    data = sql_file.SQLFile.load()
  File "PatriciaSQL/sql_file.py", line 22, in load
    with open(filename, "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: ''
Aborted (core dumped)

Logo / app icon wanted

I think it would be great if this project had a proper logo and an app icon. Unfortunately I have no skills in graphics, so I am not able to create logo or icon myself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.