Agent skill

SQL Usage

by timeplus-io in timeplus-io/proton

Timeplus streaming SQL covering stream types, EMIT policies, window functions, JOINs, materialized views, external streams, and UDFs.

Apache-2.0Auto-check passedDatabases

Install SQL Usage

skills CLI
$ npx skills add timeplus-io/proton --skill sql-usage -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install timeplus-io/proton sql-usage --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/timeplus-io/proton.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/sql-usage .claude/skills/sql-usage && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sql-usage
GitHub stars
2.3k
Token cost
~1.7k tokens
SKILL.md length
603 words
Files
8 (incl. references)
Skills in repo
7
Repo updated
First seen
Licence
Apache-2.0

At a glance

Timeplus streaming SQL covering stream types, EMIT policies, window functions, JOINs, materialized views, external streams, and UDFs.

  • Any SQL-related question including writing queries
  • SKILL.md covers Naming rules, Stream type decision table, Query modes and Window functions quick reference, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Debugging SQL errors

What it does

SQL Usage is an agent skill from timeplus-io/proton. Timeplus streaming SQL covering stream types, EMIT policies, window functions, JOINs, materialized views, external streams, and UDFs. Make sure to use this skill for any SQL-related question including writing queries, debugging SQL errors, understanding streaming behavior, or designing stream processing pipelines, even if the user doesn't explicitly mention streaming SQL.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files (for example `references/emit-policies.md`, `references/external-streams.md` and `references/high-availability.md`).

It sits in Databases, covering SQL. It works with SQL and Apache Kafka. The repository describes itself as: The Fastest Unified Streaming SQL Engine in a Single C++ Binary. ⚡ Millisecond latency. 100+ GB/s throughput. Continuously compute real-time context from streams, logs, metrics… The licence is Apache-2.0.

When your agent uses it

  • Any SQL-related question including writing queries
  • Debugging SQL errors
  • Understanding streaming behavior
  • Designing stream processing pipelines

Example prompts

  • “/sql-usage”

What it can do on your machine

Read from SKILL.md and the folder at commit 1c47e60. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are sql).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.timeplus.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

SQL Usage loads about 1.7k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 96 tokens; SKILL.md has 603 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from timeplus-io/proton at commit 1c47e60, republished under its Apache-2.0 licence (© timeplus-io). 603 words, ~1,682 tokens.

Download SKILL.mdSave it as .claude/skills/sql-usage/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
sql-usage
description
Timeplus streaming SQL covering stream types, EMIT policies, window functions, JOINs, materialized views, external streams, and UDFs. Make sure to use this skill for any SQL-related question including writing queries, debugging SQL errors, understanding streaming behavior, or designing stream processing pipelines, even if the user doesn't explicitly mention streaming SQL.

Streaming SQL

Source of truth: https://docs.timeplus.com | Raw markdown: https://github.com/timeplus-io/docs/tree/main/docs

Naming rules

ElementStyleExample
KeywordsUPPERCASESELECT, CREATE STREAM, EMIT, JOIN
Functionslowercasecount(), tumble(), date_diff_within()
Data typeslowercaseint64, float64, string, datetime64
Identifierslowercase_with_underscoresevent_time, user_id
Reserved fields_tp_ prefix_tp_time (event timestamp), _tp_delta (changelog)

Stream type decision table

NeedTypeSyntax
Immutable events, time-series, high throughputappend (default)CREATE STREAM ... ORDER BY
Updates/upserts, point queries, KV (first choice)mutableCREATE MUTABLE STREAM ... PRIMARY KEY
Version history, ASOF JOINsversioned_kvCREATE STREAM ... PRIMARY KEY ... SETTINGS mode='versioned_kv'
CDC semantics, track deletes via _tp_deltachangelog_kvCREATE STREAM ... PRIMARY KEY ... SETTINGS mode='changelog_kv'
External source (Kafka, Pulsar, etc.)externalCREATE EXTERNAL STREAM ... SETTINGS type='kafka'

Full details → references/stream-types.md

Query modes

  • SELECT FROM stream → streaming (continuous, future events)
  • SELECT FROM table(stream) → historical (batch scan, returns once)

Three trigger types:

Query typeTrigger
Non-aggregation (tail/filter/transform)When events arrive
Window aggregationWindow end + watermark
Global aggregationFixed interval (default 2s if EMIT PERIODIC omitted)

Window functions quick reference

FunctionSignatureUse case
tumbletumble(stream, [time_col], interval, [tz])Fixed non-overlapping windows
hophop(stream, [time_col], slide, size, [tz])Sliding/overlapping windows
sessionsession(stream, [time_col], MAXSPAN x AND TIMEOUT y)Inactivity-based windows
  • time_col defaults to _tp_time if omitted
  • Intervals: 1s, 5m, 2h, 3d, 1w, 1M, 1q, 1y
  • window_start, window_end auto-generated (left-closed, right-open [))
  • Hop: slide and size must use same unit; slide > size is unsupported
  • Window nesting: max 2 levels; window-over-global is unsupported

