mirror of
				https://github.com/zitadel/zitadel.git
				synced 2025-11-04 05:52:51 +00:00 
			
		
		
		
	* feat: get views and failed events * feat: get views and failed events * feat: get views and failed events * Update internal/view/repository/sequence.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/view/repository/general_query.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> Co-authored-by: Livio Amstutz <livio.a@gmail.com>
		
			
				
	
	
		
			26 lines
		
	
	
		
			588 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			588 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package repository
 | 
						|
 | 
						|
import (
 | 
						|
	"database/sql"
 | 
						|
	"github.com/caos/zitadel/internal/config/types"
 | 
						|
	"github.com/caos/zitadel/internal/errors"
 | 
						|
	"github.com/jinzhu/gorm"
 | 
						|
)
 | 
						|
 | 
						|
type ViewConfig struct {
 | 
						|
	SQL *types.SQL
 | 
						|
}
 | 
						|
 | 
						|
func Start(conf ViewConfig) (*sql.DB, *gorm.DB, error) {
 | 
						|
	sqlClient, err := sql.Open("postgres", conf.SQL.ConnectionString())
 | 
						|
	if err != nil {
 | 
						|
		return nil, nil, errors.ThrowPreconditionFailed(err, "SQL-9qBtr", "unable to open database connection")
 | 
						|
	}
 | 
						|
 | 
						|
	client, err := gorm.Open("postgres", sqlClient)
 | 
						|
	if err != nil {
 | 
						|
		return nil, nil, err
 | 
						|
	}
 | 
						|
	return sqlClient, client, nil
 | 
						|
}
 |