Skip to content
HALOWERK

Codewerk

index suggest

Parses the schema (CREATE TABLE with inline and table-level keys, CREATE INDEX, pg_dump-style ALTER TABLE . ADD CONSTRAINT; PostgreSQL or MySQL) with an own DDL parser and every query with node-sql-parser (SELECT, UPDATE, DELETE incl. joins, subqueries, CTEs, UNION). Candidate columns follow the multicolumn rule of the PostgreSQL 18 manual (11.3: equality constraints on leading columns plus an inequality on the next column limit the scanned index range; 11.4: a B-tree can deliver ORDER BY.

POST https://code.halowerk.com/v1/index-suggest

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
schema_ddlstringYesCREATE TABLE and CREATE INDEX statements of the relevant tables.
queriesarrayYesQueries to support; placeholders ?, $1 or literals.
dialectstringNo
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_ddl",
    "queries"
  ],
  "properties": {
    "schema_ddl": {
      "type": "string",
      "minLength": 10,
      "maxLength": 1000000,
      "description": "CREATE TABLE and CREATE INDEX statements of the relevant tables."
    },
    "queries": {
      "type": "array",
      "minItems": 1,
      "maxItems": 50,
      "items": {
        "type": "string",
        "minLength": 6,
        "maxLength": 50000
      },
      "description": "Queries to support; placeholders ?, $1 or literals."
    },
    "dialect": {
      "type": "string",
      "enum": [
        "postgresql",
        "mysql"
      ],
      "default": "postgresql"
    }
  }
}

Open original schema

Published input example

{
  "schema_ddl": "CREATE TABLE orders (id bigint PRIMARY KEY, customer_id bigint NOT NULL, status text NOT NULL, created_at timestamptz NOT NULL);",
  "queries": [
    "SELECT id FROM orders WHERE status = 'open' AND created_at >= $1 ORDER BY created_at"
  ]
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’