chore: remove unused flags for sqlite (#997)

This commit is contained in:
boojack 2023-01-30 00:03:21 +08:00 committed by GitHub
parent 1bdb0d465c
commit 4a7b764ab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ func run() error {
println(greetingBanner)
fmt.Printf("Version %s has started at :%d\n", profile.Version, profile.Port)
return serverInstance.Run(ctx)
return serverInstance.Start(ctx)
}
func main() {

View File

@ -117,7 +117,7 @@ func NewServer(ctx context.Context, profile *profile.Profile) (*Server, error) {
return s, nil
}
func (s *Server) Run(ctx context.Context) error {
func (s *Server) Start(ctx context.Context) error {
if err := s.createServerStartActivity(ctx); err != nil {
return errors.Wrap(err, "failed to create activity")
}

View File

@ -43,7 +43,7 @@ func (db *DB) Open(ctx context.Context) (err error) {
}
// Connect to the database without foreign_key.
sqliteDB, err := sql.Open("sqlite3", db.profile.DSN+"?cache=shared&_foreign_keys=0&_journal_mode=WAL")
sqliteDB, err := sql.Open("sqlite3", db.profile.DSN+"?_foreign_keys=0")
if err != nil {
return fmt.Errorf("failed to open db with dsn: %s, err: %w", db.profile.DSN, err)
}