Article
· 6 hr ago 3m read

GORM Meets InterSystems IRIS: Introducing gorm-iris

If you thought native Go support for IRIS was exciting, wait until you see what happens when GORM enters the mix.


Just recently, we welcomed native GoLang support for InterSystems IRIS with the release of go-irisnative. That was just the beginning. Now, we’re kicking things up a notch with the launch of gorm-iris — a GORM driver designed to bring the power of Object Relational Mapping (ORM) to your IRIS + Go stack.

Why GORM?

GORM is one of the most popular ORM libraries in the Go ecosystem. It makes it easy to interact with databases using Go structs instead of writing raw SQL. With features like auto migrations, associations, and query building, GORM simplifies backend development significantly.

So naturally, the next step after enabling Go to talk natively with IRIS was to make GORM work seamlessly with it. That’s exactly what gorm-iris does.


What Is gorm-iris?

gorm-iris is a custom GORM driver for InterSystems IRIS built on top of go-irisnative. It acts as a bridge, allowing developers to use the familiar GORM syntax and patterns to interact with an IRIS database — while all the heavy lifting behind the scenes is handled via native IRIS calls.

Think of it as the best of both worlds:

  • Native performance and data access via go-irisnative
  • Developer-friendly ORM features via GORM

Key Features

Here’s what you can expect from gorm-iris:

✅ Seamless integration between GORM and IRIS
✅ Use of native Go structs to model your IRIS data
✅ Basic CRUD operations out of the box
✅ Customizable behavior through Go interfaces

And of course, it’s all open source.


Quick Start Example

Want to get started? Here’s a minimal setup to show how things work:

package main

import (
	"fmt"

	iris "github.com/caretdev/gorm-iris"
	"gorm.io/gorm"
)

type User struct {
  ID    int
  Name  string
  Email string
}

func main() {
  dsn := "iris://_SYSTEM:SYS@localhost:1972/USER"
  db, err := gorm.Open(iris.Open(dsn), &gorm.Config{})
  if err != nil {
    panic("failed to connect to IRIS")
  }

	// Auto-migrate schema
  db.AutoMigrate(&User{})

  // Create
  db.Create(&[]User{
		{Name: "Johh", Email: "john@example.com"},
		{Name: "Johh1", Email: "john1@example.com"},
		{Name: "John2", Email: "john2@example.com"},
	})

  // Read
  var user User
  db.First(&user, "email = ?", "john1@example.com")
	fmt.Printf("Found: ID: %d; Name: %s\n", user.ID, user.Name)
}

Yes — that’s really it.


What’s Under the Hood?

The gorm-iris driver translates GORM operations into native calls through go-irisnative. This means you still get the speed and efficiency of direct IRIS access, but with a higher-level abstraction for everyday use cases.

It's ideal for developers who:

  • Want to build Go applications with IRIS as the backend
  • Prefer ORM-style development over direct query construction
  • Are looking to prototype or build full-scale apps with clean, readable Go code

Where It’s Headed

This is just version 0.1.1 — we’re actively working on improving feature coverage, performance tuning, and handling more complex GORM features.

If you’re using it and have feedback or feature requests — issues and PRs are welcome!

👉 Check out the repo: https://github.com/caretdev/gorm-iris


Final Thoughts

With go-irisnative, we opened the door for GoLang developers to talk to InterSystems IRIS. With gorm-iris, we’re inviting them to stay for dinner.

This library is all about making IRIS feel like home in your Go development workflow. It’s clean, expressive, and leverages the tools Go developers already love.

So go ahead — try it out, build something cool, and let us know what you think.

Discussion (0)1
Log in or sign up to continue