HTSQL
   HOME

TheInfoList



OR:

Hyper Text Structured Query Language (HTSQL) is a schema-driven URI-to-SQL query language that takes a request over
HTTP The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide We ...
, converts it to a SQL query, executes the query against a database, and returns the results in a format best suited for the user agent (CSV, HTML, etc.) The HTSQL language is implemented on "HTSQL servers," which use HTSQL to convert web requests into equivalent SQL, executes requests on a server-side database, and returns results in
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable ...
,
HTML The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaSc ...
, CSV, JSON, or
YAML YAML ( and ) (''see '') is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML targets many of the same communications applications as Ext ...
formats. The current implementation as of April 2010 uses
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
and works with PostgreSQL,
MySQL MySQL () is an open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A relational database ...
,
SQLite SQLite (, ) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the m ...
, Oracle, and
Microsoft SQL Server Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which ...
databases. HTSQL was prototyped and developed by Clark Evans (who proposed
YAML YAML ( and ) (''see '') is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML targets many of the same communications applications as Ext ...
in 2001) and implemented by Kirill Simonov, both of Prometheus Research.


Scope

HTSQL's intended audience is business users who are not SQL programmers. It seeks to simplify non-intuitive relational queries, such as aggregates and projections. The goal is not completeness in replicating SQL, but simplicity and intuitiveness. HTSQL allows users who are familiar with the data, but not SQL syntax, to directly access the database without going through an application.


Syntax

HTSQL uses a URI-based query syntax. Queries typically begin with a single table, optionally prefixed by a schema and followed by a filter expression to limit the number of rows that are returned.


Examples

Joins can be made across tables by referencing the column name preceded by the table name. This example requests the title of a degree program from the program table and the school name from the school table: /program The result of this query from the HTSQL command-line system is: program ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ school.name , title --------------------------+----------------------------------- School of Art and Design , Post Baccalaureate in Art History School of Art and Design , Bachelor of Arts in Art History School of Art and Design , Bachelor of Arts in Studio Art School of Business , Graduate Certificate in Accounting ... Aggregate expressions can be used when there are many-to-one relationships in the database. /school The result shows the count (number) of programs and departments in each school: school ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name , count(program) , count(department) -------------------------+----------------+------------------ School of Art and Design , 3 , 2 School of Business , 5 , 3 College of Education , 7 , 2 School of Engineering , 8 , 4


Applications

HTSQL can be used for ''ad hoc'' database queries. Its developers consider it to be more concise and intuitive and therefore less error-prone than SQL for non-technical users. HTSQL can also be used by "accidental programmers", such as data analysts and UI developers. Besides more readable, HTTP-based queries, HTSQL's developers claim it helps avoid common SQL mistakes like accidental joins.


Versions and licensing

HTSQL follows a dual license model. The software may be used free of charge with open source relational databases, including
MySQL MySQL () is an open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A relational database ...
and PostgreSQL. Source code is available on the
bitbucket Bitbucket is a Git-based source code repository hosting service owned by Atlassian. Bitbucket offers both commercial plans and free accounts with an unlimited number of private repositories. Services Bitbucket Cloud Bitbucket Cloud (previ ...
site. A commercial version of HTSQL, compatible with commercial databases like Oracle and
Microsoft SQL Server Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which ...
, is also available.{{cite web , url=http://htsql.org/ , title=Home , website=htsql.org


Similar initiatives


postgREST

PostGraphile


References


External links


HTSQL community website
Query languages