go-django-queries

module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: GPL-2.0

README

Go Django Queries Documentation

Welcome to the documentation for the go-django-queries package.

While Go-Django tries to do as little as possible with the database, sometimes helper functions make working with models easier.

This library brings Django-style ORM queries to Go-Django, allowing you to:

  • Define models with relationships
  • Compose queries with filters, ordering, limits
  • Use select expressions and annotations

📁 Documentation Structure


🔧 Quick Example

// Query forward foreign key relation
var todos, err := queries.Objects[*Todo](&Todo{}).
    Select("*", "User.*").
    Filter("Done", false).
    OrderBy("-ID").
    All()

// Query reverse foreign key relation
var todos, err := queries.Objects[*User](&User{}).
    Select("*", "TodoSet.*").
    Filter("TodoSet.Done", false).
    OrderBy("-ID").
    All()

Continue with Getting Started

✅ Supported Features

We try to support as many features as possible, but some stuff is either not supported, implemented or tested yet.

The following features are currently supported:

  • Selecting fields
  • Selecting forward and reverse relations
  • Filtering
  • Lookups
  • Ordering
  • Limiting
  • Expressions
  • Annotations
  • Aggregates
  • Virtual fields

Directories

Path Synopsis
src
migrator/sql/mysql
Package mysql provides a MySQL implementation of the migrator.SchemaEditor interface.
Package mysql provides a MySQL implementation of the migrator.SchemaEditor interface.

Jump to

Keyboard shortcuts

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