EMIT policy quick reference

ContextPolicyEffect
WindowEMIT AFTER WINDOW CLOSEDefault for windowed agg
WindowEMIT AFTER WINDOW CLOSE WITH DELAY 2sAllow late events
WindowEMIT AFTER WINDOW CLOSE WITH DELAY 1s AND TIMEOUT 3sLate events + force-close
WindowEMIT ON UPDATEEmit when agg value changes per key
WindowEMIT ON UPDATE WITH BATCH 2sBatched update detection
GlobalEMIT PERIODIC 5sDefault (2s), batch periodic output
GlobalEMIT PERIODIC 5s REPEATEmit even without new events
GlobalEMIT ON UPDATEImmediate on every change
GlobalEMIT CHANGELOGWith _tp_delta (+1/-1)
GlobalEMIT PER EVENTPer-event (debug only, no parallelism)
GlobalEMIT AFTER KEY EXPIRE ... WITH MAXSPAN x AND TIMEOUT yTracing/span aggregation

Full formal syntax → references/emit-policies.md

Show full SKILL.md (251 more words)Show less

JOIN quick reference

PatternSyntax keyUse case
Static enrichmentstream JOIN table(lookup)Enrich with historical data
Dynamic enrichmentappend JOIN versioned_kv USING(k)Latest version auto-picked
Bidirectionalmutable JOIN mutableBoth sides updatable
Range (time-bounded)stream JOIN stream ... AND date_diff_within(2m)Bounded stream-to-stream
ASOFappend ASOF JOIN versioned_kv ON ... AND t1 >= t2Closest version match
LATESTappend LATEST JOIN versioned_kv ON ...Latest value only
Direct lookupstream JOIN mutable ... SETTINGS join_algorithm='direct'PK/index lookup, no full load
Dictionarystream JOIN dict ... SETTINGS join_algorithm='direct'External source lookup

Supported: INNER, LEFT, FULL. Unsupported: RIGHT, CROSS. Strictness: ALL (default), ASOF, LATEST.

Full examples → references/join-patterns.md

Materialized view checklist

  • Stateless test default: use MatView without INTO, then verify with table(mv)
  • Create target stream FIRST only when you need an extra sink stream
  • Use explicit INTO target only when a target stream is required by the scenario
  • Configure checkpointing: SETTINGS checkpoint_interval=30
  • High-cardinality: SETTINGS default_hash_table='hybrid', max_hot_keys=10000
  • Schema evolution (with target stream): ALTER STREAM target + ALTER VIEW ... MODIFY QUERY
  • Cleanup order: DROP VIEW → (if created) DROP STREAM target → DROP STREAM source

Full config → references/mv-production.md

External stream (Kafka) quick reference

sql
CREATE EXTERNAL STREAM events(raw string)
SETTINGS type='kafka', brokers='host:9092', topic='events';

Key settings: data_format, security_protocol, sasl_mechanism, kafka_schema_registry_url Virtual columns: _tp_message_key, _tp_message_headers, _tp_sn (offset), _tp_shard (partition) Query options: SETTINGS shards='0,2', seek_to='earliest'

Full details → references/external-streams.md

UDF quick reference

sql
CREATE FUNCTION udf_name(param type) RETURNS type LANGUAGE JAVASCRIPT AS $$ ... $$;

Scalar: receives array of values (batched), returns array. UDAF: implement initialize, process, finalize, serialize, deserialize, merge.

Full details → references/udf.md

References

© timeplus-io, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (references) in .claude/skills/sql-usage of timeplus-io/proton.

  • SKILL.md
  • references/emit-policies.md
  • references/external-streams.md
  • references/high-availability.md
  • references/join-patterns.md
  • references/mv-production.md
  • references/stream-types.md
  • references/udf.md

Open the folder on GitHubat commit 1c47e60

Compare with similar skills

SQL Usage next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

SQL Usage compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
SQL Usage this skilltimeplus-io/proton2.3k—~1.7kAutomated safety check: PassApache-2.0
Mz BenchmarkMaterializeInc/materialize6.4k—~2.8kAutomated safety check: PassCustom licence
AWS Storageaws/agent-toolkit-for-aws2.8k—~5.8kAutomated safety check: PassApache-2.0
Evolving The Data ModelTriliumNext/Trilium38k—~2.1kAutomated safety check: PassAGPL-3.0
Safe SQL Executionsupabase/supabase111k—~4.2kAutomated safety check: PassApache-2.0
Sql2erystemsrx/sql_to_ER1881 repos~1.1kAutomated safety check: PassAGPL-3.0

