HTSQL 2.3.1 is released

Published by xi on 2012-06-28

We are proud to announce a new HTSQL release in the 2.3 development series. This release adds a few major features including nested records, nested subqueries, locators, new and revamped output formats, HTSQL-Django gateway, and more.

In this release, we removed support for Python 2.5. Currently HTSQL requires Python 2.6 or 2.7.

Change Log

Specific changes since the 2.3.0 release:

  • Added record and list data types, support for nested records and segments, hierarchical output. For more information, see Introducing Records and Introducing Nested Segments.
  • Added support for locators, single record access using an array-like syntax. For more information see Introducing Locators.
  • top(): retrieves the first item of a plural argument.
  • Added and updated output formats: raw, json, xml; updated style for HTML output. See Introducing Object Formats and Improved Visual Display for more detail.
  • HTSQL-DJANGO: a Django gateway to HTSQL. See Introducing Django Gateway for notes on installation and configuration.
  • Keep all cache and transient files in ~/.htsql/. htsql-ctl shell and htsql-ctl serve now read default configuration from ~/.htsqlrc.
  • Removed support for Python 2.5. Currently supported are 2.6 and 2.7.
  • Many other fixes and documentation updates.

Example Queries

The following queries demonstrate new HTSQL features.

Nested Records & Segments

Show department records with the first field being a nested record for the associated school:

school code name
code name
bus School of Business acc Accounting
la School of Arts and Humanities arthis Art History
ns School of Natural Sciences astro Astronomy

For each school, show lists of associated programs and departments:

name program department
title name
School of Art & Design Post Baccalaureate in Art History Studio Art
Bachelor of Arts in Art History
Bachelor of Arts in Studio Art
School of Business Master of Arts in Economics Accounting
Graduate Certificate in Accounting Economics
Certificate in Business Administration Management & Marketing
B.S. in Accounting
Bachelor of Business Administration
Bachelor of Arts in Economics

Locators

Show the department identified by comp:

code name school_code
comp Computer Science eng

Show course identities:

id()
acc.100
acc.200
acc.234

Show class identities for all classes of the course comp.515:

id()
(comp.515).(2007.spring).001
(comp.515).(2008.spring).001
(comp.515).(2010.spring).001

top()

The first school in the list:

code name campus
art School of Art & Design old

For each school, show the top two programs by the number of students:

name program
school_code code title degree part_of_code
School of Art & Design art ustudio Bachelor of Arts in Studio Art ba
art uhist Bachelor of Arts in Art History ba
School of Business bus pbusad Certificate in Business Administration ct
bus pacc Graduate Certificate in Accounting ct

Output Formats

Output in JSON format:

{
  "program": [
    {
      "school": {
        "name": "School of Art & Design"
      },
      "title": "Post Baccalaureate in Art History",
      "degree": "pb"
    },
    {
      "school": {
        "name": "School of Art & Design"
      },
      "title": "Bachelor of Arts in Art History",
      "degree": "ba"
    },
…

Output in XML format:

<?xml version="1.0" encoding="UTF-8" ?>
<htsql:result xmlns:htsql="http://htsql.org/2010/xml">
  <program>
    <school>
      <name>School of Art &amp; Design</name>
    </school>
    <title>Post Baccalaureate in Art History</title>
    <degree>pb</degree>
  </program>
  <program>
    <school>
      <name>School of Art &amp; Design</name>
    </school>
    <title>Bachelor of Arts in Art History</title>
    <degree>ba</degree>
  </program>
…

Output in raw format:

{
  "meta": {
    "domain": {
      "type": "list",
      "item": {
        "domain": {
          "type": "record",
          "fields": [
            {
              "domain": {
                "type": "record",
                "fields": [
                  {
                    "domain": {
                      "type": "text"
                    },
                    "header": "name",
                    "path": "program.school.name",
                    "syntax": "name",
                    "tag": "name"
                  }
                ]
              },
              "header": "school",
              "path": "program.school",
              "syntax": "{name}",
              "tag": "school"
            },
            {
              "domain": {
                "type": "text"
              },
              "header": "title",
              "path": "program.title",
              "syntax": "title",
              "tag": "title"
            },
            {
              "domain": {
                "type": "text"
              },
              "header": "degree",
              "path": "program.degree",
              "syntax": "degree",
              "tag": "degree"
            }
          ]
        }
      }
    },
    "header": "program",
    "path": "program",
    "syntax": "\/program{school{name},title,degree}",
    "tag": "program"
  },
  "data": [
    [
      [
        "School of Art & Design"
      ],
      "Post Baccalaureate in Art History",
      "pb"
    ],
    [
      [
        "School of Art & Design"
      ],
      "Bachelor of Arts in Art History",
      "ba"
    ],
…
blog comments powered by Disqus