func ConnectDatabase(dbname string) {
	// gorm.Open() will return *gorm.DB object.
	// By default, gorm does connection pooling to support concurrency.
	// So we don't need to do `defer DB.Close()`
	db, err := gorm.Open(sqlite.Open(dbname), &gorm.Config{})
	if err != nil {
		panic("failed to connect database")
	}

	db.AutoMigrate(&Item{})

	DB = db
}
// ConnectDatabase initializes the database connection.
ConnectDatabase initializes the database connection.
// ConnectDatabase initializes the database connection .
func ConnectDatabase(dbname string) {
	db, err := gorm.Open(sqlite.Open(dbname), &gorm.Config{})
	if err != nil {
		panic("failed to connect database")
	}
	db.AutoMigrate(&Item{})
	DB = db
}
func ConnectDatabase ( dbname string ) { db , err := gorm . Open ( sqlite . Open ( dbname ) , & gorm . Config { } ) if err != nil { panic ( " " ) } db . AutoMigrate ( & Item { } ) DB = db }
ConnectDatabase initializes the database connection.
ConnectDatabase initializes the database connection .
// gorm.Open() will return *gorm.DB object. // By default, gorm does connection pooling to support concurrency. // So we don't need to do `defer DB.Close()`