Skip to content
This repository has been archived by the owner on Jun 28, 2018. It is now read-only.

Return a new instance of Driver from registry's GetDriver() function #195

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

bradley219
Copy link

I've found that concurrent migrations on multiple schema are not possible due to the fact that GetDriver() returns a Driver singleton for all named drivers. There are definitely more sound ways to solve this (i.e. registering a factory method to create a customized new instance of Driver), but given the simplicity of the current design, I've opted to just create and return a new instance of Driver from GetDriver() by using the reflect package.

I've tested this using the MySQL driver specifically and am now able to run concurrent migrations on any number of unique database URLs.

FreGalle and others added 19 commits February 3, 2017 12:47
…eck-schema

Postgres: version table existence check in current schema
Avoid getting caught by go vet for using "\n" with Println

	main.go:187: Println call ends with newline
Golint. Rewrite cassandra driver
driver/sqlite3: Fix for upstream changes
Seems the sqlite3 packaged reverted to using non-pointer Error. This patch corrects the use of it here.
According to the PostgreSQL documentation (section 32.1.1.2), postgres
library supports two URI schemes: postgresql:// and postgres://

Reference:
https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING
Support for alternative postgres URI scheme
@bradley219
Copy link
Author

Not sure off the top of my head how to deal with the test failures involving RegisterMethodsReceiverForDriver()—this came as a surprise just now. If you have any ideas please let me know :)

@mattes
Copy link
Owner

mattes commented Apr 10, 2017

Sorry for the delay. Was out for conferences last week in SF.

I fixed this in v3. Would you mind checking that version out and see if it suits your use-case?

@mattes
Copy link
Owner

mattes commented Apr 20, 2017

Would you mind changing the target branch to v1 ?

@mattes mattes added the v/1 label Jul 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants