Giter Site home page Giter Site logo

gorm-firebird's Introduction

gorm-firebird

GORM firebird driver (for Firebird 3.0)

import:

"github.com/flylink888/gorm-firebird"

Example:

var products []Product
dsn := "SYSDBA:[email protected]/sysdb?charset=utf8"
db, err := gorm.Open(firebird.Open(dsn), &gorm.Config{
   NamingStrategy: firebird.NamingStrategy{},  //这个很重要
})
if err != nil {
	fmt.Println(err)
}
type Product struct {
Pid  string `gorm:"primaryKey"`
Name string
}
//这个不是必需的
func (Product) TableName() string {
return "PRODUCT"
}

gorm-firebird's People

Contributors

flylink888 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gorm-firebird's Issues

cannot use column

cannot use column (variable of type Column) as gorm.ColumnType value in argument to append: Column does not implement gorm.ColumnType (missing method AutoIncrement)

Full missing methods are:
func (c Column) AutoIncrement() (isAutoIncrement bool, ok bool)
func (c Column) ColumnType() (columnType string, ok bool)
func (c Column) Comment() (value string, ok bool)
func (c Column) DefaultValue() (value string, ok bool)
func (c Column) PrimaryKey() (isPrimaryKey bool, ok bool)
func (c Column) ScanType() reflect.Type
func (c Column) Unique() (unique bool, ok bool)

gorm.io/gorm v1.23.3
github.com/flylink888/gorm-firebird v1.0.2

ColumnType does not implement gorm.ColumnType

Hello, this problem occurs here

github.com/flylink888/gorm-firebird ../../go/pkg/mod/github.com/flylink888/[email protected]/migrator.go:6:2: could not import reflect (open : no such file or directory) ../../go/pkg/mod/github.com/flylink888/[email protected]/migrator.go:210:38: cannot use ColumnType{…} (value of type ColumnType) as type gorm.ColumnType in argument to append: ColumnType does not implement gorm.ColumnType (missing DatabaseTypeName method) ../../go/pkg/mod/github.com/flylink888/[email protected]/firebird.go:100:39: invalid operation: cannot indirect limit.Limit (variable of type int)

good work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.