examples/

directory
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: AGPL-3.0

README

Neat Examples

This directory contains examples demonstrating various use cases of the neat Go ORM library.

Available Examples

  • basic-orm - Basic ORM operations with the query builder (CRUD operations, simple queries)
  • schema-builder - Creating and modifying database tables using the schema builder
  • models - Using struct-based models for type-safe database operations
  • configuration - Various configuration options for database connections
  • migrations - Database migration examples with relationships and constraints
  • advanced-queries - Advanced query builder features (joins, aggregations, subqueries)

Running Examples

Each example is self-contained and can be run independently:

cd examples/<example-name>
go run main.go

Prerequisites

Most examples use SQLite by default for simplicity. You can modify the DSN in each example to use PostgreSQL, MySQL, or SQL Server as needed.

Make sure you have the required database server running and valid credentials before running examples that connect to external databases.

Database Setup

For a quick start with SQLite, no additional setup is required. The examples will create a local SQLite file.

For other databases, ensure you have:

  1. The database server installed and running
  2. A database created
  3. Valid credentials with appropriate permissions

Modify the connection string in each example's main.go file to match your database configuration.

Jump to

Keyboard shortcuts

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