GithubHelp home page GithubHelp logo

Run Migration not in a transaction about tern HOT 5 CLOSED

jackc avatar jackc commented on August 26, 2024
Run Migration not in a transaction

from tern.

Comments (5)

jackc avatar jackc commented on August 26, 2024

That setting isn't wired into the CLI. No reason not to, just no one ever did it. 🤷

from tern.

davidmdm avatar davidmdm commented on August 26, 2024

Would there be a filename convention to disable running the Migration in a transaction that would be suitable for you?
If so than I might make a PR for it.
something like:
002_create_table_foo.no_tx.sql?

Other tools generally enable transactions with the .tx.sql suffix instead of disabling them, but doing that would break backwards compatability.

Is this a feature you would like to have?

from tern.

jackc avatar jackc commented on August 26, 2024

The overall feature is fine, but I would probably lean toward a magic comment rather than something as part of the file name. That would allow conveniently adding more per migration behavior flags.

from tern.

JosefWN avatar JosefWN commented on August 26, 2024

It's not just the CLI, it's a bit clunky to use in code too. This struct is not exported:

type defaultMigratorFS struct{}

So if I want to set DisableTx in the MigratorOptions passed to NewMigratorEx, I have to reimplement the default file system migrator. Regardless of #43 it could be good to expose this struct for the future (unless MigratorFS will always be the only option).

from tern.

jackc avatar jackc commented on August 26, 2024

This should be resolved on v2-dev with b23e02f.

from tern.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.