GORM dialect for InterSystems IRIS built on top of go-irisnative.
Status: alpha. APIs may change. Feedback and PRs welcome.
go get github.com/caretdev/gorm-irisThe DSN is the same as for go-irisnative:
iris://user:password@host:1972/Namespace
Example:
export IRIS_DSN='iris://_SYSTEM:SYS@localhost:1972/USER'package main
import (
"fmt"
"gorm.io/gorm"
iris "github.com/caretdev/gorm-iris" // import dialect
)
type Person struct {
ID int `gorm:"primaryKey"`
Name string
}
func main() {
dsn := "iris://_SYSTEM:SYS@localhost:1972/USER"
db, err := gorm.Open(iris.Open(dsn), &gorm.Config{})
if err != nil { panic(err) }
// Auto-migrate schema
db.AutoMigrate(&Person{})
// Insert
db.Create(&Person{ID: 1, Name: "Alice"})
// Query
var p Person
db.First(&p, 1)
fmt.Println("Found:", p)
// Update
db.Model(&p).Update("Name", "Alice Updated")
// Delete
db.Delete(&p)
}- ✅ Drop-in GORM support for InterSystems IRIS
- ✅ Schema migration (
AutoMigrate) - ✅ CRUD operations
- ✅ Transactions
- ✅ Based on
database/sqldriver (go-irisnative)
- Go: 1.21+
- GORM: v2
- InterSystems IRIS: 2022.1+
MIT License
- Please run
go vetandgo test ./...before PRs. - Document any missing IRIS-specific features or differences.
- Add examples for advanced GORM patterns as tested.