OU
test: cover sql macros plugin
outerbase/starbasedb#170

/claim #71

Summary

  • Add focused Vitest coverage for plugins/sql-macros/index.ts.
  • Cover SQL macros registration, $_exclude expansion, no-data-source behavior, external-source/pragma/non-select bypasses, schema lookup fallback, and SELECT * enforcement.
  • Fix parser AST normalization so SELECT * prevention works whether node-sql-parser returns a single statement object or an array.

This is a small SQL macros slice that is non-overlapping with the active/rewarded Durable Object, import/export, LiteREST, handler, worker, operation, cache, RLS, allowlist, plugin registry, stats, cron/resend, and API response coverage PRs.

Validation

  • .\node_modules\.bin\prettier.CMD --write plugins\sql-macros\index.ts plugins\sql-macros\index.test.ts - passed
  • .\node_modules\.bin\vitest.CMD run plugins\sql-macros\index.test.ts --coverage.enabled true --coverage.include plugins/sql-macros/index.ts --coverage.reporter text --coverage.reportsDirectory coverage-sql-macros - passed; plugins/sql-macros/index.ts reports 91.93% statements, 85.29% branches, 100% functions, 91.8% lines
  • git diff --check - passed

No UI demo video is included because this is plugin/unit-test coverage with no visible UI behavior.

AI-assisted with Codex; I reviewed the diff and kept the scope to this SQL macros coverage/fix slice.

Claim

Total prize pool $250
Total paid $0
Status Pending
Submitted May 12, 2026
Last updated May 12, 2026

Contributors

MT

mt211211

@mt211211

100%

Sponsors

OU

Outerbase (YC W23)

@outerbase

$250