All Projects → parihaaraka → sqt

parihaaraka / sqt

Licence: MIT license
sql query tool

Programming Languages

C++
36643 projects - #6 most used programming language
PLpgSQL
1095 projects
TSQL
950 projects

Projects that are alternatives of or similar to sqt

Turbodbc
Turbodbc is a Python module to access relational databases via the Open Database Connectivity (ODBC) interface. The module complies with the Python Database API Specification 2.0.
Stars: ✭ 449 (+1303.13%)
Mutual labels:  odbc
Xeus Sql
xeus-sql is a Jupyter kernel for general SQL implementations.
Stars: ✭ 85 (+165.63%)
Mutual labels:  odbc
Django Pyodbc
An ODBC-powered MS SQL Server DB backend for Django 1.4+
Stars: ✭ 194 (+506.25%)
Mutual labels:  odbc
Thingsboard Gateway
Open-source IoT Gateway - integrates devices connected to legacy and third-party systems with ThingsBoard IoT Platform using Modbus, CAN bus, BACnet, BLE, OPC-UA, MQTT, ODBC and REST protocols
Stars: ✭ 796 (+2387.5%)
Mutual labels:  odbc
Mssqlex
Microsoft SQL Server Adapter for Elixir
Stars: ✭ 38 (+18.75%)
Mutual labels:  odbc
Clickhouse Odbc
ODBC driver for ClickHouse
Stars: ✭ 161 (+403.13%)
Mutual labels:  odbc
Kyuubi
Kyuubi is a unified multi-tenant JDBC interface for large-scale data processing and analytics, built on top of Apache Spark
Stars: ✭ 363 (+1034.38%)
Mutual labels:  odbc
tagreader-python
A Python package for reading trend data from the OSIsoft PI and Aspen InfoPlus.21 historians
Stars: ✭ 27 (-15.62%)
Mutual labels:  odbc
Zabbixdba
Zabbix Database Monitoring Service (Oracle, Pg, MySQL, MS SQL, DB2, etc.)
Stars: ✭ 68 (+112.5%)
Mutual labels:  odbc
Cidlib
The CIDLib general purpose C++ development environment
Stars: ✭ 179 (+459.38%)
Mutual labels:  odbc
Eosio sql plugin
EOSIO sql database plugin
Stars: ✭ 21 (-34.37%)
Mutual labels:  odbc
Odbc adapter
An ActiveRecord ODBC adapter
Stars: ✭ 36 (+12.5%)
Mutual labels:  odbc
Pyodbc
Python ODBC bridge
Stars: ✭ 2,270 (+6993.75%)
Mutual labels:  odbc
Mdbtools
MDB Tools - Read Access databases on *nix
Stars: ✭ 616 (+1825%)
Mutual labels:  odbc
Aioodbc
aioodbc - is a library for accessing a ODBC databases from the asyncio
Stars: ✭ 206 (+543.75%)
Mutual labels:  odbc
Sqlpad
Web-based SQL editor run in your own private cloud. Supports MySQL, Postgres, SQL Server, Vertica, Crate, ClickHouse, Trino, Presto, SAP HANA, Cassandra, Snowflake, BigQuery, SQLite, and more with ODBC
Stars: ✭ 4,113 (+12753.13%)
Mutual labels:  odbc
Qtl
A friendly and lightweight C++ database library for MySQL, PostgreSQL, SQLite and ODBC.
Stars: ✭ 92 (+187.5%)
Mutual labels:  odbc
sqlalchemy exasol
SQLAlchemy dialect for EXASOL
Stars: ✭ 34 (+6.25%)
Mutual labels:  odbc
Freesql
🦄 .NET orm, Mysql orm, Postgresql orm, SqlServer orm, Oracle orm, Sqlite orm, Firebird orm, 达梦 orm, 人大金仓 orm, 神通 orm, 翰高 orm, 南大通用 orm, Click house orm, MsAccess orm.
Stars: ✭ 3,077 (+9515.63%)
Mutual labels:  odbc
Nanodbc
A small C++ wrapper for the native C ODBC API | Requires C++14 since v2.12
Stars: ✭ 175 (+446.88%)
Mutual labels:  odbc

sqt

sqt (sql query tool) is a cross-platform program to provide typical sql data source exploring and programming interface.

Overview

The subject was aimed to provide fast and convenient MS SQL query tool under linux. The only existing ODBC interface lead to support of any other ODBC data source. As a result of pgAdmin3 deprecation sqt was modified to have a native PostgreSQL support via libpq. Due to my current needs PostgreSQL support is in priority. The main target audience are db programmers.

Binaries

Standalone (outdated) sqt for windows x64 (~12Mb)

Feature highlights

  • Customizable objects tree and textual/tabular content view (see scripts/README.md) let you build you own tree with application-specific nodes;
  • adjustable sql highlighting (see any existing hl.conf for more details);
  • alternative sorting (e.g., sort table columns in original/alphabetical order);
  • multiple selection to generate appropriate SQL code (e.g., select/insert/update commands with selected columns only);
  • convenient (Qt Creator-like) search/replace panel;
  • multiple resultsets support;
  • bookmarks (mark: Ctrl+M, previous: Ctrl+,, next: Ctrl+., last: Ctrl+L);
  • uppercase (Ctrl+U), lowercase (Ctrl+Shift+U, Ctrl+Win+U)
  • code completion support (Ctrl+Space);
  • json viewer with highlighting and extracting json from it's nested text value (Ctrl+J);
  • totalling selected cells (F6);
  • customizable time charts to display current or recorded statistics;
  • resultsets structure textual output;
  • pg: client-side COPY to file or log widget, COPY from file;
  • pg: receiving notifications (NOTIFY) and messages (RAISE).

screenshot screenshot

COPY to/from local file via meta-comments (pg only)

Use COPY FROM STDIN and COPY TO STDOUT forms of the command with some magic in comments:

/*sqt { "copy_dst": ["/tmp/pg_stat_activity.csv", "/tmp/pg_stat_database.csv"] } */
copy (select * from pg_stat_activity) to stdout with (format csv, header);
copy (select * from pg_stat_database) to stdout with (format csv, header);

Specify an empty string instead of file name for output to the log widget:

/*sqt { "copy_dst": "" } */
copy (select * from pg_stat_activity) to stdout with (format csv, header);
  • As you can see, the non-array form of copy_dst may be used in case of single source query.
create table tmp1 as select * from pg_stat_activity limit 0;
create table tmp2 as select * from pg_stat_database limit 0;

/*sqt { "copy_src": ["/tmp/pg_stat_activity.csv", "/tmp/pg_stat_database.csv"] } */
copy tmp1 from stdin with (format csv, header);
copy tmp2 from stdin with (format csv, header);

Charting via meta-comments

Timelines example:

/*sqt
{
    "interval": 1000,
    "charts": [
        {
            "name": "sessions",
            "y": { "active": "#0b0", "total": "#c00", "idle": "#00c" }
        },
        {
            "name": "transactions, backends",
            "agg_y": { "xact_commit": "#0b0", "xact_rollback": "#c00" },
            "y" : { "numbackends": "#00c" }
        },
        {
            "name": "tuples out",
            "agg_y": { "fetched": "#cb0", "returned": "#0c0" }
        }
    ]
}
*/
select count(*) total,
    count(*) filter (where state = 'active') active,
    count(*) filter (where state = 'idle') idle
from pg_stat_activity;

select
    sum(xact_commit) xact_commit,
    sum(numbackends) numbackends,
    sum(xact_rollback) xact_rollback,
    sum(tup_fetched) fetched,
    sum(tup_returned) returned
from pg_stat_database;

interval - interval to reexecute queries (milliseconds);

charts - list of charts with names and graphical paths description;

agg_y - cumulative values source.

Plot some source of (x,y) values

/*sqt
{
    "charts": [
        {
            "name": "tps_log",
            "x": "ts",
            "y": {
                "f1": "#0c0"
            }
        }
    ]
}
*/
select s.ts, 5 + 4*random() f1
from generate_series(now(), now() + '20min'::interval, '1sec'::interval) as s(ts)

Build instruction

You may build the project by means of QtCreator or execute this sequence of commands from the project's root directory:

mkdir build && cd build && qmake ../src/sqt.pro && make

Qt toolchain must be installed and be available via PATH.

Todo

  • Improve code completion, prepare scripts to fetch metadata from non-postgresql data sources;
  • executing of JavaScript along with SQL to run automation tasks;
  • new script types to extend objects tree interaction (modifying, administration tasks);
  • enhance scripts to make sqt as useful as possible (+provide scripts for different dbms, versions, generic odbc data source);
  • batch mode;
  • reports.

Acknowledgment

Some icons by Yusuke Kamiyamane. All rights reserved.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].