Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factory func Open #2

Closed
kiyonlin opened this issue Jun 17, 2020 · 2 comments
Closed

Factory func Open #2

kiyonlin opened this issue Jun 17, 2020 · 2 comments

Comments

@kiyonlin
Copy link

func Open(dsn string) gorm.Dialector {
	return &Dialector{DSN: dsn}
}

Open is the factory func of sqlite driver to generate a gorm.Dialector, but not open a db connection in actual. Maybe named New is more reasonable.

The same as other drivers.

@jinzhu
Copy link
Member

jinzhu commented Jun 18, 2020

Thank you for your feedback, I am thinking to use Open just accepts DSN, and the New method accepts more configurations than DSN like the MySQL driver https://github.com/go-gorm/mysql/blob/aca31f41d71bc2322361afd646f7241497b2b652/mysql.go#L27-L33

Any suggestion?

@jinzhu jinzhu closed this as completed Jun 18, 2020
@kiyonlin
Copy link
Author

That's great. Thank you for your job.

samuelncui pushed a commit to samuelncui/gorm-sqlite that referenced this issue Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants