Announcing go-odata v0.9.0: OData v4 APIs for Go — DeepSeek…
    Neura MarketNeura Market/DeepSeek
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityTrending
    DeepSeekBlogAnnouncing go-odata v0.9.0: OData v4 APIs for Go
    Back to Blog
    Announcing go-odata v0.9.0: OData v4 APIs for Go
    go

    Announcing go-odata v0.9.0: OData v4 APIs for Go

    Nlstn January 22, 2026
    0 views

    OData is a standards-based way to ship queryable, discoverable APIs. go-odata wires the protocol...


    title: Announcing go-odata v0.9.0: OData v4 APIs for Go published: true description: tags: go, odata, api, backend

    cover_image: https://direct_url_to_image.jpg

    Use a ratio of 100:42 for best results.

    published_at: 2026-01-22 17:41 +0000


    OData is a standards-based way to ship queryable, discoverable APIs. go-odata wires the protocol details for you: metadata, key parsing, canonical URLs, and query option execution. In times of AI-assisted coding, having a strict, machine-readable standard like OData helps both humans and LLMs generate correct, predictable APIs.

    Currently at v0.9.0, which effectively represents the planned 1.0 API surface. Remaining work toward 1.0 is focused on cleanup, documentation, and performance—not on major feature gaps.

    Why OData?

    • Standardized querying ($filter, $expand, $apply) instead of custom query params
    • Machine-readable metadata ($metadata) enabling automatic client generation
    • Ecosystem support (Excel, Power BI, SAP, Dynamics, Graph, etc.)
    • Formal protocol instead of ad-hoc REST conventions

    What go-odata provides

    • OData v4.01 coverage: 85+ compliance tests validating headers, payloads, query options, metadata, batch, change tracking, and errors.
    • End-to-end endpoints: Service document, $metadata, CRUD, navigation, property accessors, composite keys, singletons, and batch.
    • Query options implemented: $filter, $select, $expand, $orderby, $top/$skip, $count, $search, $apply, and delta tokens.
    • Database support via GORM: SQLite, PostgreSQL, MariaDB, and MySQL exercised in CI.
    • Lifecycle and read hooks: Validation, authorization, tenant scoping, redaction, and auditing without global middleware.
    • Custom operations: Bound/unbound actions and functions and virtual entities.

    Getting started

    package main
    
    import (
        "log"
        "net/http"
    
        "github.com/nlstn/go-odata"
        "gorm.io/driver/sqlite"
        "gorm.io/gorm"
    )
    
    type Product struct {
        ID          uint    `json:"ID" gorm:"primaryKey" odata:"key"`
        Name        string  `json:"Name" gorm:"not null" odata:"required"`
        Description string  `json:"Description"`
        Price       float64 `json:"Price" gorm:"not null"`
        Category    string  `json:"Category" gorm:"not null"`
    }
    
    func main() {
        db, err := gorm.Open(sqlite.Open("test.db"), &gorm.Config{})
        if err != nil {
            log.Fatal(err)
        }
        db.AutoMigrate(&Product{})
    
        service, err := odata.NewService(db)
        if err != nil {
            log.Fatal(err)
        }
        if err := service.RegisterEntity(&Product{}); err != nil {
            log.Fatal(err)
        }
    
        mux := http.NewServeMux()
        mux.Handle("/", service)
    
        log.Println("Serving OData on :8080")
        log.Fatal(http.ListenAndServe(":8080", mux))
    }
    

    With this minimal setup you automatically get:

    • GET / service document and GET /$metadata CSDL
    • CRUD endpoints: /Products, /Products(1) with optimistic concurrency via ETags
    • Full query option support, navigation, and property accessors

    Extending behavior with hooks

    Lifecycle hooks let you keep business logic close to your entities:

    // Validate before writes
    func (p *Product) ODataBeforeCreate(ctx context.Context, r *http.Request) error {
        if p.Price < 0 {
            return fmt.Errorf("price cannot be negative")
        }
        return nil
    }
    
    // Apply tenant filters before reads
    func (p Product) ODataBeforeReadCollection(ctx context.Context, r *http.Request, opts *odata.QueryOptions) ([]func(*gorm.DB) *gorm.DB, error) {
        tenantID := r.Header.Get("X-Tenant-ID")
        if tenantID == "" {
            return nil, fmt.Errorf("missing tenant header")
        }
        return []func(*gorm.DB) *gorm.DB{
            func(db *gorm.DB) *gorm.DB { return db.Where("tenant_id = ?", tenantID) },
        }, nil
    }
    

    No global middleware required—hooks are discovered via reflection and scoped to the entity.

    Practical impact

    • Automatic metadata, key parsing, and canonical URLs remove protocol boilerplate.
    • Query option parsing/execution covers $apply/$expand and other spec-required behaviors.
    • ETag-based optimistic concurrency and per-entity HTTP method restrictions support safer writes.
    • Structured errors and tracing hooks aid debugging and observability.
    • Swappable databases through GORM without changing the API layer.

    Road to 1.0

    v0.9.0 is focused on stability. The next steps before 1.0:

    • Finalize any remaining breaking changes and API polish.
    • Broaden compliance coverage as the test suite grows.
    • Capture feedback from early adopters—file issues or discussions on GitHub.

    Learn more

    • GitHub: https://github.com/nlstn/go-odata
    • Docs: https://github.com/NLstn/go-odata/tree/main/documentation
    • OData spec: https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html

    Tags

    goodataapibackend

    Comments

    More Blog

    View all
    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught megemma

    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught me

    I ported the whole Gemma-4 family — E2B, E4B, 12B, 31B, and the 26B-A4B MoE — to run on...

    X
    xbill
    Hey DEV, I'm Tobore. Let's actually connect.community

    Hey DEV, I'm Tobore. Let's actually connect.

    Hey DEV, I'm Tobore. Let's actually connect. I've been on here for a while now, mostly writing and...

    L
    Laurina Ayarah
    I burned through thousands of AI tokens. Then a friend did it for freeai

    I burned through thousands of AI tokens. Then a friend did it for free

    (yep, kinda clickbait, just for the funsies 😊) At the beginning of the year, I relaunched my...

    P
    Paulo Henrique
    Claude might be saturating your machineai

    Claude might be saturating your machine

    My laptop was sitting idle with the fan at full tilt. Nothing was running that I knew of. The culprit...

    S
    Sidhant Panda
    Automated GitHub Code Reviews Using Google Geminigithubactions

    Automated GitHub Code Reviews Using Google Gemini

    I Built a Thing! TL;DR — Google Gemini-based Pull Request reviews and Issue Triaging for...

    D
    Darren "Dazbo" Lester
    What is an "agentic harness," actually?ai

    What is an "agentic harness," actually?

    I've been hearing the word "harness" thrown around a lot lately. I assumed it just meant "the IDE" or...

    T
    Tilde A. Thurium

    Stay up to date

    Get the latest DeepSeek prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for DeepSeek and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work