ai-safe-orm

command
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 10 Imported by: 0

README

AI-safe ORM Example

This example shows the Goquent safety workflow without requiring a live database.

It covers:

  • simple CRUD planning with QueryPlan.
  • tenant-scoped SaaS policies.
  • soft-delete default filters.
  • PII review with an access reason.
  • suppression and approval examples.
  • migration review inputs.
  • manifest verification inputs.
  • CI and MCP integration snippets.

Run:

go run ./examples/ai-safe-orm

Review:

go run ./cmd/goquent review --format pretty --fail-on blocked ./examples/ai-safe-orm
go run ./cmd/goquent migrate plan ./examples/ai-safe-orm/migrations/001_add_users.sql
go run ./cmd/goquent migrate plan ./examples/ai-safe-orm/migrations/002_drop_legacy_email.sql
go run ./cmd/goquent manifest verify \
  --manifest ./examples/ai-safe-orm/goquent.manifest.json \
  --schema ./examples/ai-safe-orm/schema.json \
  --policy ./examples/ai-safe-orm/policies.json
go run ./cmd/goquent operation compile \
  --manifest ./examples/ai-safe-orm/goquent.manifest.json \
  --spec ./examples/ai-safe-orm/operation.json \
  --values ./examples/ai-safe-orm/values.json \
  --format json

The example intentionally contains review findings so the output is visible; --fail-on blocked keeps the walkthrough command runnable.

Run an MCP server with a narrow tool surface:

go run ./cmd/goquent mcp \
  --manifest ./examples/ai-safe-orm/goquent.manifest.json \
  --tool get_manifest \
  --tool review_query \
  --tool compile_operation_spec \
  --resource manifest \
  --resource manifest-status

The MCP command exposes context and review tools only. It does not perform DB writes, raw SQL execution, or migration apply.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL