Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

mvid
Copy link
Contributor

@mvid mvid commented Jan 20, 2020

No description provided.

@mvid mvid requested a review from dhui January 20, 2020 19:36
@coveralls
Copy link

coveralls commented Jan 20, 2020

Pull Request Test Coverage Report for Build 654

  • 22 of 28 (78.57%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 52.115%

Changes Missing Coverage Covered Lines Changed/Added Lines %
database/neo4j/neo4j.go 22 28 78.57%
Totals Coverage Status
Change from base Build 650: 0.2%
Covered Lines: 2476
Relevant Lines: 4751

💛 - Coveralls

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migrations in migrate are treated as opaque blobs: https://github.com/golang-migrate/migrate/blob/master/MIGRATIONS.md#migration-content-format

To support multiple statements in a migration, add a x-multi-statement option and document accordingly. See the cassandra and clickhouse drivers as an example.

@mvid mvid force-pushed the bug/multi-statement branch from 9b8889f to ae1cc1a Compare January 21, 2020 21:51
Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the feedback! Just a couple more things.

URL: uri.String(),
AuthToken: authToken,
MigrationsLabel: DefaultMigrationsLabel,
MultiStatement: multi == "true",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use strconv.ParseBool() and handle the error properly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if _, err := neo4j.Collect(session.Run(string(body[:]), nil)); err != nil {
return err
if n.config.MultiStatement {
statements := bytes.Split(body, []byte{';'})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well make the separate an internal package level variable/constant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulled into a constant

@dhui dhui merged commit 6909319 into golang-migrate:master Jan 23, 2020
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.

3 participants