go-pg/pg

Can't have different pg table names for the same Go struct

hsluoyz opened this issue · 7 comments

In docs I found dynamic table name, but when I use it in my project, there's always an error pgadapter.NewAdapter: ERROR #42601 syntax error at or near "("

func (a *Adapter) createTableifNotExists() error {
	err := a.db.Model((*CasbinRule)(nil)).Table(a.tableName).CreateTable( &orm.CreateTableOptions{
		Temp:        false,
		IfNotExists: true,
	})
	if err != nil {
		return err
	}
	return nil
}

@closetool can you provide a full example code, maybe a github repo?

Guys, Any tentative timelines for fixing this

Guys, any update ?

Closing as duplicate of #1810