comet

module
v0.0.0-...-a108e6f Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT

README

☄️ Comet - Blazing-Fast, Schema-First ORM for Go

A lightweight, Prisma-inspired ORM for Go that prioritizes simplicity, speed, and type-safety.

Go Version License Build Status


Features

  • Schema-first development with .cmt files
  • Fast, type-safe query building with fluent API
  • Built-in CLI for codegen, migrations, and seeding
  • Multiple database backends (PostgreSQL, MySQL, SQLite)
  • Minimal dependencies, perfect for microservices
  • Goroutine-optimized for async patterns

Database Architecture

Quick Start

# Install ☄️ Comet CLI
go install github.com/nitrix4ly/comet/cli@latest

# Initialize project
mkdir myapp && cd myapp
go mod init myapp

# Create schema
cat > schema/schema.cmt << EOF
model User {
  id        Int      @id @auto
  email     String   @unique
  name      String
  createdAt DateTime @default(now())
}
EOF

# Generate models
comet gen

# Run migrations
comet migrate

Documentation

See docs/GUIDE.md for complete setup and usage instructions.

Code Example

Example Usage

import "myapp/models"

// Find users
users, err := models.User.Find().
    Where("email", "=", "hello@comet.dev").
    All(ctx)

// Create user
user := &models.User{
    Email: "john@example.com",
    Name:  "John Doe",
}
err = user.Save(ctx)

Architecture

Architecture Diagram

  • cli/ - Command-line interface
  • core/ - Core types and query builder
  • gen/ - Code generation from schemas
  • drivers/ - Database drivers
  • schema/ - Schema definitions
  • testz/ - Example applications

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Add tests for new functionality
  4. Submit a pull request

Contributing

License

MIT License - see LICENSE file for details.


Built with ❤️ by Nitrix

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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