Chat2Query
Hacker News

Powered by

TiDB Cloud

About

"chat2query-hackernews" is short for "Chat to Query Hacker News", that means you can ask questions in natural language without SQL skills to query Hacker News database.

How it works

Items are updated in real-time using official HackerNews API. Data is stored in a MySQL-Compatible + HTAP + Serverless database TiDB Cloud.

There are two tables:

CREATE TABLE items ( id bigint(20) NOT NULL, title varchar(198) DEFAULT NULL, url varchar(6598) DEFAULT NULL, text text DEFAULT NULL, type varchar(8) NOT NULL DEFAULT 'story', by varchar(15) NOT NULL DEFAULT '', time int(11) NOT NULL, score int(11) NOT NULL DEFAULT '0', parent bigint(20) DEFAULT NULL, descendants int(11) DEFAULT '0', deleted tinyint(1) NOT NULL DEFAULT '0', dead tinyint(1) NOT NULL DEFAULT '0', last_fetch_at datetime NOT NULL DEFAULT '1970-01-01 00:00:01', kids json DEFAULT NULL, parts json DEFAULT NULL, poll bigint(20) DEFAULT NULL, PRIMARY KEY (id) /*T![clustered_index] CLUSTERED */, KEY index_items_type_time_id (type,time,id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

CREATE TABLE users ( id varchar(255) NOT NULL, about text DEFAULT NULL, karma int(11) NOT NULL DEFAULT '0', created int(11) NOT NULL, last_fetch_at datetime NOT NULL DEFAULT '1970-01-01 00:00:01', PRIMARY KEY (id) /*T![clustered_index] CLUSTERED */ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

Thanks to