-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b44b07
commit 1ddc08d
Showing
34 changed files
with
2,160 additions
and
1,267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,38 @@ | ||
//go:build gorm | ||
|
||
package database | ||
|
||
// import ( | ||
// "lx-source/src/database/modules" | ||
// "lx-source/src/env" | ||
// "lx-source/src/sources" | ||
|
||
// "gorm.io/gorm" | ||
// ) | ||
|
||
// var DB *gorm.DB | ||
|
||
// func InitDB(dsn string) (err error) { | ||
// loger := env.Loger.NewGroup(`InitDB`) | ||
// defer loger.Free() | ||
// DB, err = gorm.Open(modules.Sqlite(dsn), &gorm.Config{}) | ||
// if err == nil { | ||
// for _, typ := range []struct { | ||
// Name string | ||
// Type interface{} | ||
// }{ | ||
// {Name: T_music, Type: &XMusicItem{}}, | ||
// {Name: T_lyric, Type: &XLyricItem{}}, | ||
// } { | ||
// for _, src := range sources.S_al { | ||
// err = DB.Table(src + `_` + typ.Name).AutoMigrate(typ.Type) | ||
// if err != nil { | ||
// return | ||
// } | ||
// } | ||
// } | ||
// } | ||
// return | ||
// } | ||
|
||
// type Driver struct{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//go:build cgo && gorm | ||
|
||
package modules | ||
|
||
// import ( | ||
// "gorm.io/driver/sqlite" | ||
// ) | ||
|
||
// var Sqlite = sqlite.Open |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//go:build !cgo && gorm | ||
|
||
package modules | ||
|
||
// import ( | ||
// "github.com/glebarez/sqlite" | ||
// ) | ||
|
||
// var Sqlite = sqlite.Open |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build extapp | ||
|
||
package server | ||
|
||
import ( | ||
|
Oops, something went wrong.