Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions .github/workflows/glama-sync.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Glama MCP Server Sync

# Runs on every GitHub release to:
# Runs on every GitHub release (and on manual dispatch with a tag) to:
# 1. Keep glama.json version in sync with the release tag
# 2. Trigger a fresh Glama Docker build pinned to the exact release commit
#
Expand All @@ -16,9 +16,17 @@ name: Glama MCP Server Sync
# The cookie expires periodically. When builds start failing with "auth failed",
# repeat the steps above to refresh the secret.

# GoReleaser publishes releases with GITHUB_TOKEN, and events created with
# GITHUB_TOKEN do not start other workflows, so release.yml dispatches this
# workflow explicitly after GoReleaser (workflow_dispatch is the exception).
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Release tag to sync (e.g. v1.16.0)'
required: true

permissions:
contents: read
Expand All @@ -35,25 +43,30 @@ jobs:
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
ref: ${{ github.event.release.target_commitish }}
ref: ${{ github.event.release.target_commitish || 'main' }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Bump version in glama.json
env:
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
run: |
VERSION="${GITHUB_REF_NAME#v}"
VERSION="${RELEASE_TAG#v}"
echo "Updating glama.json → $VERSION"
jq --arg v "$VERSION" '.version = $v' glama.json > /tmp/glama.json
mv /tmp/glama.json glama.json

- name: Commit and push
env:
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
run: |
VERSION="${RELEASE_TAG#v}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add glama.json
if git diff --staged --quiet; then
echo "glama.json already at ${GITHUB_REF_NAME#v} — no commit needed"
echo "glama.json already at ${VERSION} — no commit needed"
else
git commit -m "chore(glama): sync version to ${GITHUB_REF_NAME#v} [skip ci]"
git commit -m "chore(glama): sync version to ${VERSION} [skip ci]"
git push
fi

Expand All @@ -65,9 +78,12 @@ jobs:
- name: Trigger build
env:
GLAMA_SESSION_COOKIE: ${{ secrets.GLAMA_SESSION_COOKIE }}
COMMIT_SHA: ${{ github.sha }}
RELEASE_TAG: ${{ github.ref_name }}
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
GH_TOKEN: ${{ github.token }}
run: |
# Pin the build to the tagged commit (github.sha is main's head on dispatch).
COMMIT_SHA="$(gh api "repos/${GITHUB_REPOSITORY}/commits/${RELEASE_TAG}" --jq .sha)"
export COMMIT_SHA
if [ -z "$GLAMA_SESSION_COOKIE" ]; then
echo "::warning::GLAMA_SESSION_COOKIE not set — skipping Glama build trigger."
echo ""
Expand All @@ -93,7 +109,7 @@ jobs:
# Build steps run inside Glama's debian:bookworm-slim container.
# Update the Go version below when go.mod bumps the minimum Go requirement.
build_steps = json.dumps([
"curl -fsSL -o /tmp/go.tar.gz https://go.dev/dl/go1.26.1.linux-amd64.tar.gz",
"curl -fsSL -o /tmp/go.tar.gz https://go.dev/dl/go1.26.10.linux-amd64.tar.gz",
"tar -C /usr/local -xzf /tmp/go.tar.gz",
"PATH=/usr/local/go/bin:$PATH /usr/local/go/bin/go build -ldflags='-s -w' -o /app/gosqlx-mcp ./cmd/gosqlx-mcp",
])
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write # GoReleaser creates the GitHub release and uploads assets
actions: write # dispatch glama-sync.yml (release events from GITHUB_TOKEN start no workflows)

steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
Expand Down Expand Up @@ -83,7 +84,16 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


# The release GoReleaser just published does not trigger glama-sync.yml's
# `release: published` (it was created with GITHUB_TOKEN); dispatch it.
- name: Dispatch Glama sync
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
run: gh workflow run glama-sync.yml --repo "$GITHUB_REPOSITORY" --ref main -f tag="$TAG"

- name: Upload assets
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GoSQLX is a **production-ready**, **race-free**, high-performance SQL parsing SD
- Thread-safe with zero race conditions (20,000+ concurrent operations tested)
- 1.38M+ ops/sec sustained, 1.5M peak with memory-efficient object pooling
- ~80-85% SQL-99 compliance (window functions, CTEs, set operations, MERGE, etc.)
- Multi-dialect support: PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake, ClickHouse (8 dialects)
- Multi-dialect support: PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, Snowflake, ClickHouse (8 dialects with dedicated grammar); `--dialect` also accepts `generic`, `bigquery`, `redshift` (11 names)

## Architecture

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<br/>

<!-- metrics:start -->
| **~3.1M parses/sec†** | **318 ns parse latency†** | **~80–85% SQL-99 (est.)** | **8 dialects** | **0 race conditions** |
| **~2.9M parses/sec†** | **349 ns parse latency†** | **~80–85% SQL-99 (est.)** | **8 dialects** | **0 race conditions** |
|:---:|:---:|:---:|:---:|:---:|

<sub>† Parse stage only (pre-tokenized input to AST), `SELECT id, name FROM users`, Apple M4, Go 1.27, median of 10 runs of `BenchmarkPerformanceBaseline`. Complex queries take longer (see `performance_baselines.json`). Reproduce: `go test -run ^$ -bench BenchmarkPerformanceBaseline -benchmem -count=10 ./pkg/sql/parser/`.</sub>
<sub>† Parse stage only (pre-tokenized input to AST), `SELECT id, name FROM users`, Apple M4, Go 1.27, median of 20 runs of `BenchmarkPerformanceBaseline`. Complex queries take longer (see `performance_baselines.json`). Reproduce: `go test -run ^$ -bench BenchmarkPerformanceBaseline -benchmem -count=20 ./pkg/sql/parser/`.</sub>
<!-- metrics:end -->

<br/>
Expand All @@ -33,7 +33,7 @@

## What is GoSQLX?

GoSQLX is a **production-ready SQL parsing SDK** for Go. It tokenizes, parses, and generates ASTs from SQL with zero-copy optimizations and intelligent object pooling - parsing a simple SELECT in about <!-- metrics-inline:start -->**318 ns (~3.1M parses/sec)**<!-- metrics-inline:end -->.
GoSQLX is a **production-ready SQL parsing SDK** for Go. It tokenizes, parses, and generates ASTs from SQL with zero-copy optimizations and intelligent object pooling - parsing a simple SELECT in about <!-- metrics-inline:start -->**349 ns (~2.9M parses/sec)**<!-- metrics-inline:end -->.

### Why GoSQLX?

Expand Down
Loading
Loading