Types, validation, databases — from one source.
Define once. Validate, query, and generate everywhere.
Types, validation, DB schemas, and UI metadata in a single .as file. Change once, everything stays in sync.
string.email isn't just a type — it's a validator. number.int.positive carries constraints automatically.
@db.table, @db.index.unique, @db.column — your schema creates tables, syncs indexes, and handles CRUD.
TypeScript types, runtime validators, JSON Schema, database tables with indexes — all generated from one .as file.
Labels, descriptions, sensitivity flags, UI hints — all accessible at runtime for forms, docs, and APIs.
Add domain-specific annotations that flow through your entire stack. Build plugins for any language, database, or framework.
Once in Drizzle. Once in Zod. Once in your UI config. Atscript replaces all of them.
import { pgTable, serial, varchar, integer, uniqueIndex } from 'drizzle-orm/pg-core'
export const users = pgTable('users', {
id: serial('id').primaryKey(),
email: varchar('email', { length: 255 }).notNull(),
name: varchar('name', { length: 100 }).notNull(),
age: integer('age').notNull(),
role: varchar('role', { enum: ['admin', 'user'] }),
}, (t) => [uniqueIndex().on(t.email)])import { createInsertSchema } from 'drizzle-zod'
import { users } from '../db/schema'
export const insertUserSchema = createInsertSchema(users, {
email: (s) => s.email.email(),
name: (s) => s.name.min(2).max(100),
age: (s) => s.age.positive(),
})const fieldConfig = {
email: { label: 'Email Address', placeholder: 'alice@company.com' },
name: { label: 'Full Name', placeholder: 'Alice Smith' },
age: { label: 'Age', type: 'number' },
role: { label: 'Role', component: 'select' },
}@db.table 'users'
export interface User {
@db.id
id: number
@meta.label "Email Address"
@ui.placeholder "alice@company.com"
@db.index.unique 'email_idx'
email: string.email
@meta.label "Full Name"
@ui.placeholder "Alice Smith"
@expect.minLength 2
@expect.maxLength 100
@db.index.fulltext 'search_idx'
name: string
@meta.label "Age"
age: number.int.positive
@meta.label "Role"
@ui.component "select"
role?: 'admin' | 'user'
}@meta.* annotations are built-in. @db.* annotations power real database integrations. Add your own via the plugin system.