Skip to content

Add @b9g/zen/schema entrypoint for client-side usage #7

@brainkim

Description

@brainkim

Summary

Create a new entrypoint @b9g/zen/schema that exports table/view definitions without the database runtime. This allows tables to be used client-side for:

  • Form validation
  • API request/response contracts
  • Shared types between client and server

Motivation

Tables are just Zod schemas with metadata. The database-specific code (drivers, queries, migrations) isn't needed for validation use cases.

Proposed Exports

// @b9g/zen/schema
export { z, table, view, isTable, isView, extendZod } from "@b9g/zen";
export type { Table, View, Row, Insert, Update } from "@b9g/zen";
// Possibly: FieldMeta, FieldDBMeta for form generation

Notes

  • SQL builtins (NOW, TODAY, etc.) would still be available - they're just symbols
  • No driver dependencies
  • Smaller bundle for client-side usage

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions