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

Provide Conn type #157

Open
AlekSi opened this issue Jun 20, 2018 · 0 comments · May be fixed by #244
Open

Provide Conn type #157

AlekSi opened this issue Jun 20, 2018 · 0 comments · May be fixed by #244
Labels
Milestone

Comments

@AlekSi
Copy link
Member

AlekSi commented Jun 20, 2018

Similary to reform.DB and reform.TX, we should provide reform.Conn type like database/sql.Conn.

This is very important for drivers that implement database/sql/driver.SessionResetter interface. With them, hacks like

// Use single connection so various session-related variables work.
// For example: "PRAGMA foreign_keys" for SQLite3, "SET IDENTITY_INSERT" for MS SQL, etc.
sqlDB.SetMaxIdleConns(1)
sqlDB.SetMaxOpenConns(1)
sqlDB.SetConnMaxLifetime(0)

no longer work.

Conn requires context, so #73 should be done first.

See also #151.

@AlekSi AlekSi added this to the v1.4.0 milestone Jun 20, 2018
@AlekSi AlekSi modified the milestones: v1.4.0, v1.5.0 Mar 8, 2020
@AlekSi AlekSi linked a pull request Aug 31, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant