Skip to content

caretdev/gorm-iris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gorm-iris

GORM dialect for InterSystems IRIS built on top of go-irisnative.

Status: alpha. APIs may change. Feedback and PRs welcome.


Installation

go get github.com/caretdev/gorm-iris

DSN format

The DSN is the same as for go-irisnative:

iris://user:password@host:1972/Namespace

Example:

export IRIS_DSN='iris://_SYSTEM:SYS@localhost:1972/USER'

Quick start

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)
}

Features

  • ✅ Drop-in GORM support for InterSystems IRIS
  • ✅ Schema migration (AutoMigrate)
  • ✅ CRUD operations
  • ✅ Transactions
  • ✅ Based on database/sql driver (go-irisnative)

Compatibility

  • Go: 1.21+
  • GORM: v2
  • InterSystems IRIS: 2022.1+

License

MIT License


Contributing

  • Please run go vet and go test ./... before PRs.
  • Document any missing IRIS-specific features or differences.
  • Add examples for advanced GORM patterns as tested.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published