Skip to content

Allow custom drivers#11

Merged
jinzhu merged 1 commit intogo-gorm:masterfrom
tekkamanendless:driver-name
Sep 24, 2020
Merged

Allow custom drivers#11
jinzhu merged 1 commit intogo-gorm:masterfrom
tekkamanendless:driver-name

Conversation

@tekkamanendless
Copy link
Copy Markdown
Contributor

@tekkamanendless tekkamanendless commented Sep 22, 2020

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Much like the mysql driver's DriverName, this allows you to specify a custom driver for SQLite. This is important when creating custom functions, for example.

I also added unit tests to cover these changes.

User Case Description

I frequently use SQLite in-memory databases for unit tests for my projects that use MySQL and Postgres in production. Part of doing that is creating a custom SQLite driver that has some custom functions for parity with MySQL and Postgres (for example, CONCAT or NOW).

Because Gorm v2 does not directly specify the driver on the Open function anymore, this "driver" will need to be able to support it. The mysql driver already does this, so this just brings this driver up to par with that one.

Much like the `mysql` driver's `DriverName`, this allows you to
specify a custom driver for SQLite.  This is important when creating
custom functions, for example.
@jinzhu jinzhu merged commit 3ca308c into go-gorm:master Sep 24, 2020
samuelncui pushed a commit to samuelncui/gorm-sqlite that referenced this pull request Oct 4, 2023
…hub.com/glebarez/go-sqlite-1.14.8

Bump github.com/glebarez/go-sqlite from 1.14.7 to 1.14.8
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

Successfully merging this pull request may close these issues.

2 participants