Similar skills

  • Mz Benchmark

    MaterializeInc/materialize

    Add/modify/debug Materialize perf benchmark scenarios. An agent skill from MaterializeInc/materialize.

    6.4k GitHub stars~2.8k tokensUpdated today
    DatabasesAuto-check passed
  • AWS Storage

    aws/agent-toolkit-for-aws

    Official

    Selects, investigates, and compares AWS object, file, and block storage services, and answers cost, performance, configuration, security, and troubleshooting questions about storage services.

    2.8k GitHub stars~5.8k tokensUpdated today
    DatabasesAuto-check passed
  • Evolving The Data Model

    TriliumNext/Trilium

    A skill your agent uses when adding a DB migration or a new column/field to a Becca entity in Trilium ("add a migration", "new column on notes/attributes", "ALTER TABLE", "add a field to…

    38k GitHub stars~2.1k tokensUpdated today
    DatabasesAuto-check passed
  • Safe SQL Execution

    supabase/supabase

    Official

    A skill your agent uses whenever code will build, return, fetch, or execute SQL that runs against a user's real Postgres database — even when the request reads like an ordinary feature or bug fix…

    111k GitHub stars~4.2k tokensUpdated today
    DatabasesAuto-check passed
  • Sql2er

    ystemsrx/sql_to_ER

    A skill your agent uses when the user wants a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, wants to rearrange or clean up an existing sql2er state, wants a skeleton-only overview…

    188 GitHub starsUsed in 1 repo~1.1k tokens
    DatabasesAuto-check passed
  • Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.

    4.6k GitHub stars~1.6k tokensUpdated today
    DatabasesAuto-check passed

More from timeplus-io/proton

  • Alloc Profile

    timeplus-io/proton

    Analyze jemalloc or async-profiler allocation profiles in collapsed stack format.

    2.3k GitHub stars~489 tokensUpdated 18 days ago
    Auto-check passed
  • Create Worktree

    timeplus-io/proton

    Create a Proton git worktree with local submodule reuse. An agent skill from timeplus-io/proton.

    2.3k GitHub stars~812 tokensUpdated 18 days ago
    Auto-check passed
  • Build And Verify

    timeplus-io/proton

    Build, compile, run server/client/cluster, execute unit/stateless/SQL tests, verify results, and troubleshoot build/test failures.

    2.3k GitHub stars~1.3k tokensUpdated 18 days ago
    Auto-check passed
  • CI Diagnostics

    timeplus-io/proton

    Diagnose Proton CI failures and performance comparison results from GitHub checks and uploaded reports.

    2.3k GitHub stars~685 tokensUpdated 18 days ago
    Auto-check passed
  • Cpp Coding

    timeplus-io/proton

    Write or review Timeplus/Proton C++20 code covering naming conventions, Proton fences, clang-format, IProcessor patterns, and checkpointing.

    2.3k GitHub stars~582 tokensUpdated 18 days ago
    Auto-check passed
  • Review

    timeplus-io/proton

    Review a Proton pull request or diff for correctness, streaming semantics, checkpointing, compatibility, and performance.

    2.3k GitHub stars~1.1k tokensUpdated 18 days ago
    Auto-check passed

Works with

Categories

Questions about SQL Usage

What does SQL Usage do?

Timeplus streaming SQL covering stream types, EMIT policies, window functions, JOINs, materialized views, external streams, and UDFs. SQL Usage is an agent skill from timeplus-io/proton. Timeplus streaming SQL covering stream types, EMIT policies, window functions, JOINs, materialized views, external streams, and UDFs.

When should I use SQL Usage?

SQL Usage fits situations like: any SQL-related question including writing queries; debugging SQL errors; understanding streaming behavior; designing stream processing pipelines.

How do I install SQL Usage in Claude Code?

Run `npx skills add timeplus-io/proton --skill sql-usage -a claude-code`. Or copy the skill folder (.claude/skills/sql-usage in timeplus-io/proton) into .claude/skills/sql-usage in your project. Claude Code loads it when a task matches its description.

How do I install SQL Usage in Codex?

Run `npx skills add timeplus-io/proton --skill sql-usage -a codex`. Or copy the skill folder (.claude/skills/sql-usage in timeplus-io/proton) into .agents/skills/sql-usage in your project. Codex loads it when a task matches its description.

Can I use SQL Usage in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add timeplus-io/proton --skill sql-usage -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sql-usage, .gemini/skills/sql-usage, .github/skills/sql-usage and .opencode/skills/sql-usage in your project.

What does SQL Usage need to run?

SKILL.md names no scripts, command-line tools or credentials: SQL Usage is instructions for the agent only.

Does SQL Usage access the network?

SKILL.md names 2 domains. As links in the text: docs.timeplus.com and github.com. This is read from the text; nothing was executed.

Is SQL Usage safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does SQL Usage use?

SQL Usage is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does SQL Usage use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.6k tokens, read only when the agent opens those files.

What are the alternatives to SQL Usage?

Skills that share tags, products or a category with SQL Usage: Mz Benchmark (MaterializeInc/materialize, 6.4k stars), AWS Storage (aws/agent-toolkit-for-aws, 2.8k stars), Evolving The Data Model (TriliumNext/Trilium, 38k stars) and Safe SQL Execution (supabase/supabase, 111k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains SQL Usage?

timeplus-io (a GitHub organization) maintains it in timeplus-io/proton, which has 2,265 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on September 20, 2026.

Source: timeplus-io/proton on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.